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

Is it possible to use nested / namespaced query variables in a GraphQL query?

I'd like to namespace / nest query variables like this: query ($params: {$id: ID!}) { getUser(id: $params.id) { email username } } with the variables: { "params": { "id": "42" } } but it's not a valid query. However a query…
Marc Greenstock
  • 11,278
  • 4
  • 30
  • 54
1
vote
0 answers

Handling invalid or non-existent sub-references in Apollo server responses

I'm running Apollo server on top of an eventually-consistent architecture, which is causing schema errors when a referenced object is not found in the store/cache. I'm looking for the best way to deal with this issue while maintaining a strict…
1
vote
1 answer

Why when I upload file with apollo-server the file is uploaded but the file is 0kb?

I tried to solve the problem but I don't understand why the file is uploaded but his size is 0Kb. I see this code in the tutorial but he works on that tutorial but, is not worked for me const { ApolloServer, gql } = require('apollo-server'); const…
1
vote
0 answers

Apollo typepolicies how to read sibling field of Query?

in my type policy typepolicies:{ Query:{ fields:{ getCartItems:{ //This is a local field //I want to reference "allProducts" field here }, …
notinsky
  • 51
  • 1
  • 3
1
vote
0 answers

How to write extended types from an Apollo federated schema to its database?

How are mutations handled in a federated schema? If I have an accounts service and a course service, the course service will likely extend the User type by some fields. How these fields are resolved for a query using the __resolveReference()…
1
vote
1 answer

ApolloError.js:43 Uncaught (in promise) Error: Network error: Cannot read property 'Mutation' of undefined

Hello i have these error when i invoque a mutation function for local-state with apollo-link-state. Also i have the picture problem with a node module, and cant now how solve. Please any help. ------node…
1
vote
1 answer

ApolloGraphQL -- ReadQuery `Field Not Found` Error?

My readQuery is returning a field not found error, even though it seems like the field is present in the cache. QUERY const GETIMSFROMCACHE_QUERY = gql` query getIMsFromCache($fromID: String!){ instant_message(fromID:$fromID){ id, fromID, …
VikR
  • 4,818
  • 8
  • 51
  • 96
1
vote
2 answers

Writing an Apollo resolver for an interface

Let's say I have the following typedef: interface Node { id: ID! } type Foo implements Node { id: ID! quantity: Int } type Bar implements Node { id: ID! name: String } Every ID I send out, I want to process in the same way. Currently I…
SCB
  • 5,821
  • 1
  • 34
  • 43
1
vote
0 answers

Apollo Graphql mutation and refetch queries returning empty data

Currently working on an app where we have a contact list with id and list name. Clicking on the contact list name will bring to a detailed page listing all contacts within the said contact listname. On this page a button is set to show input fields…
scubadude
  • 31
  • 7
1
vote
1 answer

Apollo error: “Connector must be a function or an class”?

I have this query in GraphIQL (note: Graph I QL). It's giving me an error message regarding a "connector": query ($userID: String!) { getUserData(id: $userID) { name_first name_last picture_thumbnail id } } //query variables: { …
VikR
  • 4,818
  • 8
  • 51
  • 96
1
vote
1 answer

How to Modify This ES6 Code so as to Insert a Breakpoint?

I'm learning ES6 syntax, as well as the latest Apollo libs. This withData code is adapted from the Githunt-React Apollo demo. const withData = graphql(GETIMS_QUERY, { options: ({ params }) => ({ variables: { "fromID":…
VikR
  • 4,818
  • 8
  • 51
  • 96
1
vote
1 answer

Apollo: Client-Side Subscription Code?

Here's my client-side code for Apollo subscriptions, based on the Githunt-React-master sample code: componentWillReceiveProps(nextProps) { const fromID = Meteor.userId(); const toID = nextProps.toID; if (!this.subscription &&…
VikR
  • 4,818
  • 8
  • 51
  • 96
1
vote
1 answer

Apollo: Update React Props on Subscription Update?

Looking at the Apollo docs example code for subscriptions, I am not yet seeing how to update the React props with the subscription results. From http://dev.apollodata.com/react/subscriptions.html: Here is a regular query: import { CommentsPage }…
VikR
  • 4,818
  • 8
  • 51
  • 96
1
vote
1 answer

Having trouble using graphql's fragments with Apollo

My problem is quite simple, I need to get different menu functions depending on which type of user is logged in on my app (using react/redux/graphql/apollo). I have it all working fine, but my graphql query to get the info I need currently looks…
DrunkDevKek
  • 469
  • 4
  • 17
1
vote
0 answers

Apollo Angular: How do I 'reinitate' my my watchQuery even after an error?

I have a query that searches for an object with a given $ID. It will always fail on the initial page load as we need to wait for the user to provide this $Id. I want my query to continue retrying until a correct Id is found. Right now the error goes…
viztastic
  • 1,815
  • 1
  • 17
  • 17