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
13
votes
1 answer

How do I create a GraphQL subscription with Apollo Client in Vanilla JS

Recently Apollo Client released a websocket subscription feature, but so far I've only seen it used by launching a query using subscribeToMore inside the componentWillMount lifecycle hook. Here is an example taken from…
xabitrigo
  • 1,341
  • 11
  • 24
12
votes
1 answer

Difference between ApacheActiveMQ and ApacheActiveMQApollo

What's the difference between Apache ActiveMQ and Apache ActiveMQ Apollo? Apollo documents says:"ActiveMQ Apollo is a faster, more reliable, easier to maintain messaging broker built from the foundations of the original ActiveMQ. It accomplishes…
Sam
  • 6,770
  • 7
  • 50
  • 91
12
votes
1 answer

Does useQuery run on server-side rendering?

I'm new to Next.js and have some questions about client-side rendering and server-side rendering in Next.js I see there are two ways to fetch data on Next.js. One of them is to use the useQuery hook but that is only callable on the React component…
Tu Le Thanh
  • 542
  • 1
  • 6
  • 18
12
votes
4 answers

Apollo Client client.readQuery returning null when data is in the cache

This must be user error, but I've got an app with a simple currentUser query that looks at a JWT for an id, looks it up, and returns the appropriate user. I can look at devtools and see that it's in the cache as __ref:User:19 export const…
CrustyRatFink
  • 464
  • 1
  • 5
  • 15
12
votes
2 answers

How to catch server errors in Nuxt.js so it doesn't crash page render? (Vue)

Context This question is related to my other question, How to handle apollo client errors crashing page render in Nuxt? , but I'll try to keep this isolated since I'd like this question focused only on Nuxt (minus apollo). However, I decided to ask…
sgarcia.dev
  • 5,671
  • 14
  • 46
  • 80
12
votes
1 answer

Testing useSubscription apollo hooks with react

Testing the useSubscription hook I'm finding a bit difficult, since the method is omitted/not documented on the Apollo docs (at time of writing). Presumably, it should be mocked using the from @apollo/react-testing, much like the…
12
votes
10 answers

compose not exported from react-apollo

I'm following a graphql tutorial on youtube (https://www.youtube.com/watch?v=ed8SzALpx1Q at about 3hr 16min) and part of it uses compose from "react-apollo". However, I'm getting an error because the new version of react-apollo does not export this.…
rollerpigeon
  • 209
  • 2
  • 5
  • 14
12
votes
2 answers

Unexpected end of JSON on GraphQL query with React while no issue with GraphiQL

I am trying to do a very basic query via React with Apollo. When I do this query in GraphiQL I nicely get my results back but in my app I get an undefined data object. And a error with a message: Network error: Unexpected end of JSON input The…
Kay Int Veen
  • 577
  • 1
  • 5
  • 17
12
votes
4 answers

How to call a GraphQL query/mutation from an Express server backend?

My frontend is localhost:3000, and my GraphQL server is localhost:3333. I've used react-apollo to query/mutate in JSX land, but haven't made a query/mutation from Express yet. I'd like to make the query/mutation here in my…
Chance Smith
  • 1,211
  • 1
  • 15
  • 32
12
votes
3 answers

Missing selection set for object GraphQL+Apollo error

I have a set of mutations that trigger the local state of certain types of popups. They're generally set up like this: openDialog: (_, variables, { cache }) => { const data = { popups: { ...popups, dialog: { id:…
Cassidy
  • 3,328
  • 5
  • 39
  • 76
12
votes
2 answers

How to use Apollo Client with AppSync?

AppSync uses MQTT over WebSockets for its subscription, yet Apollo uses WebSockets. Neither Subscription component or subscribeForMore in Query component works for me when using apollo with AppSync. One AppSync feature that generated a lot of buzz…
C.Lee
  • 10,451
  • 9
  • 31
  • 46
12
votes
1 answer

Queries overwriting with missing fields in the Apollo cache

I have a situation where I sometimes want to query a list of many objects with a few fields, and sometimes only one object with many fields. As an example, consider these two queries: A query with a many objects and few fields: query { …
jorgen
  • 3,425
  • 4
  • 31
  • 53
12
votes
1 answer

Apollo offline first support: Service Worker or Persisted Cache?

I have a react app that use apollo as a grapql client. The app now need offline support for a subset/subapp. There is a service worker (thanks to workbox and webpack) that do the pre-caching of the assets of the app and works good. Now there is a…
12
votes
3 answers

Apollo InMemoryCache Performance Strategies for Large Data Set (React)

The initial data set received from an Apollo Client GraphqQL query for an application I am trying to tune is currently very large. In "large" I mean that it seems that the data normalizes to about 7,000 entries under the "data" key in the cache. The…
Briggs
  • 639
  • 5
  • 13
12
votes
2 answers

Angular Apollo Error Handling

Hi everyone I am a bit stuck on a problem with apollo-angular and apollo-link-error. I've tried a few different ways and I can't seem to catch any errors client-side in my angular web app. I posted my attempts below. Any suggestions or an extra set…
Galactic Ranger
  • 851
  • 3
  • 14
  • 30