diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js index 114072dc00..709c37f8a1 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js @@ -36,6 +36,13 @@ const graphql = graphql(` } `); +const graphql = graphql( + ` + query { test } + `, + [var1, var2] +); + const query = /* GraphQL */ 'query { id } '; const query = graphql('query { id } '); const query = graphql( diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts b/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts index 3b21765303..5ae8cefaad 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts @@ -35,6 +35,17 @@ const query = graphql( 'query { id }' ); +const query = graphql(` + query { id } +`); + +const query = graphql( + ` + query { id } + `, + [var1, var2] +); + const queryWithInlineComment = `#graphql query { user(id: "5", name: boolean) { diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap index 292dce5c66..7f7067ef4d 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap @@ -143,6 +143,25 @@ something | meta.embedded.block.graphql meta.select } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql \` | meta.embedded.block.graphql punctuation.definition.string.template.end.js ) | +; | + | +const graphql = graphql | +( | + | meta.embedded.block.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +test | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js +, | meta.embedded.block.graphql + [var1, var2] | meta.embedded.block.graphql +) | ; | | const query = | @@ -513,6 +532,40 @@ id | meta.embedded.block.graphql meta.selectionset. } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql ' | meta.embedded.block.graphql punctuation.definition.string.template.end.js ) | +; | + | +const query = graphql | +( | +\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js +) | +; | + | +const query = graphql | +( | + | meta.embedded.block.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js +, | meta.embedded.block.graphql + [var1, var2] | meta.embedded.block.graphql +) | ; | | const queryWithInlineComment = |