Add named type for user defined resolveType and isTypeOf functions #310
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.