Attaching fragments to utils and components is quite a common composition pattern. In some cases, grouping fragments in a map could also be useful. It seems when a fragment is defined as an object field, an "Unknown fragment" error is raised.
// When the fragment is defined as an object field, we get the following error:
// Unknown fragment "CountryEmoji".
const brokenQuery = graphql(
`
query getCountry($code: ID!) {
country(code: $code) {
...CountryEmoji
}
}
`,
[getCountryEmoji.fragment],
);
Describe the bug
Attaching fragments to utils and components is quite a common composition pattern. In some cases, grouping fragments in a map could also be useful. It seems when a fragment is defined as an object field, an "Unknown fragment" error is raised.
Example
The issue can be reproduced in this codesandbox
gql.tada version
@0no-co/graphqlsp: ^1.9.1 gql.tada: ^1.4.3
Validations