Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

A possible minor bug in ExecutionContext.complete_value #187

Copy link
Copy link
Closed
@ipeterov

Description

@ipeterov
Issue body actions

I'm trying to figure out a way to return None for non-nullable fields if the requesting user doesn't have permission to view them.

I was trying to pass Undefined from graphql.pyutils.undefined, but it doesn't work. It looks like the second check in this line

# If result value is null or undefined then return null.
if result is None or result is Undefined:
    return None

can never run because Undefined is actually a descendant of ValueError and therefore triggers this check.

if isinstance(result, Exception):
    raise result

I don't know if this was meant as an escape hatch for returning null values if you really wanted to (which is what I really need right now), but the code itself seems wrong either way.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingSomething isn't workingdiscussionNeeds more discussionNeeds more discussion

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.