danielwaltz / vite-plugin-graphql-codegen

Zero-config vite plugin that uses the vite file watcher to run graphql codegen programmatically without needing to start a separate watcher
https://www.npmjs.com/package/vite-plugin-graphql-codegen
MIT License
83 stars 8 forks source link

Watch doesn't update on schema change #7

Closed andrew-w-ross closed 2 years ago

andrew-w-ross commented 2 years ago

Description

Watch mode only seems to look for changes in the document. I've created this repo to recreate the issue. Make sure you're in the watch-issue branch and run dev. Changes to a document, App.tsx for example work fine. But changes to the schema don't.

Looking at the plugin code it seems like this function just needs to be updated to take schema into account. I opened up a pr #8 to fix this if you like.

danielwaltz commented 2 years ago

Sweet, I never even considered the possibility that the schema might coexist in the same place as the UI and documents, but I can see good reasons for that being the case in some instances. Good idea and good solution!

andrew-w-ross commented 2 years ago

@danielwaltz I'm actually experimenting using vite as my until build chain for both server and client side code. There is a project called vite-node that vitest uses.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 2.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: