-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running introspection query with apollo-client results in RangeError: maximum call stack size exceeded #1717
Comments
Hi @lunedis. 👋 I looked at the code for |
Actually, never mind, I think I figured out what is going on. If you're using We should probably make our Finally, I just wanted to point out that I don't think Apollo Client is the right tool if you simply want to execute a query against a server and get the result. For that it makes much more sense to use the network interface directly, as you have also done, it seems 👍 |
Here is how lodash solves this problem: |
Also having this same issue
Any idea when this could be fixed? |
This issue has been automatically marked as stale becuase it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Apollo Client! |
I have same problem with all queries via react-apollo. |
I can confirm what @seeden says. If server is not available react-apollo goes crazy firing |
This issue has been automatically marked as stale becuase it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Apollo Client! |
any update from apollo team? |
Would be great to have a solution for this. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Apollo Client! |
This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Apollo Client! |
@seeden how to solve the problem, add the 'addTypename: false' not work. |
I did not solve it. I have this issue still in my project |
@jbaxleyiii can you reopen this issue? I am not able to download introspection with latest apollo-client import 'isomorphic-fetch';
import { parse, introspectionQuery } from 'graphql';
import { InMemoryCache } from 'apollo-cache-inmemory';
import ApolloClient from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import { graphql } from '../config/client';
const link = new HttpLink({
uri: graphql.url,
credentials: 'same-origin',
});
const cache = new InMemoryCache({});
const client = new ApolloClient({
link,
cache,
});
const query = parse(introspectionQuery);
client
.query({ query })
.then((result) => {
console.log(JSON.stringify(result, null, ' '));
})
.catch((err) => {
console.error(err);
}); I will always get
versions: "apollo-cache-inmemory": "^1.1.2",
"apollo-client": "^2.1.0",
"apollo-link": "^1.0.5",
"apollo-link-batch-http": "^1.0.2",
"apollo-link-dedup": "1.0.0",
"apollo-link-http": "^1.3.0",
"apollo-link-retry": "^1.0.2",
"apollo-link-ws": "^1.0.2",
"apollo-utilities": "^1.0.3", |
I'm experiencing the same, would you consider a PR that replaces the custom |
Having this issue as well, would be much appreciated if a solution was given addTypename: false Did not work for me |
addTypename: false is really bad idea because apollo needs to have it. I am looking different solution. |
I'm still able to reproduce. ├─┬ apollo-client-preset@1.0.8 @jbaxleyiii can you reopen this issue? |
Still reproduceable
In fact, blows up with |
any solution?? We have same issue... |
As pointed out above, this is happening because
and see if that works for you. |
@slycoder thanks! Your solution helped |
The custom `cloneDeep` function we're using in the `apollo-utilities` package doesn't handle circular references well (as in it crashes if it hits one). These changes replace the custom `cloneDeep` implementation with `fclone`, which is a dependency free, lightweight and performant deep clone implementation. `fclone` drops circular references (replacing them with a `[Circular]` string). Fixes #1717.
#3881 should help address this - thanks! |
* Replace custom `cloneDeep` function The custom `cloneDeep` function we're using in the `apollo-utilities` package doesn't handle circular references well (as in it crashes if it hits one). These changes replace the custom `cloneDeep` implementation with `fclone`, which is a dependency free, lightweight and performant deep clone implementation. `fclone` drops circular references (replacing them with a `[Circular]` string). Fixes #1717. * Changelog update
Intended outcome:
Running the graqhql introspection query with apollo-client. It should return the server's schema in JSON format.
Actual outcome:
(goes one for quite some lines)
Comment
Replacing the
client.query
code withnetworkInterface.query
(not using all the fancy apollo features) works.The text was updated successfully, but these errors were encountered: