Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output typings not being regenerated when schema changes #432

Open
3 tasks done
lee-borsboom opened this issue Jan 15, 2025 · 0 comments
Open
3 tasks done

Output typings not being regenerated when schema changes #432

lee-borsboom opened this issue Jan 15, 2025 · 0 comments

Comments

@lee-borsboom
Copy link

lee-borsboom commented Jan 15, 2025

Greetings!

I've noticed that the output typing don't seem to be automatically generated when using the TS plugin inside VSCode unless one restarts TypeScript in the IDE after every change to the schema.

In terms of reproduction, please follow the below steps:

  1. Download the example-pokemon-api directory from the master branch of this repo
  2. Navigate to the example-pokemon-api directory and run npm install
  3. Open said directory with VSCode
  4. Ensure you accept the prompt to use the workspace's version of TypeScript
  5. Modify example-pokemon-api/schema.graphql (either from within VSCode or using an external editor) e.g. add a field abc to the Attack type
  6. Observe that there is no abc field on the Attack type in example-pokemon-api/src/graphql-env.d.ts
  7. Restart TypeScript in VSCode
  8. Observe that the abc field on the Attack type in example-pokemon-api/src/graphql-env.d.ts is now present

Note that the version of gql.tada in the example directory is an older version (1.6.0). I also (locally) upgraded it to 1.8.10 and updated the tsconfig according to your docs, but the problem persists.

Details of VSCode / environment in case it's useful for reproduction:
Version: 1.96.2 (Universal)
Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
Date: 2024-12-19T10:22:47.216Z (3 wks ago)
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 22.6.0

Reproduction

See above

gql.tada version

Reproduced on both 1.8.10 and 1.6.0

Validations

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Read the docs.
  • Follow our Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant