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
Describe the bug FragmentDoc are imported without being used if used with near-operation-file preset and noGraphQLTag enabled. This happens when the fragment of a different file is being imported to be used in an operation.
Certain apps such as create-react-app enforces noUnusedLocals by default which causes TS compilation to fail.
To Reproduce
Go to this template and run yarn gg. GetProject.operation.generated.tsx is generated with 2 unused FragmentDoc: GetProject_IdFragmentDoc and GetProject_StatusFragmentDoc. These 2 fragments are separate files and are being used in the main GetProject query
Describe the bug
FragmentDoc
are imported without being used if used withnear-operation-file
preset andnoGraphQLTag
enabled. This happens when the fragment of a different file is being imported to be used in an operation.Certain apps such as
create-react-app
enforcesnoUnusedLocals
by default which causes TS compilation to fail.To Reproduce
Go to this template and run
yarn gg
.GetProject.operation.generated.tsx
is generated with 2 unusedFragmentDoc
:GetProject_IdFragmentDoc
andGetProject_StatusFragmentDoc
. These 2 fragments are separate files and are being used in the mainGetProject
queryhttps://codesandbox.io/s/gcg-14-experiments-c8l15
codegen.yml
config file:Expected behavior
It should not include
FragmentDoc
if it's not usedAdditional context
This is probably a side effect of #2106?
The text was updated successfully, but these errors were encountered: