Skip to content
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

"Decorated type deeper than introspection query" error with nested lists #29

Open
sf-sagarj opened this issue Apr 26, 2017 · 1 comment

Comments

@sf-sagarj
Copy link

We see the following errors when using nested lists:

Error: Decorated type deeper than introspection query.
    at n (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:23637)
    at n (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:23879)
    at n (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:23733)
    at n (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:23879)
    at r (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:24425)
    at http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:26609
    at http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:11:8480
    at Array.reduce (native)
    at keyValMap (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:11:8444)
    at f (http://cdn.jsdelivr.net/graphiql/0.7.1/graphiql.min.js:15:26484)

Here's the example code that can cause this issue. Graphene introspection doesn't report any errors.

import graphene, json

class Animal(graphene.Interface):
   id = graphene.String()

class Dog(graphene.ObjectType):
   class Meta:
      interfaces = (Animal, )
   breed = graphene.String()

class Cat(graphene.ObjectType):
   class Meta:
      interfaces = (Animal, )
   category = graphene.String()

class Query(graphene.ObjectType):
  animals = graphene.NonNull(graphene.List(graphene.NonNull(graphene.List(graphene.NonNull(Animal)))))
  def resolve_animals(self, args, context, info):
    return[[Dog(id=1, breed='Golden Retriever'),
            Dog(id=2, breed='German Shepard')],
           [Cat(id=11, category ='Tiger'),
            Cat(id=12, category='House Cat')]]

schema = graphene.Schema(query=Query, types=[Dog, Cat, ])

Errors disappear if we remove the "required" or NonNull decorators. Any suggestions on how to fix these errors?

@sf-sagarj
Copy link
Author

issue appears to be due to graphiql version set to 0.7.1 in render_graphiql.py - I was able to fix the issue by changing this to 0.10.1 in my local copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant