0no-co / gql.tada

🪄 Magical GraphQL query engine for TypeScript
https://gql-tada.0no.co
MIT License
2.59k stars 43 forks source link

ResultOf and VariablesOf don't return proper types after upgrading typescript to 5.5 #364

Closed Danbka closed 2 months ago

Danbka commented 3 months ago

Describe the bug

After upgrading typescript to 5.5 ResultOf and VariablesOf don't return proper types and autocompletion doesn't work. You can reproduce it in an official example: example-pokemon-api

But as soon as you downgrade typescript to 5.4.3 the autocompletion works image

image

tsconfig.js was adjusted according to the documentation: https://gql-tada.0no.co/devlog/2024-06-26an

Reproduction

https://github.com/0no-co/gql.tada/tree/main/examples/example-pokemon-api

gql.tada version

gql.tada 1.8.5

Validations

kitten commented 3 months ago

The example folders cannot be used in a reproduction and are a bit special. I've been working on this and trying to find a nice balance, and also see if we can get TypeScript plugin support on a sandbox (which didn't work on any of the usual ones before), but it's worth noting that this is likely an issue isolated to a configuration issue.

For example, using gql.tada/ts-plugin does not work in the examples, and resolution of it fails, since the symlink won't be resolved locally.

The TypeScript version is deduplicated across the monorepo and currently, the examples are part of this main monorepo and not separated (like we did with urql/examples/ for example), since that takes some more setup and maintenance scripts.

If you're trying out gql.tada, I'd suggest you to copy the examples out of our repo and test them in isolation. Changing configuration or introducing dependency issues is unfortunately pretty easy while they're in the monorepo

Danbka commented 3 months ago

Thank you for the quick reply.

I've created a new repository to repro it: https://github.com/Danbka/tada-typescript-bug

image

Downgrade typescript: npm i typescript@5.4.3

and Pokemon's properties are known:

image

kitten commented 3 months ago

does not reproduce for me, sorry

kitten commented 2 months ago

Closing due to inactivity, but if this comes up for someone else, or you have some more ideas of what this could be caused by happy to reopen of course ❤️