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
2
votes
2 answers

ApolloClient is not a constructor react-apollo

I am following this tutorial and trying to implement graphQl. There is an issue with the following line: const client = new ApolloClient(); Strangely I cannot find anything in the react-apollo GitHub page for this. Is there something stupid that I…
peter flanagan
  • 9,195
  • 26
  • 73
  • 127
2
votes
1 answer

Inject data from cache to component

I am working on a react and apollo project and I have following situation. @graphql(TodosQuery) class Table extends Component { render(){ return (
{this.props.data.todos.map(...)}
) } } const TodosQuery…
magnat
  • 407
  • 4
  • 18
2
votes
0 answers

Building a comparison view with Apollo GraphQL

Scenario I have a GraphQL endpoint with the following schema, that allows me to get weather statistics for a given city: type Weather { name: String times: [Float] temp: [Float] hum: [Float] } type Query { weather(city: String):…
Targos
  • 124
  • 5
2
votes
0 answers

Errors caught show up in console

My project has 2 tests: "Foods can be fetched when authenticated" "can not be fetched when not authenticated" The problem lies in the second test. It expects an error which is intercepted by a try / catch statemet. Therefore I don't expect the…
DowinskiField
  • 133
  • 2
  • 15
2
votes
1 answer

How to import generated class from Apollo Client (GraphQL) in Android Studio

I'm new to Android studio and want to write a small example app with GraphQL and the Apollo Client. I've successfully setup my build environment and the automated code generation. Here's a screenshot of the file structure,…
nburk
  • 22,409
  • 18
  • 87
  • 132
2
votes
2 answers

GraphQL: Error: Must provide Document

UPDATE: apollo has updated code and docs so issue is irrelevant now Intended outcome start apollo-server-express using the following snippet from https://github.com/apollographql/apollo-tutorial-kit. import express from 'express'; import {…
martin8768
  • 565
  • 5
  • 20
2
votes
2 answers

How to wrap a remote schema in another query field?

Apollo graphql-tools now have Schema Stitching, which is great. I want to merge multiple endpoints to generate a schema similar to GraphQL Hub, like this: query { github: { ... } # GitHub Schema twitter: { ... } # Twitter Schema …
Bruno Lemos
  • 8,847
  • 5
  • 40
  • 51
2
votes
1 answer

Apollo GraphQL iOS

I add this run script on my swift3 project APOLLO_FRAMEWORK_PATH="$(eval find $FRAMEWORK_SEARCH_PATHS -name "Apollo.framework" -maxdepth 1)" if [ -z "$APOLLO_FRAMEWORK_PATH" ]; then echo "error: Couldn't find Apollo.framework in…
Luigi Marino
  • 139
  • 6
2
votes
1 answer

How to redirect after a deleting mutation in Apollo?

After I delete a post, I want to update the cache and redirect to the post index page. deletePost() { this.$apollo.mutate({ mutation: DELETE_POST, variables: { postId: this.postId }, update: (cache, { data: { deletePost } })…
nachocab
  • 13,328
  • 21
  • 91
  • 149
2
votes
1 answer

Can an Apollo Mutation return a custom result object?

The result returned from an Apollo mutation is typically a type or a subset of fields from a type, and this is usually great. So my mutation: const addUserMutation = gql` mutation createUser($email: String!, $permissions: [CreatePermissionInput])…
Oliver Lloyd
  • 4,936
  • 7
  • 33
  • 55
2
votes
1 answer

Apollo resetStore is not working in Angular client

I am trying to integrate authorization token at the client side. I am passing this token in middleware. When user logout reset the store and then get a new token. Now when I send new request it is still sending the old token(cached) Here is my code…
Dk Kumar
  • 103
  • 1
  • 11
2
votes
0 answers

Is there any way to mock @defer with react-apollo?

For example, if I want to get a list of planets and the orbital length of them I can do this: query Planets { planets { id name orbitalLength } } But let's say it takes a long time to calculate the orbital length and it sometimes…
2
votes
2 answers

Expected 0 arguments, but got 1. Using typescript and compose from react-apollo

I'm using typescript and react-apollo my code is the following: If I remove the last (Index) the error will go away but I have no idea on how then export the container/component. Basically, the code works but typescript is not happy with this.
Johhan Santana
  • 2,336
  • 5
  • 33
  • 61
2
votes
3 answers

Apollo client: mutate is not a function

I am calling this component from a parent component that is passing props thru the argument fields. However When I try to call the mutation function I keep getting the error: mutate is not a function. I dont understand what is causing this issue as…
john
  • 1,057
  • 1
  • 17
  • 28
2
votes
1 answer

How to force Apollo Client to use cached data

We have an application that initially load a list of widgets: query Widgets() { widgets() { ...Widgets } } fragment Widgets on Widgets { name description rootWidget widgets { ...WidgetInterface …
Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297