dangcuuson / graphql-schema-typescript

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

Support graphql v16 #67

Closed IngusSkaistkalns closed 9 months ago

IngusSkaistkalns commented 2 years ago

Add support for graphql 16.

Majority of changes taken from #61, so kudos to @tony!

Anyone, please take a look at src/utils.ts#L27

Originally error looks like at :

Conversion of type 'ObjMap<unknown>' to type 'IntrospectionQuery' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Property '__schema' is missing in type 'ObjMap<unknown>' but required in type 'IntrospectionQuery'.

There should be a better way how to handle type of data.

I assume some sort of resolver is required when executing graphql introspection query, so type of data contains key __schema.

shevchenkonik commented 2 years ago

hey there!

good work :)

do we have any chance of getting this released? @dangcuuson

jlowcs commented 2 years ago

I forked the package and published these changes as @jlowcs/graphql-schema-typescript@2.0.0

tuanlc commented 1 year ago

@jlowcs Thank you for the forked version! I've temporarily used this version.