Questions tagged [apollostack]

The Apollo GraphQL platform is an implementation of GraphQL that helps you manage data from the cloud to your UI.

Read more about the entire stack here: Apollo Platform

106 questions
6
votes
4 answers

Setting Up Apollo Server with subscriptions-transport-ws?

It seems like I have my server set up according to the Apollo docs at http://dev.apollodata.com/tools/apollo-server/setup.html. In my server/main.js file: //SET UP APOLLO INCLUDING APOLLO PUBSUB const executableSchema = makeExecutableSchema({ …
VikR
  • 4,818
  • 8
  • 51
  • 96
5
votes
1 answer

updateQueries after GraphQL mutation not working with the Apollo client

After I'm sending a createMessage mutation in my app, I want to update the local ApolloStore using updateQueries. My setup looks as follows: const ChatWithAllMessages = graphql(allMessages, {name: 'allMessagesQuery'})(Chat) export default…
nburk
  • 22,409
  • 18
  • 87
  • 132
5
votes
2 answers

Cache management for watchQuery (Angular-Apollo)

I have a problem combining pagination, prefetching, and refetching of data using Apollo with Angular 2. My intended behaviour in the app is that there never should be any difference in data between the server and the client. I want to reduce loading…
Patrik Nilsson
  • 243
  • 1
  • 3
  • 9
5
votes
0 answers

apollo graphql's subscription on rails + actioncable + redis pubsub

I am trying to archive graphql subscription using apollo + Rails actioncable (redis pubsub backend). problem Currently, I am using graphql-ruby and doing query and mutation fine, but the gem doesn't support subscription. thoughts I only have a…
kukrt
  • 2,117
  • 3
  • 21
  • 32
5
votes
2 answers

Apollo/GraphQL: Field Type to Use for Timestamp?

I'm storing a value to a postgres field that is of type timestamp with time zone. I was defining the field as an int in my Apollo schema, but I'm getting this error message in the resolver: column "apptDateTime" is of type timestamp with time zone…
VikR
  • 4,818
  • 8
  • 51
  • 96
4
votes
1 answer

Angular2 services and route resolvers with GraphQL

I am trying to use Angular2 with GraphQL via Apollo-Client. I followed documentation and everything seems to work fine. However documentation only explains how to connect to GraphQL from the components. There is no information how to use services…
Marcin
  • 1,426
  • 16
  • 19
4
votes
1 answer

GraphQL fetching additional data of subedges in a nested graph

I'm having a little bit more complex data structure resulting in a deeply nested graph. Right now I'm always fetching/reloading through root queries. However I think this is not the best way since it always requires the server to resolve the whole…
Manuel
  • 9,112
  • 13
  • 70
  • 110
4
votes
2 answers

Setup React-Storybooks with React-Apollo

Is there any way to use React-Apollo with React-Storybooks? Previously I was trying out Relay and there is a module (https://github.com/orta/react-storybooks-relay-container) that allowed for creating stub containers that wouldn't require network…
John Shelley
  • 2,655
  • 3
  • 27
  • 36
3
votes
0 answers

How to setup Apollo Gateway with managed federation?

After reading the Apollo docs on managed federation, I configured my Apollo Gateway exactly as described in the article. Basically I didn't pass anything to the ApolloGateway constructor. The ENGINE_API_KEY is provided in my .env file and should be…
3
votes
1 answer

Apollo Link State Default Resolver Not Working (@client query parameter variables)

Example here: https://codesandbox.io/s/j4mo8qpmrw Docs here: https://www.apollographql.com/docs/link/links/state.html#default TLDR: This is a todo list, the @client query parameters don't filter out the list. This is the query, taking in $id as a…
Webber
  • 941
  • 11
  • 26
3
votes
1 answer

GraphQL query, use fragment depending on some condition. GraphQL file loaded

There is a task to request different fields of an object depending on role. Let's say administrator can view one set of metrics. Other users can see another set of metrics. The task is to request only metrics that can be viewed by the user. React…
Ricardas
  • 518
  • 6
  • 18
3
votes
1 answer

difference between Query and Mutation in Apollo?

We can make some requests to the server using both Query and Mutation. In these queries we can pass some params and we will get some results from the server in both cases. The only one obligatory difference is that we can call the mutation from our…
3
votes
2 answers

Apollo GraphQL error handling

I am using apollographql/graphql-server. The server responses look like: {"data":{...},"errors":[{"message":"...","locations":...}]} I have two questions: I find that I can throw or return an Error object and it will be pushed to the response's…
James
  • 31
  • 1
  • 2
3
votes
0 answers

Getting 503 using websockets on heroku, Custom Domain

I'm trying to establish a websocket connection on my heroku node server but keep getting the following error: browser.js:13 WebSocket connection to 'ws://www.mywebsite.com/' failed: Error during WebSocket handshake: Unexpected response code:…
Justin
  • 2,940
  • 3
  • 25
  • 43
3
votes
1 answer

how Apollo client optimisticResponse working

http://dev.apollodata.com/react/mutations.html I am trying out with optimisticResponse, but i am confused... and couldn't get it working on my local. My questions are: will optimisticResponse update the props and hence the re-render? how important…
Bill
  • 17,872
  • 19
  • 83
  • 131