/minimum-reproducible-graphql-codegen-interface-fail

trying to create a reproducible example of a bug in graphql-codegen library

Primary LanguageTypeScript

Codegen doesn't spread the fields correctly when:

  • The fragment belongs to an interface
  • The spread is happening in a subtype of the interface

Example:

fragment BasePersonFragment on BasePerson {
    id
    name
}

query PeopleQuery {
    people {
        ... on Employee {
            ...BasePersonFragment
        }
    }
}

The data will not include the id and name fields from the fragment