Skip to content

Fragment Arguments Reference Implementation #3835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add flag for parser
  • Loading branch information
mjmahone committed Feb 9, 2023
commit bfd80a6dcbcf974c18f757df848d854c43b8a9db
2 changes: 1 addition & 1 deletion src/__testUtils__/kitchenSinkQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ query queryName($foo: ComplexType, $site: Site = MOBILE) @onQuery {
...frag @onFragmentSpread
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated?


field3!
field4?
requiredField5: field5!
Expand Down
2 changes: 1 addition & 1 deletion src/execution/__tests__/variables-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function executeQuery(
query: string,
variableValues?: { [variable: string]: unknown },
) {
const document = parse(query);
const document = parse(query, { experimentalFragmentArguments: true });
return executeSync({ schema, document, variableValues });
}

Expand Down
23 changes: 13 additions & 10 deletions src/utilities/__tests__/TypeInfo-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,20 @@ describe('visitWithTypeInfo', () => {
it('supports traversals of fragment arguments', () => {
const typeInfo = new TypeInfo(testSchema);

const ast = parse(`
query {
...Foo(x: 4)
}
const ast = parse(
`
query {
...Foo(x: 4)
}

fragment Foo(
$x: ID!
) on QueryRoot {
human(id: $x) { name }
}
`);
fragment Foo(
$x: ID!
) on QueryRoot {
human(id: $x) { name }
}
`,
{ experimentalFragmentArguments: true },
);

const visited: Array<any> = [];
visit(
Expand Down