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
`import * as Operations from '${this.clearExtension(this.config.importDocumentNodeExternallyFrom)}';`
doesn't work as documented.
As documented in on documentMode
external: document nodes are imported from an external file. To be used with importDocumentNodeExternallyFrom
and on `` itself
any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
The only thing that it currently does is adding an import line to the generated file like this
import * as Operations from 'ANY_STRING';
This does not help for using external document nodes. It would be expected that either every type and operation in the file is prefixed with Operations. or that the proper imports from the given path are added (preferred).
Now it just generates a file that is missing all type and operation references.
Steps to Reproduce the Bug or Issue
Set documentMode to external
Set importDocumentNodeExternallyFrom to the path of the generated types and operations
Look if the generated file has all references correct
Expected behavior
Add correct import statements for each used type and operation from the provided path.
Alternatively provide an option to prefix every operation with the imported object prefix, in this case Operations.. Currently there is only typesPrefix for types, nothing for operations.
Screenshots or Videos
No response
Platform
OS: macOS, Windows, Linux
NodeJS: 20
graphql version: 16.9
@graphql-codegen/* version(s): current
Codegen Config File
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Which packages are impacted by your issue?
visitor-plugin-common
Describe the bug
The setting
importDocumentNodeExternallyFrom
implemented heregraphql-code-generator/packages/plugins/other/visitor-plugin-common/src/client-side-base-visitor.ts
Line 666 in d3dc84d
doesn't work as documented.
As documented in on
documentMode
and on `` itself
The only thing that it currently does is adding an import line to the generated file like this
This does not help for using external document nodes. It would be expected that either every type and operation in the file is prefixed with
Operations.
or that the proper imports from the given path are added (preferred).Now it just generates a file that is missing all type and operation references.
Steps to Reproduce the Bug or Issue
Expected behavior
Add correct import statements for each used type and operation from the provided path.
Alternatively provide an option to prefix every operation with the imported object prefix, in this case
Operations.
. Currently there is onlytypesPrefix
for types, nothing for operations.Screenshots or Videos
No response
Platform
graphql
version: 16.9@graphql-codegen/*
version(s): currentCodegen Config File
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: