Questions tagged [apollo-boost]
28 questions
1
vote
1 answer
[GraphQL error]: Message: Variable "$id" of required type "MongoID!" was not provided
I have the following query:
import { gql } from 'apollo-boost';
const GetUserInfo = gql`
query getUserInfo($id: MongoID!){
userById(_id: $id){
local{
username
...
}
}
`;
export {GetUserInfo} ;
then I have bound the query…

Sabrina Danielle Green
- 327
- 3
- 10
1
vote
1 answer
Apollo-boost caching issue
I'm experiencing an issue with apollo client caching, and I'm not sure I understand why. I'm building an angular 6 app, using apollo-boost, all is working well. I have a scenario now where my a graphql query takes an id (of a user) and a filter…

Greg
- 6,453
- 9
- 45
- 61
0
votes
1 answer
Vue Apollo Upload file crashes Node Maximum call stack size exceeded at _openReadFs
I am trying to setup front end for graphQl file upload with Apollo-boost-upload. The backend code is based on this link
https://dev.to/dnature/handling-file-uploads-with-apollo-server-2-0-14n7.
It's now reaching the resolver breakpoint after adding…

rhythmo
- 859
- 2
- 9
- 21
0
votes
1 answer
Apollo GraphQL Caching Questions (cacheRedirects and readFragment)
I'm new to Apollo and Apollo caching. I've been writing a demo project and have run into two issues:
Can't get cacheRedirects to work properly:
In my demo, I "Load All" COVID19 test data, which queries an API and returns an array of results for…

furnaceX
- 567
- 2
- 8
- 15
0
votes
1 answer
Adding multiple headers to graphql client (apollo-boost)
const client = new ApolloClient({
uri,
onError: (e: any) => {
console.log('error: ', e); // Failed to fetch
console.log(e.operation.getContext()); // it does show it has x-abc-id
},
request: operation => {
const…

isaadabbasi
- 101
- 5
0
votes
1 answer
Apollo Client: Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components)
I am using the React Rails gem to server side render my react app. When I turn prerender off, it works fine. But when I switch prerender on I get the following error:
Error: Element type is invalid: expected a string (for built-in components) or a…

Hinesh Patel
- 1,161
- 2
- 7
- 15
0
votes
1 answer
How to capture Errors in Apollo Consumer when making graphql queries
This is how I am querying my Graphql engine.
export GraphQLWrapper ({
query,
extractData,
children,
queryVariables,
skip,
}: AsyncWrapperProps) => {
return (
{client => {
…

Tanu
- 1,286
- 4
- 16
- 35
0
votes
1 answer
GraphQL with apollo-client, Is it possible to have same id's and different typenames
I had a question and can't find it in documentation.
For example I have a list
products with ids 1,2,3,4
And I have another list, categories with ids 1,2,3,4.
example query
{
products {
id
name
categories {
id
name
…

Sarmad Shah
- 3,725
- 1
- 20
- 42
0
votes
1 answer
this.props not accessible when using ApolloClient
I am using apollo-boost and I have created an ApolloClient and I want to do some redirection after a mutation is run but I cannot access the props
index.js
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from…

Dhaval Chheda
- 4,637
- 5
- 24
- 44
0
votes
1 answer
Node with GraphQL and React Require not defined
I am developing a Node with GraphQL backend and just started working on the front end with create-react-app.
It was going well until I added this code:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App…

Daniel
- 14,004
- 16
- 96
- 156
0
votes
1 answer
Network Error when initiating a query to my graphql API
Here's the error message I get when doing a query :
[Network error]: ServerParseError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
The query works fine locally, when setting the uri of my ApolloClient to…

John Doe
- 1,092
- 3
- 12
- 25
0
votes
0 answers
Apollo Client Introspective Queries
Works on the Playground...
I am trying to query the following enum values:
query {
__type(name:"ActivityType") {
enumValues {
name
}
}
}
When I test the query with the playground, it works. I receive a list of the enumeration…

Tabbyofjudah
- 1,973
- 3
- 17
- 29
-1
votes
1 answer
graphql delete mutation works in the playground but not in the frontend
I have a graphql delete mutation that works perfectly with Strapi in the graphql plugin playground.
In a Vuejs frontend I cannot get the mutation to read the id of the item to delete.
The query in the graphql playground is
mutation deleteInvoice…

Gosmith
- 457
- 1
- 3
- 19