preset: client
doesn't detect documents in .astro
files, but does watch the files properly
#9221
Labels
stage/1-reproduction
A reproduction exists
Which packages are impacted by your issue?
@graphql-codegen/cli, @graphql-codegen/client-preset
Describe the bug
Setting up the codegen to watch
documents: ['./**/*.astro']
results in the file getting watched correctly, but it doesn't seem like it's able to determine any GraphQL documents and type them properly.For example, the following frontmatter of an Astro file will result in
postsQuery
being typed asundefined
, but moving the query into a.ts
file will correctly type the query:Changing the file does trigger the codegen to re-run while in watch mode, but the type of the query won't get generated.
Your Example Website or App
Create a new astro app as described below
Steps to Reproduce the Bug or Issue
npm create astro@latest
codegen.ts
file in the app root with these settings:yarn graphql-codegen
src/pages/index.astro
file:The
allFilmsWithVariablesQueryDocument
document will stay typed asunknown
.Expected behavior
As a user, I would expect that the document is detected by the codegen and returns a typed document node. Instead, it stays as
unknown
.Screenshots or Videos
No response
Platform
graphql
version: 16.6.0@graphql-codegen/cli
version(s): 3.2.2"@graphql-codegen/client-preset
version(s): 2.1.1Codegen Config File
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: