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
Is your feature request related to a problem? Please describe.
graphql-codegen was silently ignoring source files and not extracting documents.
I was able to track it down to our use of the parser plugin explicitResourceManagement, which is declared in the babelrc.
But it turns out that graphql-tag-pluck hardcodes babel options based on file extensions 1, and passes those directly to parse()2 without possibility of intervention. It ignores existing babel configuration.
Describe the solution you'd like
graphql-tag-plug should attempt to use babel.loadPartialConfig3, and use that if it succeeds.
Describe alternatives you've considered
Alternatively, allow passing a list of plugins or babel options overrides through. Note that this might require plumbing up a few levels if interfaces through CodeFileLoader and graphql-codegen itself to make sure it's properly exposed.
Is your feature request related to a problem? Please describe.
graphql-codegen
was silently ignoring source files and not extracting documents.I was able to track it down to our use of the parser plugin
explicitResourceManagement
, which is declared in the babelrc.But it turns out that
graphql-tag-pluck
hardcodes babel options based on file extensions 1, and passes those directly toparse()
2 without possibility of intervention. It ignores existing babel configuration.Describe the solution you'd like
graphql-tag-plug
should attempt to usebabel.loadPartialConfig
3, and use that if it succeeds.Describe alternatives you've considered
Alternatively, allow passing a list of plugins or babel options overrides through. Note that this might require plumbing up a few levels if interfaces through
CodeFileLoader
andgraphql-codegen
itself to make sure it's properly exposed.Footnotes
https://github.com/ardatan/graphql-tools/blob/848de826f21fddd48fac1a93f6d616df6a135c08/packages/graphql-tag-pluck/src/config.ts#L10 ↩
https://github.com/ardatan/graphql-tools/blob/848de826f21fddd48fac1a93f6d616df6a135c08/packages/graphql-tag-pluck/src/index.ts#L248 ↩
https://babeljs.io/docs/babel-core#loadoptions ↩
The text was updated successfully, but these errors were encountered: