question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running introspection query with apollo-client results in RangeError: maximum call stack size exceeded

See original GitHub issue

Intended outcome:

Running the graqhql introspection query with apollo-client. It should return the server’s schema in JSON format.

import { parse, introspectionQuery} from 'graphql';
const query = parse(introspectionQuery);
client.query({query})
      .then(...)
      .catch(...);

Actual outcome:

RangeError: Maximum call stack size exceeded
    at cloneDeep (D:\Users\###\Documents\EVE\teddie\teddie-client\node_modules\apollo-client\util\cloneDeep.…:1)
    at cloneDeep (D:\Users\###\Documents\EVE\teddie\teddie-client\node_modules\apollo-client\util\cloneDeep.…:9)
    at cloneDeep (D:\Users\###\Documents\EVE\teddie\teddie-client\node_modules\apollo-client\util\cloneDeep.…:9)
    at cloneDeep (D:\Users\###\Documents\EVE\teddie\teddie-client\node_modules\apollo-client\util\cloneDeep.…:9)
...

(goes one for quite some lines)

Comment

Replacing the client.query code with networkInterface.query (not using all the fancy apollo features) works.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:24 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
volkanunsalcommented, Sep 20, 2017

Would be great to have a solution for this. addTypename: false trick doesn’t work for me.

2reactions
slycodercommented, Apr 13, 2018

As pointed out above, this is happening because parse creates an object with circular references. These references are only in the location fields of the resulting object so I don’t think they’re actually needed. So you can try:

parse(your_query, { noLocation: true })

and see if that works for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refetching queries in Apollo Client - Apollo GraphQL Docs
The InMemoryCache helps you determine which active queries might have been invalidated by recent cache updates. Local cache updates and refetching work ...
Read more >
GraphQL: File Upload & Troubleshooting - Szhshp
That may help your issue, GraphQL may regard it as custom scalar. createReadStream() crashes-RangeError: Maximum call stack size exceeded.
Read more >
Using GraphQL queries with Apollo Client iOS SDK
This step-by-step guide explains how to use the Apollo client and Contentstack GraphQL queries to power the content of your iOS SDK apps....
Read more >
RangeError: Maximum call stack size exceeded React Native
When running the app, the query works as expected and I receive data from GraphQL server. However, the console shows error messages: Unhandled ......
Read more >
ra-data-graphql - npm
In a nutshell, ra-data-graphql runs an introspection query on your ... actual HTTP request is sent (using ApolloClient) to your GraphQL API.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found