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
importing and using UINodeFragment in another operation will generate code that imports UiNodeFragment_ImageUiNode or UiNodeFragment_TextUiNode or UiNodeFragment.
Instead, generated code imports UiNodeFragment_ImageUiNode_ and UiNodeFragment_TextUiNode_, with additional undercores at the end.
Which packages are impacted by your issue?
@graphql-codegen/near-operation-file-preset
Describe the bug
Using
dedupeOperationSuffix: true
,inlineFragmentTypes: 'combine'
, and using union type together causes incorrect import names.You'd expect that given the following fragment,
which generates
importing and using
UINodeFragment
in another operation will generate code that importsUiNodeFragment_ImageUiNode
orUiNodeFragment_TextUiNode
orUiNodeFragment
.Instead, generated code imports
UiNodeFragment_ImageUiNode_
andUiNodeFragment_TextUiNode_
, with additional undercores at the end.Your Example Website or App
https://github.com/YoonjiJang/graphql-codegen-union-fragment
Steps to Reproduce the Bug or Issue
npm install
npm run graphql-codegen
Expected behavior
The imports should be
UiNodeFragment_ImageUiNode
andUiNodeFragment_TextUiNode
.Screenshots or Videos
Platform
graphql
version: 16.9.0@graphql-codegen/cli
: 5.0.2@graphql-codegen/near-operation-file-preset
: 3.0.0@graphql-codegen/typescript
: 4.0.9@graphql-codegen/typescript-operations
: 4.2.3Codegen Config File
Additional context
No response
The text was updated successfully, but these errors were encountered: