graphql-tools icon indicating copy to clipboard operation
graphql-tools copied to clipboard

Support .astro file loading on graphql-tag-pluck

Open XiNiHa opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

Currently, graphql-tag-pluck (and packages depending on it) doesn't support loading documents from .astro files.

Describe the solution you'd like

Add .astro support on graphql-tag-pluck

Describe alternatives you've considered

Let Astro users define documents in .ts files and import them, which is inconvenient.

Additional context

XiNiHa avatar Dec 16 '23 11:12 XiNiHa

~~The problem I found while implementing the fix is that the @astrojs/compiler doesn't provide any synchronous interfaces to transform the file (since it runs with WASM.) Is it okay to implement the feature async only?~~

Just found that the Astro compiler provides a synchronous version.

XiNiHa avatar Dec 16 '23 11:12 XiNiHa