Tag: apollo-client
-
Apollo client modify.cache after receiving data from the subscription sometimes the cache does not update with new data
0 I am updating the real-time status of the product data with a subscription. Here is my code useProductSubscription({ varibales: { ids: productIds }, onData: ({ data }) => { const dataUpdated = data.productUpdated; if (!dataUpdated) return; const { productId, status } = dataUpdated; cache.modify({ id: cache.indentify({ __typename: ‘Product’, id: productId, }), fields: { status:…
-
Apollo extension config module.export = {} with Vite React
0 I created a react App with Vite, and I want to use Apollo extension to get Intellisense when building GraphQL queries. According to the extension docs, I created an apollo.config.js file at the root with this code : module.exports = { client: { service: { name: "my-graphql-app", url: "https://localhost:4000/graphql", }, }, }; But since…
-
Can I use nested properties as variables while using useQuery from Apollo and GraphQL?
0 I created a MERN application using Graphql, and I’m trying to fetch using properties that are nested inside my data as variables. As an example, I have client and project models. Is it possible to fetch all the projects for a specific client by passing the client ID when fetching the projects with useQuery.…
-
GraphQL throws error of non-nullable field on a nullable field
0 I’ve the following schema type Employee { id: UUID! createdAt: Time! updatedAt: Time! lastActivity: Activity } type Activity { id: UUID! createdAt: Time! updatedAt: Time! } extend type Query { Myself: Employee! } The lastActivity may or may not be present of course, but when querying it from my client it throws the following…
-
Enum values casting not retained in Apollo graphQL java code generation
0 I have defined following enum type in my graphql schema enum TimeUnit { Day Week Month Year } I am using apollo graphql client and generating models which create a java enum like: public enum TimeUnit { DAY("Day"), WEEK("Week"), MONTH("Month"), YEAR("Year"), /** * Auto generated constant for unknown enum values */ $UNKNOWN("$UNKNOWN"); private final…
-
Typescript and Graphql Fragments
0 I use codegen to generate TS types and I use Apollo client to send queries to server. when I generate code for the following example, Typescript dosen’t know that people has firstName and lastName fields, It only knows that avatar field exists. If I remove fragment and move fields directly to query all fields…
-
“Mime type of document could not be determined” Error on Apollo Server
0 I was given a link for a graphQL server with already built in queries and mutations. When I tried to run a mutation, I got the following response: { "data": {}, "errors": [ { "message": "Mime type of document could not be determined" } ] } What could be the problem and how can…
-
How to create Ember Service that fetches data from Apollo GraphQL Server
0 I successfully fetched data from Apollo GraphQL Server in Amber route using ember-apollo-client. I tried the same approach to have a service fetching data but I’m getting Uncaught TypeError: this.apollo.query is not a function from app/services/nav-categories.js. Minimal Working Example Start a new app using $ ember new super-rentals –lang en $ ember generate service…