Questions tagged [react-apollo]

React Apollo allows you to fetch data from your GraphQL server and use it in building complex and reactive UIs using the React framework. React Apollo may be used in any context that React may be used. In the browser, in React Native, or in Node.js when you want to do server-side rendering.

react-apollo tag should be used for questions that are about the usage of the react-apollo ApolloClient container.

It should be included with the apollostack (and related) tags to clarify that this is the client wrapper being used.

It alleviates the need to use the , which should not be used, unless a person who knows nothing about react-apollo is likely to be able to answer the question.

Related tags

2126 questions
0
votes
1 answer

Write WHERE GraphQL queries with Apollo gql

Running this query on my Playground works perfectly: query { users(where:{email_contains: "b"}) { nodes { email firstName } totalCount } } But I am unable to convert it into this format to use in my code…
a125
  • 1,001
  • 2
  • 19
0
votes
1 answer

React Apollo: How to access element Trix-Editor within a Mutation component?

Please, I need help accessing a element in my Mutation component. I'm using React hook useRef() to access this, but getting null. From Chrome Dev Tools (image below) I can see the element has been referred. I have tried some of the…
Bhatiya J
  • 110
  • 8
0
votes
0 answers

Javascript, How to store API response on client side with good effeciency

I am newbie to Javascript/Front end ecosystem. During the last few days I started learning and building Apps using "React". The below is my stack - React - Apollo - Spring Boot (backend) - Not much of significance to this question. In my…
Varad
  • 704
  • 5
  • 19
0
votes
2 answers

React:: Error: GraphQL error: Cannot read property 'headers' of undefined

I deployed my app on netlify. On local server, I could post a comment. But in production mode, "Error: GraphQL error: Cannot read property 'headers' of undefined" appears when I submit my comment. I tried many ways to fix this issue, but I…
Yohei Umezu
  • 381
  • 2
  • 16
0
votes
0 answers

Using NodeJS EventEmitter on Meteor server

I’m implementing an app that makes uses of EventEmitter. My aim is to use it on both client and server. But strangely, emitting an event on the server does not work: Emitter.emit('SomeEvent', { user, document, } ); The above will work on the…
danyhiol
  • 357
  • 4
  • 20
0
votes
2 answers

Would you rather make multiple async queries upfront and pass it on your child components, or split them?

This is more of an open-ended question, but I was wondering what would be the preferred way of approaching this problem: I have a Tabs component, and I was thinking of making multiple async calls in the parent Component, and then passing the…
nyphur
  • 1,281
  • 11
  • 30
0
votes
0 answers

Laravel return response to endpoint from bootstrap/app.php file

I am connecting to database in app.php file. I want to send 404 response if database does not exists or if there is some error. The code is as below. $conn = new mysqli(env('DB_HOST'), env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_DATABASE')); if…
Riddhi
  • 1,836
  • 1
  • 5
  • 15
0
votes
1 answer

How to unsubscribe from an array of subscription

I have an array of subscribeToMore from Apollo query that I want to use. I was inspired by this article, expect I want to use a functional component: useEffect(() => { const unsubscribe = [subscribeToMore({ //…
Kevvv
  • 2,629
  • 19
  • 50
0
votes
1 answer

Does the Apollo `subscribeToMore` variables have to match the initial query?

Does the Apollo subscribeToMore variables have to match the initial query? For example, if my initial query is const { data, loading, error } = useQuery(INBOX) where the variable is from the id verified in the server(not sent from the client) …
Kevvv
  • 2,629
  • 19
  • 50
0
votes
2 answers

Reactjs, Apollo Client issue with storage

I am working on a reactjs site which uses graphql and sailsjs on the server, My issue is that the current structure of the frontend react uses a lot of queries and mutations to run a wizard like process where a user fills out a survey. On the client…
Hammad Khalid
  • 436
  • 1
  • 6
  • 19
0
votes
1 answer

Get value from Apollo Store

I want to access a value saved in Apollo Store. //apollo.js import ApolloClient from 'apollo-boost'; import gql from 'graphql-tag'; export const client = new ApolloClient({ uri: 'https://localhost:8000/graphql/', clientState: { defaults: { …
0
votes
0 answers

why doesn't useQuery 'skip' option accept my boolean?

What i'm trying to do: skip the query if the parameter in the query doesn't change. I understand that useQuery is smart enough to not run if the input parameter doesn't change. However, if I have useQuery in componentA, and i switch from it to…
Julliard
  • 343
  • 3
  • 18
0
votes
1 answer

getInitialProps in never called in NextJS

I have problem with getInitialProps method in NextJS. It is never called. This is project where I have Apollo GraphQL client for some pages and getInitialProps for other. I am not sure how to configure them correctly to work. Apollo is working fine…
Mileta Dulovic
  • 706
  • 8
  • 24
0
votes
1 answer

How to set up apollo client:check in react?

Does anybody has implemented Apollo client:check? Does anybody has a good example?
Pep
  • 67
  • 1
  • 7
0
votes
0 answers

How to pass API key from Apollo Client to Apollo Server

I inherited a backend that needs API access for clients. It's built on Node/Express with Apollo Server. The frontend is React using Apollo Client. I've implemented graphql-shield as a permissions layer on the server, but I haven't been able to…
displacedtexan
  • 817
  • 6
  • 15
1 2 3
99
100