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 couldn't find this in the docs, or browsing the modules.
I see plenty of plugins to generate code that works with svelte, but I can't seem to find anything to parse *.svelte files and load graphql queries from them.
Everything works if I move the query into *.ts or *.graphql, but not from *.svelte.
Does this exist?
I'd like to keep the graphql queries very close to the code that uses them.
(Yes, I'm aware it'd have to run the Svelte compiler on the fly and parse the result into an AST, but the Svelte compiler is easily available as a library.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I couldn't find this in the docs, or browsing the modules.
I see plenty of plugins to generate code that works with svelte, but I can't seem to find anything to parse *.svelte files and load graphql queries from them.
Everything works if I move the query into *.ts or *.graphql, but not from *.svelte.
Does this exist?
I'd like to keep the graphql queries very close to the code that uses them.
(Yes, I'm aware it'd have to run the Svelte compiler on the fly and parse the result into an AST, but the Svelte compiler is easily available as a library.)
Beta Was this translation helpful? Give feedback.
All reactions