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
Describe the bug
When I was trying to use the (very convenient) way of accessing the API clients for GraphQL handlers, I found myself using selectionSet to be able re-map fields. I found it more convenient than using delegateToSchema or batchDelegateToSchema. However, the selectionSet when using an API SDK function is not being passed on to delegateToSchema / batchDelegateToSchema. Currently, a transform is created that transforms the request, but that only transforms the field if there is a selectionSet attached to a particular node in the original request. If the original request was for a scalar node, then there is no selectionSet associated and the request is not transformed.
In the above I'd expect that there is a GraphQL request being made with the selectionSet { headline }, but it is actually never attached and thus never returns any data for that headline.
I believe this is due to the fact that the request is only transformed if the original request (in the info object) also had a selectionSet. I think instead we should pass along the selectionSet into delegateToSchema / batchDelegateToSchema. I believe the relevant location is commonDelegateOptions on line 213 of get-mesh.ts.
Describe the bug
When I was trying to use the (very convenient) way of accessing the API clients for GraphQL handlers, I found myself using
selectionSet
to be able re-map fields. I found it more convenient than usingdelegateToSchema
orbatchDelegateToSchema
. However, theselectionSet
when using an API SDK function is not being passed on to delegateToSchema / batchDelegateToSchema. Currently, a transform is created that transforms the request, but that only transforms the field if there is a selectionSet attached to a particular node in the original request. If the original request was for a scalar node, then there is no selectionSet associated and the request is not transformed.To Reproduce
Steps to reproduce the behavior:
Using this in my resolver:
Expected behavior
In the above I'd expect that there is a GraphQL request being made with the selectionSet
{ headline }
, but it is actually never attached and thus never returns any data for that headline.I believe this is due to the fact that the request is only transformed if the original request (in the info object) also had a selectionSet. I think instead we should pass along the selectionSet into delegateToSchema / batchDelegateToSchema. I believe the relevant location is
commonDelegateOptions
on line 213 ofget-mesh.ts
.Environment:
The text was updated successfully, but these errors were encountered: