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

React component formatting - div not closing

Apologies if this is straight forward. I am following a tutorial and it seems there is a syntax error. I am unable to find the right format for the following: const productsToDisplay = this.props.shopData.shop.products return (
graphql-hm
  • 23
  • 2
2
votes
1 answer

How to input an array into a GraphQL Mutation

I'm trying to add a field to my Mutation that has an array in it with my own type. When I added the attraction the the createTour mutation, I started getting this error: Error: The type of Mutation.createTour(attractions:) must be Input Type but…
SaiyanGirl
  • 16,376
  • 11
  • 41
  • 57
2
votes
1 answer

Having difficulty integration Apollo Client with GatsbyJS

I'm having some problem integrating Apollo Client with GatsbyJS. When I run gatsby develop everything seems to be working fine and I can use Apollo Client without any problem. However, I keep getting errors when I run gatsby build, specifically I…
electro7912
  • 339
  • 4
  • 14
2
votes
0 answers

Apollo: Using same objectID with different depth of query

Let's say I have 2 pages. User and UserDetail. User is wrapped by just user (id: 1){ id name email } whereas UserDetail is wrapped by more detail query user (id: 1) { id name email bankAccount ... } I setup dataIdFromObject as typename +…
2
votes
0 answers

How to check whether the ApolloClient is connected with server or not

I have setup ApolloClient with reactjs. I have created server on url http://localhost:3044/graphql. Now I need to test whether it connected to that backend url or not. How do I do that? import ApolloClient from 'apollo-boost'; import { HttpLink }…
Profer
  • 553
  • 8
  • 40
  • 81
2
votes
1 answer

GraphQL (Apollo): Can you access directives within resolve function?

I'd like to make every field private, unless otherwise notated with a directive. Is it possible to get this information within a resolve function? const typeDefs = gql` directive @public on FIELD_DEFINITION type Query { viewer: User…
M. Walker
  • 603
  • 4
  • 14
2
votes
1 answer

Apollo is not re-sending the query to the server

I build an api-platform app with a graphql endpoint. On client side I manage queries and mutations with apollo client like this(In vuejs front-end): import { ApolloClient } from 'apollo-client' import { HttpLink } from 'apollo-link-http' import {…
Juan I. Morales Pestana
  • 1,057
  • 1
  • 10
  • 34
2
votes
0 answers

Use the same GraphQL schema using different endpoints using Apollo

Context Today I have a simple GraphQL stitching server that unify two graphql applications into a single graphql endpoint AS IS It works introspecting each service (app 1 & app 2) and building an ApolloLink assigning a host url to each app with…
2
votes
1 answer

GraphQL Apollo Mutation with Input Type

I want to add the type Task to my Milestone, but I can not figure out the syntax for my query: This is my schema: type Milestone { _id: String! title: String! task: [Task] } type Task { _id: String name: String } input TaskInput { _id:…
Stef
  • 644
  • 1
  • 8
  • 25
2
votes
1 answer

React-Apollo Query refetch causes children to unmount

I have a display component wrapped in a Query component to recieve data from a GraphQL query. After I perform a mutation, I have to refetch the data to update the store. The problem is that calling refetch() results in the child component being…
2
votes
1 answer

Can't deploy apollo-server to NOW

If I cd server and run now it gets deployed to https://server-91vnej46w.now.sh/ When I open this url I expect to see a graphql playground but instead I see a src folder Deploying with Zeit Now apollo docs doesn't help Github repo here Deployment to…
karolis2017
  • 2,195
  • 8
  • 24
  • 49
2
votes
1 answer

Graphql react-apollo IntrospectionFragmentMatcher

I'm using GitHub Graphql API and I wrote following code with react-apollo but when I paginate after many requests I get following errors on the console. You are using the simple (heuristic) fragment matcher, but your queries contain union or…
2
votes
1 answer

Can't reexport the named export 'Name of the module' node_modules/graphql/index.mjs => Vue CLI 3 + Apollo

const apolloProvider = new VueApollo({ defaultClient }) Vue.config.productionTip = false new Vue({ provide: apolloProvider.provide(), router, store, render: h => h(App) }).$mount('#app') Im having a problem when i integrated ApolloBoost…
2
votes
1 answer

Convert gql function to string with inserted variables

I have this query defined, and use it succesfully in my app: export const GET_TEAM = gql` query($id: ID!) { getTeam(id: $id) { ...CompleteTeam } } ${fragments.team} ` But would like to use it for mocking purpose, and for that I…
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232