Skip to content

Add named type for user defined resolveType and isTypeOf functions #310

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

Merged
merged 2 commits into from
Mar 22, 2016

Conversation

JeffRMoore
Copy link
Contributor

The definition file uses a named type GraphQLFieldResolveFn to describe the user provided field resolving function, but uses inline types to describe the resolveType and isTypeOf functions.

This change brings symmetry by defining a named types for the other two resolving functions: resolveType and isTypeOf. This adds named types for those, too: GraphQLTypeResolveFn and GraphQLIsTypeOfFn.

This is in the #304 PR, but stands on its own. In that PR, each function of the three functions is changed to have a different type for the info parameter. Having symmetrical definitions makes that change easier to follow.

This was not done for serialize, parseValue and parseLiteral because they are not exposed on their object and the named type would have only been referenced in one place.

leebyron added a commit that referenced this pull request Mar 22, 2016
Add named type for user defined resolveType and isTypeOf functions
@leebyron leebyron merged commit 3ab90f8 into graphql:master Mar 22, 2016
@leebyron
Copy link
Contributor

Awesome, thanks!

@JeffRMoore JeffRMoore deleted the resolve-fn-types branch March 24, 2016 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants