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

Exceptions being hidden in resolve methods #112

Closed
jdugan1024 opened this issue Feb 6, 2016 · 2 comments
Closed

Exceptions being hidden in resolve methods #112

jdugan1024 opened this issue Feb 6, 2016 · 2 comments

Comments

@jdugan1024
Copy link
Contributor

I'm using graphene 0.7.1 and am really liking it! Thanks!

I ran into an issue that took me quite some time to figure out. Given a DjangoNode like this:

class NetworkEntityType(DjangoNode):
    class Meta:
        model = NetworkEntity
        only_fields = (
            'id',
            'type',
            'short_name',
            'full_name',
            'website',
        )

    availability = graphene.String()

    def resolve_availability(self, args, info):
        1/0

The availability attribute comes back as null and there is no exception reported. Is this by design or accident?

It makes it very difficult to debug the resolve method -- I missed a typo for a long time because I had no error message to guide me. My error wasn't a division by zero obviously, but that detail would confuse the issue. I also get the same behavior if I use DjangoObjectType instead of DjangoNode.

The NetworkEntity model is pretty vanilla, I can provide it if you want but I don't think there are any surprises

@syrusakbary
Copy link
Member

Thanks for pointing this!
The problem resides in graphql-core, which powers the internals of graphene.

graphql-python/graphql-core#41
I'm working in resolving this issue there (in graphql-core)... will close the issue here!

@jdugan1024
Copy link
Contributor Author

Thanks @syrusakbary

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