Tag: #reactjs
-
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…
-
GraphQL validation error
0 I am trying out relay-treasure hunt tutorial but getting the following error when I run npm start. I did update my schema by running npm run update-schema. Uncaught Error: GraphQL validation error “Cannot query field “game” on type “Query”.“ in file `/home/tharaka/My Projects/relay-treasurehunt/js/routes/AppHomeRoute.js`. Try updating your GraphQL schema if an argument/field/type was recently added.…
-
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.…
-
Getting ‘Module not found ‘ error when running nodemon
0 I want to run my index.js file to access graphql endpoints so i can be able to query the data, access it but i keep getting the ‘ module not found’ error code. import React from ‘react’; import ReactDOM from ‘react-dom’; import ‘./index.css’; import App from ‘./App.jsx’; import ‘bootstrap/dist/css/bootstrap.css’; import { ApolloClient, InMemoryCache, ApolloProvider…
-
Getting ‘Module not found ‘ error when running nodeman
0 I want to run my index.js file to access graphql endpoints so i can be able to query the data, access it but i keep getting the ‘ module not found’ error code. import React from ‘react’; import ReactDOM from ‘react-dom’; import ‘./index.css’; import App from ‘./App.jsx’; import ‘bootstrap/dist/css/bootstrap.css’; import { ApolloClient, InMemoryCache, ApolloProvider…
-
GraphQL uses REST query which has an array as JSON response does not work
0 I’m trying to query another system with a GraphQL query. Due to the system only takes REST queries I use the @rest operator to convert the query. But the REST query has an array as response which leads to the following error: {"name":"ApolloError","graphQLErrors":[],"clientErrors":[],"networkError":{},"message":"typename is undefined"} GraphQL query: const QueueStatusQuery = gql` query checkQueueStatus_HLS{ robot(input:{})…