Questions tagged [apollo]

Apollo is a GraphQL client and cache for JavaScript, iOS (Swift) and Android.

Apollo is a flexible, fully-featured client for every platform.

Apollo is made up of a family of technologies you can incrementally add to your stack: Apollo Client to connect data to your UI, Apollo Engine for infrastructure and tooling, and Apollo Server to translate your REST API and backends into a GraphQL schema.

It has implementations for JavaScript, iOS and Android. The JavaScript client has integrations for React, Angular, Vue.js, Ember.js and more.

Apollo is fully compatible with any server that implements the GraphQL specification.

4536 questions
9
votes
2 answers

How to chain together Mutations in apollo client

I have a bunch of information stored in my state that I need to pass to my graphQL server using mutations, but I need to use the results of each mutation before I call the next one since I need to: Create a new object in my database Use the id…
Caleb Nelson
  • 103
  • 1
  • 5
9
votes
1 answer

Apollo response from mutation is undefined

I use Apollo-client 2.3.5 to to add some data and then update the local cache. The mutation works but the return from the mutation is undefined in the Apollo client, but the response in the network request is correct. So I have two querys, one for…
Peter Savnik
  • 763
  • 1
  • 8
  • 27
9
votes
2 answers

Apollo GraphQL client: how to distinguish an optimistic response from a real response into a watchQuery

The question is about the interaction of a mutation, optimistic response, and a watchQuery. I have a mutation "myMutation" which has an "optimisticResponse" and an implemented "update" function. Every time I do a mutation query the "update" function…
Dolios
  • 173
  • 1
  • 6
9
votes
1 answer

read data from cache graphql apollo 2.0

I am using apollo 2.0. I first make authUser graphql call to server for given username and password, which generate jwt token and return back token in response. I do see that on successful login, User is stored in cache as id key value. I do have…
joy
  • 3,669
  • 7
  • 38
  • 73
9
votes
2 answers

Apollo-client self signed certificate

is there a way that ApolloClient accepts request from servers with self signed certificates? import ApolloClient from 'apollo-boost'; const client = new ApolloClient({ uri: `https://${window.location.hostname}:8080/graphql`, …
Marcel Rösler
  • 181
  • 3
  • 14
9
votes
2 answers

Using subscription and update after mutation creates duplicate node - with Apollo Client

Im using update after a mutation to update the store when a new comment is created. I also have a subscription for comments on this page. Either one of these methods works as expected by itself. However when I have both, then the user who created…
Evanss
  • 23,390
  • 94
  • 282
  • 505
9
votes
1 answer

apollo (graphQL) - how to send array of object in queries

I would like to send an array of object in a graphQL queries. But I don't have any idea how to type the pointer in the query $gallery: where Type will be a simple datastructure like a class or dictionnary. apollo_client.mutate({mutation: gql` …
Mr Bonjour
  • 3,330
  • 2
  • 23
  • 46
9
votes
0 answers

Apollo refetch not rerendering component

I'm fetching data from a web service using graphql my client code is this import React, { Component } from 'react'; import { Platform, StyleSheet, Text, ActivityIndicator, View, FlatList, TouchableHighlight, …
Irvin Chan
  • 2,587
  • 2
  • 15
  • 20
9
votes
1 answer

Tracking online user with GraphQL Apollo

I need to handle events "user is now online" and "user is now offline" on GraphQL Apollo Node.js server. What's the best way to do it? My investigation: I pretty sure that I don't need to implement any heartbeat logic, because subscriptions are…
Andrew Gura
  • 382
  • 2
  • 11
9
votes
1 answer

Angular Universal TransferState not loading on Client

I'm trying to get TransferState working in my Angular Universal v5 app. After a lot of debugging, I've realized that, on the server, TransferState seems to be working as the response includes a tag which contains the…
John
  • 9,249
  • 5
  • 44
  • 76
9
votes
1 answer

Apollo client 2 with React couldn't make query

I have an issue with Apollo client version 2 with React. (https://www.apollographql.com/docs/react/) When I setup Apollo client according to docs, I can't make query on GraphQl server, it raises error: Uncaught (in promise) TypeError: _super.call is…
M. Saykov
  • 91
  • 2
9
votes
2 answers

React-Apollo, don't run query on component load

I'm using the awesome https://github.com/apollographql/react-apollo library and I'm trying to see if there is a better convention to load data into components than how I'm doing it now. I've set up my components to with the apollo HOC to load data…
Justin
  • 2,940
  • 3
  • 25
  • 43
9
votes
2 answers

Add an array of Objects to a mutation in apollo-react

I am using react-apollo on the front-end and graphcool on the backend. I have a mutation that creates a tutorial like so: const CREATE_TUTORIAL_MUTATION = gql` mutation CreateTutorialMutation( $author: String $link: String $title:…
Josh Pittman
  • 7,024
  • 7
  • 38
  • 66
9
votes
3 answers

Apollo client mutation error handling

I'm using GraphQL and mongoose on the server. When a validation error occurs the GraphQL mutation sends a response with status code 200. On the client side the response looks like this: { "data": null, "errors": [{ "message": "error for…
Locco0_0
  • 3,420
  • 5
  • 30
  • 42
9
votes
1 answer

How do you pass a list or array of objects into a GraphQL mutation designed to update a single object?

I'm using Scaphold.io to build out the back end of a little app I'm working on, and have run into a problem trying to update a number of items in a single mutation request. In Scaphold, when you create a new Type, mutations are created for common…
Jonathan Heron
  • 191
  • 1
  • 5