All Questions
Tagged with react-apollo node.js
45 questions
1
vote
1
answer
57
views
Apollo client cache returns a bad data
First, I call useGetData with parameters that include filters for test1 and test2 (this is correct). The data is fetched and stored in the cache. Then, I disable the test2 filter and make a new ...
0
votes
1
answer
202
views
GraphQL query giving error, but it still updates my database
I'm making a project in React, using apollo-server-express, graphQL and postgreSQL, I've done the type definitions and some queries and mutations, but there is 3 in specific that isn't working ...
1
vote
0
answers
128
views
CORS issue while enable under attack mode in cloudfare
We facing the "CORS" Issue while enable Under Attack Mode, We are working on the dynamic Marketplace project using NodeJs (graphql,apollo-server) and ReactJs (graphql,apollo-client),we have ...
1
vote
0
answers
166
views
How to give specific id and using apollo client
It is work for backend.
Backend
type Query {
allUsers: [User!]!
allPosts: [Post!]!
singleDetail(id:Int): Post!
}
resolver
singleDetail: async(_parent:any, args: { id: number }) => {
...
1
vote
0
answers
379
views
When Installing , react-apollo stuck at node-gyp and after some time it's giving node-pre-gyp error, WINDOWS
I'm trying to install react-apollo in my react project. While installing it's stuck at node-gyp and after some it's giving a long error and eventually, the installation fails every time.
I tried a ...
0
votes
1
answer
1k
views
React Apollo - how to refetch (update) data after nodejs graphql backend returned async response
The situation is simple.
I have NodeJS GraphQL backend with users data. When new user is added I can refetch this updated users data with React Apollo without a problem. But then I added async ...
0
votes
0
answers
41
views
Graphiql gives correct output from Node.js backend but React Apollo client (with same query) gives the wrong output
The gist of my question is in the title.
So I made simple GraphQL backend with Node.js. When I check it with GraphiQL it works fine. But the same query I use with GraphQL does not work when I fetch it ...
1
vote
1
answer
256
views
Apollo Mutation on React Hooks
Hi everyone,
I started work on graphql and apollo,i can claim but just get request, i couldnt for mutation.My handleChange function is working i can take values. But i couldnt post request.My question ...
1
vote
1
answer
7k
views
Issue with useMutation with await and promise
I am performing the useMutation operation in the innermost loop and want to check the remaining cost upon every mutation. But it gets checked after all the mutations which is a problem because for ...
0
votes
0
answers
1k
views
How do I solve CORS issues in Apollo, Node, and Next.js?
I need help troubleshooting I CORS error I am having in Apollo, Node, and Next.js. I am not sure what change I have made, but suddenly I am unable to fetch the data from my Prisma database. I am ...
0
votes
0
answers
246
views
Apollo-react SSR not return data, but return loading: true
Good day. I have problems with the server rendering of the application, in conjunction with the Apollo-React. The request goes to the server, but the layout only returns a stub for loading: true. How ...
1
vote
2
answers
1k
views
How to pass application credentials through apollo client like we do with axios auth options
I wanted to know how to pass application credentials (or even user credentials through code) to apollo client like we do in axios.
In axios -
const data = await axios({
method: "POST",
url: `${...
1
vote
1
answer
5k
views
Sorting in GraphQL by ID
I downloaded one simple tutorial code.
But as I am playing with it I couldn't figure out how can I sort for example by id in graphql.
This is query.js
import React from "react";
import { useQuery } ...
1
vote
1
answer
832
views
Running GraphQL mutation (Apollo) server side via node js script
I am running a scraping script (Puppeteer), and would like to write each scraped row to the database.
I'm currently getting this error:
Error: Invalid hook call. Hooks can only be called inside of ...
3
votes
1
answer
3k
views
Object as input variable in mutation: GraphQL - Apollo - React
I have a React client-side project and a Node.js/GraphQL api in two separate repo's.
In my React app, I want to pass an object as variable type into my mutation. Here's how my mutation looks like:
...