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

errors during Schema's schema property method extremely difficult to debug #44

Closed
dgoldstein0 opened this issue Jan 30, 2016 · 3 comments

Comments

@dgoldstein0
Copy link

Errors in @property def schema (and probably any other @property in that class) do not yield useful tracebacks; instead, python "helpfully" falls back to __getattr__ and then fails in there, which is extremely unhelpful. This appears to be a specific case of encode/django-rest-framework#2108

Would it be possible to ditch the __getattr_ use, or alternatively the @propertys?

Traceback of what I'm hitting:

<ipython-input-2-8b3585dcab10> in <module>()
----> 1 res2 = schema.execute("query { subject_user {user_id} }", request_context=dict(_subject_user_id=1))

/usr/local/encap/python-2.7.7/lib/python2.7/site-packages/graphene/core/schema.pyc in execute(self, request, root, args, **kwargs)
    120
    121     def execute(self, request='', root=None, args=None, **kwargs):
--> 122         kwargs = dict(kwargs, request=request, root=root, args=args, schema=self.schema)
    123         with self.plugins.context_execution(**kwargs) as execute_kwargs:
    124             return self.executor.execute(**execute_kwargs)

/usr/local/encap/python-2.7.7/lib/python2.7/site-packages/graphene/core/schema.pyc in __getattr__(self, name)
     47         if name in self.plugins:
     48             return getattr(self.plugins, name)
---> 49         return super(Schema, self).__getattr__(name)
     50
     51     def T(self, _type):

AttributeError: 'super' object has no attribute '__getattr__'
@syrusakbary
Copy link
Member

@dgoldstein0 this issue if of graphene, not graphql-core. If you could repost it there would be great!

@dgoldstein0
Copy link
Author

oop sorry about that

@dgoldstein0
Copy link
Author

reposted as graphql-python/graphene#96

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

2 participants