Describe the bug
Files that contains no graphql query gets included for parsing which is causing the generator to crash
To Reproduce
const other = 'asd';
export const endpoint = `${other}/graphql`;
const anotherVariable = `asdfasdf`;
Added failing test case #884
I think it will be hard to solve without parsing the files as AST. Already mentioned in #174
Thanks @Jontem !
I just talked to @kamilkisiela about the same issue, because he needs a similar logic for https://github.com/kamilkisiela/graphql-inspector .
So together with @DAB0mB, are working now to create a tool that extracts the GraphQL documents using the AST of the code files.
As soon it will be ready, we'll use it in the codegen and it will resolve this issue as well :)
WIP (by @DAB0mB) here: https://github.com/DAB0mB/graphql-tag-pluck
Fixed and merged in: https://github.com/dotansimha/graphql-code-generator/pull/907
Fixed in 0.14.2 馃帀