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
Deeper investigation has revealed that this behavior still occurs even without typegen and I've discovered that this is actually an issue with the Apollo cache.
For anyone else who runs into this see this issue:
Which packages are impacted by your issue?
@graphql-codegen/client-preset
Describe the bug
Codegen doesn't spread the fields correctly when:
Example:
Employee
andCustomer
are both subtypes ofBasePerson
The data will not include the
id
andname
fields from the fragmentdata
belonging to the PeopleQuery, will logA minimum reproducible example is provided here:
https://github.com/abir-taheer/minimum-reproducible-graphql-codegen-interface-fail
In that repo, for convenience, codegen will be run after the
yarn
command runs in thepostinstall
scriptrunning
yarn dev
from the mono repo root folder will run the web app and graphql server to demonstrate the query mismatchThe codegen config file is here:
https://github.com/abir-taheer/minimum-reproducible-graphql-codegen-interface-fail/blob/main/apps/graphql/codegen.ts
typedefs: https://github.com/abir-taheer/minimum-reproducible-graphql-codegen-interface-fail/blob/main/apps/graphql/typeDefs.ts
The query is here: https://github.com/abir-taheer/minimum-reproducible-graphql-codegen-interface-fail/blob/main/apps/web/src/App.tsx
Your Example Website or App
https://github.com/abir-taheer/minimum-reproducible-graphql-codegen-interface-fail/tree/main
Steps to Reproduce the Bug or Issue
Most details are mentioned prior
commands to run MRE
Expected behavior
Site should be displaying
But it displays:
Screenshots or Videos
No response
Platform
graphql
version: 16.8.1@graphql-codegen/cli
: "^5.0.0"@graphql-codegen/client-preset
: "^4.1.0"Codegen Config File
Additional context
No response
The text was updated successfully, but these errors were encountered: