remorses / genql

Type safe TypeScript client for any GraphQL API
https://genql.dev
MIT License
881 stars 37 forks source link

Fix issue in typeSelection.ts when handling nullable non-scalars #168

Open olee opened 7 months ago

olee commented 7 months ago

When using this library, I notices some strange issues with the output types when relations were not marked as required.

Will try to provide a full example of a schema plus the broken typings the unmodified / modified variants generate later if required.

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
genql ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 3:04am
remorses commented 7 months ago

Can you add an example here? https://github.com/remorses/genql/blob/master/integration-tests/schema.graphql

And a test here if possible https://github.com/remorses/genql/blob/master/integration-tests/tests/execution.ts

To run test go inside integration-tests and run pnpm gen && pnpm test

olee commented 7 months ago

Will see if I can add those soon, thx.

remorses commented 7 months ago

Even just the graphql schema is enough, I can add tests myself