Possible to override default resolver? #933
Unanswered
chris-fibo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to override the default resolver, or maybe use a fallback resolver that everything calls?
We use proto3 protobufs for our internal APIs. So the objects that the graphql is working with are these protobufs.
As I understand it, the default browser basically does something like this:
getattr(obj, attr_name, None)
Except proto3 scalars always exists, and when they don't they return a default value (0 or empty string) Which means the above code will never return None.
What I'd like to do instead is something along the lines of (or something similar)
Basically I need to check for the existence of the field first.
I am hoping for some elegant way to do this, rather than create a resolver for every type.
Beta Was this translation helpful? Give feedback.
All reactions