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

Dispatch redux action after Apollo Query component returns result

Using the old way: graphql(GET_PROJECTS_BY_USER_ID, { options: ownProps => ({ skip: !ownProps.loggedUser.id, }), props: ({ data }) => { return data; }, }); I could catch the list of projects inside…
Norbert
  • 2,741
  • 8
  • 56
  • 111
2
votes
1 answer

Apollo Empty context

I'm trying to get the context, in my server side, unfortunately i always get an empty context client-side (angular): this.apollo.query({ query: gql`{ message }`, context: { test: 'test' } }).subscribe(console.log) server side: message: { …
Taieb
  • 920
  • 3
  • 16
  • 37
2
votes
0 answers

Where to load data from a server with React

I have a main component that contains 2 sub-components. A d3 graph component and a form component to edit the graph. The data is loaded from a server in componentWillMount in the graph component. All resources show that data should be loaded in the…
Vialito
  • 523
  • 7
  • 28
2
votes
1 answer

GraphQL Expected Iterable, but did not find one for field while using find

Currently I am using Apollo/GraphQL/Node.js/Sequelize to build my backend server, and my server code looked like below, in there I can use req.user to get the current login user app.use( '/graphql', bodyParser.json(), graphqlExpress(req => ({ …
starsneverfall
  • 137
  • 1
  • 2
  • 15
2
votes
1 answer

AWS AppSync User relations for FriendsList

I have a problem with AWS AppSync and ApolloClient. How can I use an association between users in the Amazon Service named AppSync, that is, a connection as node and edge. What I want to do is when I follow the users, I would like to see the flow of…
2
votes
1 answer

Seem like it ignore update mutation in apollo graphql?

I have an Apollo Graphql Client project. I try to use mutation with query. but it seems like it ignore update mutation, for viewing works fine. Please help to clarify the problem. I have tried a lot on changing the way to code. Swap the mutation and…
sirisakc
  • 892
  • 2
  • 15
  • 30
2
votes
1 answer

Apollo-client's cacheRedirect vs dataIdFromObject

I'm trying to prevent re-fetch of previously cached data. But the documentation provides a couple of ways of achieving this through cacheRedirects and dataIdFromObject. I'm trying to understand when one technique is used over the other. He's an…
tgk
  • 3,857
  • 2
  • 27
  • 42
2
votes
1 answer

Is there a way to send data to server using 'unload\navigator.sendBeacon' + 'GraphQL'?

On tab\browser close I need to send data to server. I found this answer (based on this blog) which recommends to use sendBeacon. Here is shown how the data must be prepared in order to send them to server via Ajax. I repeated the structure from the…
TitanFighter
  • 4,582
  • 3
  • 45
  • 73
2
votes
1 answer

Catching and handling errors with Apollo Client

I'm trying to handle errors with Apollo in react gracefully. So the idea is whenever the user encounters an error of some sort (500 or anything else). I want to just show a message like 'something went wrong, please try again later'. Upon the first…
Thom Hos
  • 33
  • 1
  • 5
2
votes
1 answer

How to update apollo cache after mutation (query with filter)

I am pretty new to GraphQL. I am using graph.cool in a Vue.js project with apollo. I am using right now the in-memory cache. I had previously a simple 'allPosts' query. And after creating a new one, I used the update() hook and readQuery() +…
Jakub Juszczak
  • 7,126
  • 3
  • 21
  • 38
2
votes
1 answer

Retrieve data from Apollo store

I've created a LoginMutation which return a token and a user (with his id and firstName). Here is the mutation schema : const LOGIN_MUTATION = gql` mutation loginMutation($email: String!, $password: String!) { loginUser(email: $email,…
Putxe
  • 1,054
  • 1
  • 16
  • 23
2
votes
1 answer

Why parameter query is null in GraphQL Controller when I pass graphql query from Angular?

I'm trying to use GraphQL, I built everything correctly, but when I call graph controller from Angular application parameter 'query' in method is null, but when I call from Postman, everything works well. In addition I use Apollo to connect…
Avtandil Kavrelishvili
  • 1,651
  • 3
  • 27
  • 37
2
votes
2 answers

GraphQL (Apollo) how to pass datastructure in parameter?

I'd like to make a query with lot of input parameter: apollo_client.mutate({mutation: gql `mutation mutation($title: String!, $caption: String!, $id: Int!){ mutatePmaHome(pmaData: {id:$id, title: $title, caption: $caption}) { pma{ …
Mr Bonjour
  • 3,330
  • 2
  • 23
  • 46
2
votes
1 answer

GraphQL + Apollo Error: Uncaught (in promise)

I'm trying to submit new data to my local graphQL API via button click but I'm getting an error: ERROR Error: Uncaught (in promise): Error: Network error: Http failure response for http://localhost:4000/graphql: 400 Bad Request. the idea is that…
Jeremy
  • 270
  • 5
  • 19
2
votes
1 answer

Apollo 2.0 Client apollo-link-state Cache isAuthenticated

Apollo 2.0 allows user to manage the application global state via apollo-link-state by using the browser's cache. I know it is a common pattern in Redux to have a variable isAuthenticated in the global store to restrict access (and to my…
William
  • 600
  • 5
  • 14