Closed SleeplessOne1917 closed 1 year ago
The GraphQL Playground still seems to choke on recursive schema definitions like:
type Sample {
id: ID!
name: String
age: Int
location: String
partner: Sample
parents: [Sample]
children: [Sample]
}
In the HTML version, I have no problems executing queries after adding this to the schema, but:
The server is based on webonyx/graphql-php
Any ideas?
After further investigation and reload, GraphQL Playground gave me a nice Error: Introspection must provide input type for arguments, which led me to the actual error in the schema - the corresponding Input Type:
input Sample_Input {
id: ID
name: String
age: Int
location: String
partner: Sample
parents: [Sample]
children: [Sample]
}
Changing those fields to Sample_Input too fixes the issue, thanks.
It seems that the breaking on recursive types was due to a problem with a tool I was using to generate the schema. I will close this now.
This issue pertains to the following package(s):
What OS and OS version are you experiencing the issue(s) on?
Windows 10 Build 19042
What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?
v2
What is the expected behavior?
I expect to be able to use the Docs tab to look at types that have a recursive reference in their field. For example, a Message type might have a comments field that returns a list of type Message.
What is the actual behavior?
If I go too deep into recursive fields in the docs, GraphQL Playground crashes and displays the following error in the console: react-dom.production.min.js:187 RangeError: Maximum call stack size exceeded
This only happens when using GraphQL Playground from www.graphqlbin.com. If I go directly to localhost to use the GraphQL Playground built into Apollo Server, I can use the docs for recursive fields without crashing.
What steps may we take to reproduce the behavior?