Skip to content
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

Merged
merged 11 commits into from
Sep 4, 2019
Merged

Conversation

peoplenarthax
Copy link
Contributor

@peoplenarthax peoplenarthax commented Jun 11, 2019

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:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

Angel Paredes Barato added 2 commits June 11, 2019 08:50
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
@apollo-cla
Copy link

@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/

@peoplenarthax
Copy link
Contributor Author

Anybody ?

@peoplenarthax
Copy link
Contributor Author

@hwillson , any suggestion in how to move this? Has been here since June the 11th

Copy link
Member

@hwillson hwillson left a 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.

@hwillson hwillson merged commit fa581c1 into apollographql:master Sep 4, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants