apollographql / apollographql/apollo-tooling

Inaccurate type on `apollo-graphql` for `GraphQLResolverMap`

Open
#1,823 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

**version**: 0.4.0

The current type is: https://github.com/apollographql/apollo-tooling/blob/888a710c7c17c0d07e972ebd761807a41473456a/packages/apollo-graphql/src/schema/resolverMap.ts#L3-L17

However, `GraphQLFieldResolver` strips out any implementation of `TArgs` from `graphql-js`: https://github.com/graphql/graphql-js/blob/3f859d4e5e6088deea97193d5106382a901a9c21/src/type/definition.d.ts#L430-L441

I believe the best solution is to change the definition of `GraphQLFieldResolver` to:
`GraphQLFieldResolver`.

I'd be remiss if i didn't also mention my research, [here](https://github.com/apollographql/apollo-server/issues/2218#issuecomment-593271456)

Contributor guide

Open the contributing guide

Research direction

Start in packages/apollo-graphql/src/schema/resolverMap.ts and compare GraphQLResolverMap with the referenced graphql-js GraphQLFieldResolver definition. Update the resolver type so the argument type is preserved, then verify that GraphQLResolverMap accepts implementations with TArgs from graphql-js.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
backend-api-design
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.