Which packages are impacted by your issue?
@graphql-codegen/client-preset
Describe the bug
Hi everyone, thank you for this great package!
We have been using codegen for a while now and recently updated the client-preset from 2.0.0 to 4.0.0 - now a lot of TypeScript errors are popping up across our react/next.js application. The errors could be found in every component that used fragments or that passed the fragment information down to a different component. Upon further inspection I was able to figure out that FragmentType is now returning never like in the screenshot below
It's still possible to access the information inside the fragment with useFragment, but the type is now unknown

Your Example Website or App
private repo
Steps to Reproduce the Bug or Issue
- Follow the guide to create fragments
My fragment is similar to this:
const UserInfoFragment = graphql(/* GraphQL */ `
fragment UserInfoFragment on User {
id
profile {
id
firstName
lastName
}
}
`);
- Type it using
FragmentType<typeof UserInfoFragment>
- Hover over the type or use two-slash queries
- See type
never
Expected behavior
Before we updated the client-preset, FragmentType did return the correct type information

Screenshots or Videos
No response
Platform
- OS: macOS
- NodeJS: v18.16.0
graphql version: 16.6.0
@graphql-codegen/* version(s):
- cli: 4.0.1
- client-preset: 4.0.0
While trying for a quick fix I also tried re-adding @graphql-codegen/typescript and @graphql-codegen/typescript-urql but this did not help.
Codegen Config File
schema: supergraph.graphql
documents: [utils/**/*.ts, pages/**/*.tsx, components/**/*.tsx, hooks/*.ts]
generates:
gql/:
preset: 'client'
plugins: []
config:
dedupeFragments: true
Additional context
In the fragment-masking.ts file I found this error:

I'm pretty sure that no one in our team touched this file, so this might have happened on updating the client-preset version.
Which packages are impacted by your issue?
@graphql-codegen/client-preset
Describe the bug
Hi everyone, thank you for this great package!
We have been using codegen for a while now and recently updated the
client-presetfrom 2.0.0 to 4.0.0 - now a lot of TypeScript errors are popping up across our react/next.js application. The errors could be found in every component that used fragments or that passed the fragment information down to a different component. Upon further inspection I was able to figure out thatFragmentTypeis now returningneverlike in the screenshot belowIt's still possible to access the information inside the fragment with

useFragment, but the type is nowunknownYour Example Website or App
private repo
Steps to Reproduce the Bug or Issue
My fragment is similar to this:
FragmentType<typeof UserInfoFragment>neverExpected behavior
Before we updated the

client-preset,FragmentTypedid return the correct type informationScreenshots or Videos
No response
Platform
graphqlversion: 16.6.0@graphql-codegen/*version(s):While trying for a quick fix I also tried re-adding
@graphql-codegen/typescriptand@graphql-codegen/typescript-urqlbut this did not help.Codegen Config File
Additional context
In the

fragment-masking.tsfile I found this error:I'm pretty sure that no one in our team touched this file, so this might have happened on updating the
client-presetversion.