You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this discussion mentioning that graphql-env.d.ts wasn't regenerating on schema change, but that the OP redacted their discussion.
However, I seemed to have found that when the return type of a query is changed in the schema.graphql, then the .d.ts file isn't updated. However it seems to update fine when new properties are added or removed from the schema.graphql.
In order for me to see changes reflected in VScode, I have to CMD+P > Restart TS Server when query return types change. I have linked a sample repo.
Example of property being added/removed and LSP correctly catching it:
Screen.Recording.2024-07-08.at.4.57.54.PM.mov
Example of changing the return type of a Query NOT updating the type until manual TS Server refresh:
Edit: In the first "working" video, recreating my steps, I discovered that todo on line 25 is actually typed as { ..., hi: unknown }, not string. A hard refresh of TS Server in VSCode correctly updates it to String
pmooney-socraticworks
changed the title
gql.tada not rebuilding on schema.graphql query return type changesgql.tada not updating types on schema.graphql changes
Jul 9, 2024
I can confirm that this is happening. We didn't really consider manual editing of the SDL file (and this is still not recommended/expected, as it's not a great or the "definitive" GraphQL experience), however, there's an easy workaround. We'll have to test this on multiple platforms though.
Thanks @kitten for looking at it. I was manually editing the SDL file to show the issue, but in reality, the same thing happens when my graphql server outputs its schema (using type-graphql)
Describe the bug
I found this discussion mentioning that
graphql-env.d.ts
wasn't regenerating on schema change, but that the OP redacted their discussion.However, I seemed to have found that when the return type of a query is changed in the
schema.graphql
, then the .d.ts file isn't updated. However it seems to update fine when new properties are added or removed from theschema.graphql
.In order for me to see changes reflected in VScode, I have to CMD+P > Restart TS Server when query return types change. I have linked a sample repo.
Example of property being added/removed and LSP correctly catching it:
Screen.Recording.2024-07-08.at.4.57.54.PM.mov
Example of changing the return type of a Query NOT updating the type until manual TS Server refresh:
Screen.Recording.2024-07-08.at.5.01.53.PM.mov
Reproduction
https://github.com/pmooney-socraticworks/gql-tada-issue
gql.tada version
1.8.1
Validations
The text was updated successfully, but these errors were encountered: