Recursive types #16
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: OSS/graphql#16
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi!
Sometimes types might refer to themselves (think of
__Type
having a fieldofType
of type__Type
, which is required for introspection). The easiest approach is to bound this recursiveness to a certain depth (I'm getting infinite loops unless I do that). Are those infinite loops to be expected, or is that something on my end? (asking so I know whether to spend more time trying to debug this)Sounds like a bug. I checked the schema of my GraphQL application and it doesn't seem to have recursive types, so I wouldn't notice.
Ideally the library shouldn't care about the depth of recursion, it's the problem of the schema author, but it depends on what causes the problem.
What do I have to do to reproduce this, define a schema with a recursive type and run some query against it?
@belka Hi! I was getting those errors when implementing an introspection system. I ended up memoizing the
__Type
resolver (that's the biggest offender) and limiting the depth to 30 (which should be enough for any serious app). I'm not sure what the simplest way to reproduce this would be, but I guess we can close it for now.