You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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