We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d2689f commit c7ed50aCopy full SHA for c7ed50a
packages/query-graphql/src/decorators/graphql-resolve-info.utils.ts
@@ -68,7 +68,18 @@ function parseFieldNodes<DTO>(
68
): QueryResolveTree<DTO> | QueryResolveFields<DTO> {
69
const asts: ReadonlyArray<SelectionNode> = Array.isArray(inASTs) ? inASTs : [inASTs]
70
71
- return asts.reduce((tree, fieldNode) => {
+ const astsWithInlinedFragments = asts.flatMap(ast => {
72
+ if (ast.kind === Kind.FRAGMENT_SPREAD) {
73
+ const fragment = resolveInfo.fragments[ast.name.value];
74
+ if (fragment) {
75
+ return fragment.selectionSet.selections;
76
+ }
77
+ return [];
78
79
+ return ast;
80
+ })
81
+
82
+ return astsWithInlinedFragments.reduce((tree, fieldNode) => {
83
let name: string
84
let alias: string
85
0 commit comments