Tag: graphql-fragments
-
GraphQL Codegen isn’t generating types from the in-line fragments
-1 I am using Apollo Client 3 and GraphQL Codegen. I have the following query: query Page($path: String!) { page(path: $path) { id content { …on PageOne { id description } …on PageTwo { id title } } } } My codegen config file: // codegen.ts import type { CodegenConfig } from ‘@graphql-codegen/cli’; const config:…
-
Apollo GraphQL client data is undefined when using fragments
0 I’ve a Next.js project using the Apollo GraphQL client 3.7.17, where the following code works for me: const { loading, data, error } = useQuery(gql` query GetTeamCurrentWeek($teamId: ID!) { team(id: $teamId, idType: DATABASE_ID) { teamMeta { currentweek } } } `, { variables: { teamId: 715 } } ); If however I change the…