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
It works great when there is a driver/shopper assigned to the order, but that's not always the case.
This seems like it will always run even though the driverId (required by the shopperById query) may not be present, causing 404 errors from the underlying API. At first I thought that requiredSelectionSet handled this validation, but that doesn't seem to be the case.
Describe the solution you'd like
Some way within the resolveTo return null for the Shopper type if the necessary args are not provided.
Describe alternatives you've considered
This is a non-starter for my usage if this isn't possible, as I am hoping to migrate a codebase where we have many nullable resolved objects/fields.
Additional context
I am using GraphQL Mesh for a BFF layer that depends on swagger docs of microservies that I do not manage, so changing the underlying APIs are not an option. I feel this is something that should be configurable.
The text was updated successfully, but these errors were encountered:
jurchfield
changed the title
Allow skipping a resolver if required fields are not present in the type.
Allow skipping a resolver if required fields are not present in the root type.
Jan 16, 2025
Is your feature request related to a problem? Please describe.
Kind of. I need to be able to resolve a Shopper on an Order type, and I have defined this within my
additionalTypeDefs
:It works great when there is a driver/shopper assigned to the order, but that's not always the case.
This seems like it will always run even though the
driverId
(required by theshopperById
query) may not be present, causing 404 errors from the underlying API. At first I thought thatrequiredSelectionSet
handled this validation, but that doesn't seem to be the case.Describe the solution you'd like
Some way within the
resolveTo
return null for the Shopper type if the necessary args are not provided.Describe alternatives you've considered
This is a non-starter for my usage if this isn't possible, as I am hoping to migrate a codebase where we have many nullable resolved objects/fields.
Additional context
I am using GraphQL Mesh for a BFF layer that depends on swagger docs of microservies that I do not manage, so changing the underlying APIs are not an option. I feel this is something that should be configurable.
The text was updated successfully, but these errors were encountered: