Graphql-code-generator: Error scanning files for graphql`` syntax

Created on 19 Nov 2018  路  4Comments  路  Source: dotansimha/graphql-code-generator

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

bug core waiting-for-release

All 4 comments

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 :)

Fixed in 0.14.2 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdaouas picture mdaouas  路  3Comments

zenVentzi picture zenVentzi  路  3Comments

iamdanthedev picture iamdanthedev  路  3Comments

mszczepanczyk picture mszczepanczyk  路  3Comments

leebenson picture leebenson  路  3Comments