Skip to content

Commit 1d93a20

Browse files
committed
fix: allow code generation from typescript generic graphql tag
Allow to use generic graph tag like: graphql<TResponse>`{ myQuery }`
1 parent c05c9e4 commit 1d93a20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/apollo-language-server/src/document.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function extractGraphQLDocumentsFromJSTemplateLiterals(
8989

9090
const documents: GraphQLDocument[] = [];
9191

92-
const regExp = new RegExp(`${tagName}\\s*\`([\\s\\S]+?)\``, "gm");
92+
const regExp = new RegExp(`${tagName}\\s*(?:<([\\sa-zA-Z0-9_,<>]+)>)?\\s*\`([\\s\\S]+?)\``, "gm");
9393

9494
let result;
9595
while ((result = regExp.exec(text)) !== null) {

0 commit comments

Comments
 (0)