Tag: apollo-client
-
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…
-
Apollo client: mutate is not a function
2 I am calling this component from a parent component that is passing props thru the argument fields. However When I try to call the mutation function I keep getting the error: mutate is not a function. I dont understand what is causing this issue as I followed the apollo documentation online almost exactly. const…
-
Graphql multiple queries returns wrong data
0 I have a single grapqhl query that has multiple queries. The data returned is not correct as some of the data is mixed up. If I run the same query on graphql studio I get the desired data, however the data is wrong on the browser. query GetCarFilters { getCarModelsWithCount { …CarFilterFields } getCarMakesWithCarsCount…
-
can i use page items in cursor base pagination?
-1 can i use page items in cursor base pagination? for example it’s possible to directly address a specific page. For instance, if the requirement is to jump directly to page five, it’s possible to do so since the pages themselves are not explicitly numbered. reactjs graphql apollo-client Share Improve this question Follow asked 39…
-
graphql codegen defaults to watchQuery, no possible way to alter? I only want to get the value 1 time
1 I have a sveltekit + apollo graphql project here. introspecting from my dev-env api here. The issue I’m having is the codegen with this config: import type { CodegenConfig } from ‘@graphql-codegen/cli’; const config: CodegenConfig = { schema: ‘<<<url>>>’, documents: ‘./src/lib/graphql-service/**/*.gql’, generates: { ‘./src/lib/graphql-service/generated.ts’: { plugins: [‘typescript’, ‘typescript-operations’, ‘graphql-codegen-svelte-apollo’] } }, watch: false };…
-
Refetch queries server side after a client side mutation apollo client
0 I’m using the experimental version of graphql and apollo client together with next13 and at one point in my code I perform a mutation in a client side component to delete data and I need the query that was performed in a server side component to be re-done for the list of results to…