-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Resolver type #4943
Fix Resolver type #4943
Conversation
The exported type for Resolve differs from Resolvers. This causes some type errors when trying to type your resolvers. Where we call the resolver we only use the indicated parameters (fieldName never gets passed to the resolver, e.g https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/LocalState.ts#L391). Also it is aligned with the GraphQL Resolver API
@peoplenarthax: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
Anybody ? |
@hwillson , any suggestion in how to move this? Has been here since June the 11th |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch and change @peoplenarthax! fieldName
was left over from some previous refactoring, so thanks for cleaning that up.
Match Resolver and Resolvers
The exported type for Resolve differs from Resolvers. This causes some type errors when trying to type your resolvers.
Where we call the resolve we only use the indicated parameters (fieldName never gets passed first to the Resolver, e.g https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/LocalState.ts#L391).
Also it is aligned with the GraphQL Resolver API.
Note: Not sure if this was intentional, if so just ignore this PR (even tho an explanation is welcome so I can understand better the type), but it feels like there is a misalignment around the types and if they are already fluffy (any, any, any), this inconsistency make it more difficult to type resolvers.
Checklist: