You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to generate typescript code from an invalid graphql file:
$ graphql-schema-typescript generate-ts generate-ts src/chema.graphql
Message: null
Error: { GraphQLError: Syntax Error: Cannot parse the unexpected character "/".
at syntaxError (/Users/ldiqual/Siteline/siteline/node_modules/graphql/error/syntaxError.js:15:10)
at readToken (/Users/ldiqual/Siteline/siteline/node_modules/graphql/language/lexer.js:270:38)
at Object.lookahead (/Users/ldiqual/Siteline/siteline/node_modules/graphql/language/lexer.js:54:43)
at Object.advanceLexer [as advance] (/Users/ldiqual/Siteline/siteline/node_modules/graphql/language/lexer.js:44:33)
at Parser.expectToken (/Users/ldiqual/Siteline/siteline/node_modules/graphql/language/parser.js:1398:19)
at Parser.many (/Users/ldiqual/Siteline/siteline/node_modules/graphql/language/parser.js:1514:10)
at Parser.parseDocument (/Users/ldiqual/Siteline/siteline/node_modules/graphql/language/parser.js:111:25)
at parse (/Users/ldiqual/Siteline/siteline/node_modules/graphql/language/parser.js:36:17)
at Object.buildSchema (/Users/ldiqual/Siteline/siteline/node_modules/graphql/utilities/buildASTSchema.js:462:43)
at Object.<anonymous> (/Users/ldiqual/Siteline/siteline/node_modules/graphql-schema-typescript/lib/index.js:98:42)
message: 'Syntax Error: Cannot parse the unexpected character "/".',
locations: [ { line: 1, column: 1 } ] }
This is deviated version of graphql. Downgrade version suit with graphql-schema-typescript. Example my version graphql-schema-typescript is 1.2.9, i use graphql version 14.0.1
When trying to generate typescript code from an invalid graphql file:
What happens is that https://github.com/dangcuuson/graphql-schema-typescript/blob/master/src/index.ts#L53 parses the schema file from a path, and it throws because there's a syntax error, but then the error is silenced and the code tries to parse the actual path string, which results in the error above.
The text was updated successfully, but these errors were encountered: