Closed pmooney-socraticworks closed 1 month ago
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
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:
https://github.com/0no-co/gql.tada/assets/111302225/8c5d0f43-9a19-475d-b8ea-bb8b474f80c7
Example of changing the return type of a Query NOT updating the type until manual TS Server refresh:
https://github.com/0no-co/gql.tada/assets/111302225/b7a1501e-73ad-4dc8-bce4-bfbf71e7f9d7
Reproduction
https://github.com/pmooney-socraticworks/gql-tada-issue
gql.tada version
1.8.1
Validations