dangcuuson / graphql-schema-typescript

Generate TypeScript from GraphQL's schema type definitions
190 stars 36 forks source link

Support for Graphql-js 16 #66

Open IngusSkaistkalns opened 2 years ago

IngusSkaistkalns commented 2 years ago

Hello, seems that library is incompatible with graphql-js 6

node node_modules/.bin/graphql-schema-typescript generate-ts schema.graphql --output app/javascript/graphqlSchema.ts
Message:  null
Error:  Error: Expected undefined to be a GraphQL schema. 
    at assertSchema (.../node_modules/graphql/type/schema.js:35:11)
    at validateSchema (.../node_modules/graphql/type/validate.js:34:28)
    at graphqlImpl (.../node_modules/graphql/graphql.js:52:64)
    at .../node_modules/graphql/graphql.js:21:43
    at new Promise (<anonymous>)
    at Object.graphql (.../node_modules/graphql/graphql.js:21:10)
    at .../node_modules/graphql-schema-typescript/lib/utils.js:58:52
    at step (.../node_modules/graphql-schema-typescript/lib/utils.js:33:23)
    at Object.next (.../wasteapp/node_modules/graphql-schema-typescript/lib/utils.js:14:53)
    at .../node_modules/graphql-schema-typescript/lib/utils.js:8:71
IngusSkaistkalns commented 2 years ago

Created PR -> #67

IngusSkaistkalns commented 2 years ago

Also created https://github.com/IngusSkaistkalns/graphql-schema-typescript/tree/support-graphql-16-with-lib with lib, so we can actually use package via git repo.

dangcuuson commented 9 months ago

Hi all,

Apologize for the extremely late reply. Due to Covid and other unforeseen circumstances, I wasn't able to get a hold of this account for a long time.

Back and merged PR now.