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
0 answers

GraphQL Type relationship / Mongoose Schema / populate()

Having an issue with returning territories related to their Company when running query for retrieving all Companies. When a company is created, a territory is not set. Territories are created separately. The connections/relations are…
John
  • 95
  • 3
  • 12
2
votes
3 answers

How to partially mock a schema in GraphQL and Apollo?

I'm trying to mock only a small portion of the Contact type below. My resolvers return data from a REST endpoint for all fields in Contact except for test. For demo purposes, I want to be able to retain the server data for all other fields, but…
Tom Nolan
  • 1,916
  • 4
  • 32
  • 51
2
votes
0 answers

How to run an async function and set headers per each request in Apollo?

Let's say I want to get the firebase auth token and set it to each and every request. To fetch the firebase auth token I need to send an async call to the firebase server. Only when it completes I get the token. I tried to set it as shown below. But…
THpubs
  • 7,804
  • 16
  • 68
  • 143
2
votes
1 answer

Kotlin/native support for any Kotlin library ?

Does Kotlin/native support any library written in Kotlin, for sharing common code with an iOS project ? Specifically is there a way to use the apollo-android library in a shared kotlin/native project?
Patric
  • 342
  • 4
  • 19
2
votes
1 answer

How to generate TypeScript definitions for graphql

I have a react app based on create react app and TypeScript. I want to replace redux with Apollo graphql client. I define queries in .graphql files and/or gql-Tag using string templates. I want the result/data from apollo’s Query component to be…
Thomas
  • 355
  • 1
  • 4
  • 17
2
votes
0 answers

Apollo react: combining rest and graphql with link-state

I am trying to use REST endpoints to post data and GraphQL for query and fetch along with apollo-link-state. My rest endpoint is getting hit and application is getting created. But when I try to run the query to write to cache it's not hitting the…
rak1n
  • 671
  • 1
  • 8
  • 17
2
votes
0 answers

Race queries in react with apollo

I'm using react-apollo with the graphql HOC: I have a search by user input query that can run for a variable amount of time and is invoked by key strokes, the result of this query is passed on to the UI component to show the search result. (0:00)…
Pavel Tarno
  • 1,324
  • 1
  • 12
  • 29
2
votes
3 answers

Apollo boost - __typename in query prevent new mutation

I have a problem in my meteor/react/apollo (with boost) project. When I query data from the server, it adds __typename to every object and subobject in my query but it my case it creates a major issue as I normally reuse these data to send them to…
Ivo
  • 2,308
  • 1
  • 13
  • 28
2
votes
1 answer

How to set the Apollo GraphQL server to accept an object as a variable to a mutation?

Currently, I'm trying to pass an object as a variable to a mutation as shown below: type ShopLocation { lane1: String lane2: String city: String postalCode: String country: String } type ShopResponse { statusCode: Int messageCode:…
THpubs
  • 7,804
  • 16
  • 68
  • 143
2
votes
0 answers

How can I make this as optimisticResponse?

I have a "like" button/mutation. There is still a split second while I get a response from the server. How can I make this as an optimisticResponse? Here's my mutation: const LIKE_MUTATION = gql` mutation LIKE_MUTATION($postId: ID!) { …
karolis2017
  • 2,195
  • 8
  • 24
  • 49
2
votes
2 answers

Apollo Client: Network Error {"type":"WriteError"}

I am getting Network Error {"type":"WriteError"} on my apollo query. Query executes just fine as well as it arrives to the client. But there is issue writing it tot he store. Any ides what can be going wrong? This is the query: fragment…
tomitrescak
  • 1,072
  • 12
  • 22
2
votes
2 answers

in the apollo-client how I may be able to log or intercept all the operations (queries and mutations)

For analytic purposes I'd like to keep track on the client side of all the graphql operations (including ie @client ones). I was unable to find appropriate options in the API and wonder if this may be doable on the apollo-client level or may I need…
ciekawy
  • 2,238
  • 22
  • 35
2
votes
3 answers

React/Apollo - Similar Queries in different Component?

I am looking for help regarding best practice using Apollo, React and Meteor. I linked the Meteor.user() model to a Schema in Apollo and I can now access it thanks to a Query Component. I have a query that looks like this : gql` query User { …
Ivo
  • 2,308
  • 1
  • 13
  • 28
2
votes
2 answers

GraphQL refetchQueries after mutation, this.props not updated

This problem makes no sense to me at all... I am adding an author to a database using a mutation like this: this.props .addAuthorMutation({ variables: { name: this.state.name, age: this.state.age }, …
2
votes
1 answer

How do you make Schema Stitching in Apollo Server faster?

Initially, I tried to use a Serverless Lambda function to handle schema stitching for my APIs, but I started to move toward an Elastic Beanstalk server to keep from needing to fetch the initial schema on each request. Even so, the request to my…
Tyson Cadenhead
  • 352
  • 3
  • 8