Tag: apollo-client
-
GraphQL filter/order based on result count of relation
0 I am kind of new to GraphQL world and i am stuck at a, i would say, very basic problem. I dug around couple of docs and guides and i could not find any hint if it is even possible or not with GraphQL or what might be a workaround. What i want to…
-
Apollo Client GraphQL error is lost / undefined after second time loading the page (refreshing the browser)
0 I am using Apollo Client in my Astro project. I have the following GraphQL query: const { data, loading, errors } = await client.query({ query: GET_PAGE, variables: { url: uri, }, errorPolicy: ‘all’, }); Also I defined my errorLink, based on the Apollo docs: const errorLink = onError(({ graphQLErrors, networkError }) => { if…
-
@apollo/client local-only field is not resolved when working with service worker
0 I have problems getting local-only fields via typePolicies to work in my app. My setup is the following: This is one of my queries: export const GET_ALL_DEBT_TOKENS = gql` query GetDebtTokens { getDebtTokens { totalSupplyUSD totalReserve totalReserve24hAgo token { address symbol priceUSD @client priceUSD24hAgo } } } `; And this is the config to…
-
useMutation does not work from react front end but works in apollo client with same variables Mutation.js
0 I am trying to executate a mutation called createGroup, when i do it graphQl apolo clients it creates the group in firebase collection successfully but in the react frontend it does not work. When the create button is clicked in the appolo dev tools it shows as mutation started but nothing happens on firebase.…
-
How to update apollo cache
0 I am wondering why it’s very hard to update a data inside of apollo client cache, comparing to similar libraries like react-query it’s too complicated For example, When I have a query with pagination (offset and limit) and get an array of items, When I perform a mutation on one item , and from…
-
loading queries from .graphql files and use them with apollo client and react
0 Hi guys basicalle I’m creating an app using react, graphql and apollo client, currently I,m loading the queries from a .tsx file with this kind of structure const MULTIPLE_WELLS_FROM_TAO2 = gql` query { query_multiple_wells_from_tao2db { selected_well { opru_fld_nme { value } prod_govt_lse_nbr { value } well_cmpl_seq_nbr { value } } } } `; and…
-
How to dynamically define GraphQL query string, given typescript types based on GraphQL schema?
0 I have a Node application where I have generated typescript types from GraphQL schema. My service is going to receive GraphQL Object and attributes details in an API request. The service has to form a GraphQL query string and return in the response. For example, If the request is ‘Object.attribute = value’, then the…
-
Graphql codegen configuration does not load documents with Glob Expression
0 My API is written with TypeScript/Apollo and I am able to run queries/mutations on https://localhost:4000/graphql. My front-end is with Next.js and Apollo client. I use GraphQL Codegenerator to generate the client-side code I need. I am using: "@graphql-codegen/cli": "1.20.1", "@graphql-codegen/typescript": "1.20.2", "@graphql-codegen/typescript-operations": "1.17.14", "@graphql-codegen/typescript-react-apollo": "2.2.1", and my codegen.yml file is overwrite: true schema: "https://localhost:4000/graphql"…