I'm trying to generate my types with yarn graphql-schema-typescript generate-ts graphql and getting this error:
Message: null
Error: GraphQLError [Object]: Syntax Error: Unexpected Name "graphql".
at syntaxError (/Users/sam/vytal/partner_app/node_modules/graphql/error/syntaxError.js:15:10)
at Parser.unexpected (/Users/sam/vytal/partner_app/node_modules/graphql/language/parser.js:1482:41)
at Parser.parseDefinition (/Users/sam/vytal/partner_app/node_modules/graphql/language/parser.js:155:16)
at Parser.many (/Users/sam/vytal/partner_app/node_modules/graphql/language/parser.js:1537:26)
at Parser.parseDocument (/Users/sam/vytal/partner_app/node_modules/graphql/language/parser.js:109:25)
at parse (/Users/sam/vytal/partner_app/node_modules/graphql/language/parser.js:36:17)
at Object.buildSchema (/Users/sam/vytal/partner_app/node_modules/graphql/utilities/buildASTSchema.js:116:36)
at Object.<anonymous> (/Users/sam/vytal/partner_app/node_modules/graphql-schema-typescript/lib/index.js:94:42)
at step (/Users/sam/vytal/partner_app/node_modules/graphql-schema-typescript/lib/index.js:40:23)
at Object.throw (/Users/sam/vytal/partner_app/node_modules/graphql-schema-typescript/lib/index.js:21:53) {
locations: [ { line: 1, column: 1 } ]
}
My gql config is located in graphql/graphql.config
My project is using graphql: 15.3.0, node: 14.12.0
I have a very similar setup in another project that uses graphql: 14.7.0, and there everything works fine. When I use 14.7.0 in this project, ts type generation also works fine. So there must be some breaking changes in 14->15 that graphql-schema-typescript is not handling yet.
Any idea how to fix this without reverting my entire project back to graphql 14?
I'm trying to generate my types with
yarn graphql-schema-typescript generate-ts graphql
and getting this error:My gql config is located in
graphql/graphql.config
My project is usinggraphql: 15.3.0
,node: 14.12.0
I have a very similar setup in another project that uses
graphql: 14.7.0
, and there everything works fine. When I use14.7.0
in this project, ts type generation also works fine. So there must be some breaking changes in 14->15 that graphql-schema-typescript is not handling yet.Any idea how to fix this without reverting my entire project back to graphql 14?