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

Can graphql-let be used with Vite? #638

Open
alex-vladut opened this issue Nov 11, 2022 · 1 comment
Open

Can graphql-let be used with Vite? #638

alex-vladut opened this issue Nov 11, 2022 · 1 comment

Comments

@alex-vladut
Copy link

I would be curious if it is possible to use the loader with Vite in any way? Otherwise, does anyone know of an equivalent library to generate typed document nodes for Vite? Thanks

@alex-vladut
Copy link
Author

alex-vladut commented Dec 11, 2022

In case anyone else finds this approach useful, I played with it and adapted the @vitejs/plugin-react to scan graphql files and apply the graphql-let loader to generate the types. It seems to do a good enough job so far, here you can find a small gist with what the config looks like: https://gist.github.com/alex-vladut/98db99556e1588449ae1457d68a7fb19

It is also available as an NPM package https://www.npmjs.com/package/@lente/vite-plugin-graphql

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