Generic Resolving of Protobufs #985
chris-fibo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We use Protos for our APIs., and match up the protobuf to the GraphQL so for the most part we use the default resolver. Which mostly works great.
But, getattr on a protobuf will return a default value, if the property is missing, rather than None. Normally this isn't a big issue. But if an object is missing, a default object is returned. Which is causing problems on the frontend.
So we can work around this on a case by case basis, by adding a resolver for that field, and checking for its existence. But I'd rather do this in a more generic way.
But I can't set the default resolver. Is there something else I can use?
Perhaps a fallback resolver (that can also chain into another fallback, like the snake resolver)
Beta Was this translation helpful? Give feedback.
All reactions