Skip to content

test: expand test suite for GraphQLResolveInfo in resolve functions#4698

Closed
tommyhgunz14 wants to merge 1 commit into
graphql:16.x.xfrom
tommyhgunz14:test/expand-resolve-info-suite
Closed

test: expand test suite for GraphQLResolveInfo in resolve functions#4698
tommyhgunz14 wants to merge 1 commit into
graphql:16.x.xfrom
tommyhgunz14:test/expand-resolve-info-suite

Conversation

@tommyhgunz14

Copy link
Copy Markdown

Closes #351

Adds comprehensive tests for the GraphQLResolveInfo parameter across all three functions that receive it:

  • Field resolvers: tests for nested fields, NonNull/List return type wrappers, fieldNodes with aliases and arguments, fragments, path for deeply nested fields, and variableValues/operation info
  • resolveType: tests that interface and union resolveType callbacks receive correct fieldName, fieldNodes, returnType, and parentType
  • isTypeOf: tests that isTypeOf receives correct resolve info

Previously, only rootValue was tested from GraphQLResolveInfo.

Closes graphql#351

Adds comprehensive tests for the GraphQLResolveInfo parameter
across all three functions that receive it:

- Field resolvers: tests for nested fields, NonNull/List return
  type wrappers, fieldNodes with aliases and arguments, fragments,
  path for deeply nested fields, and variableValues/operation info
- resolveType: tests that interface and union resolveType callbacks
  receive correct fieldName, fieldNodes, returnType, and parentType
- isTypeOf: tests that isTypeOf receives correct resolve info

Previously, only rootValue was tested from GraphQLResolveInfo.
@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 28, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: tommyhgunz14 / name: tommyhgunz14 (b7936cb)

@vercel

vercel Bot commented Apr 28, 2026

Copy link
Copy Markdown

@tommyhgunz14 is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@yaacovCR

Copy link
Copy Markdown
Contributor

@tommyhgunz14 Thanks for submitting these additional tests. We have 100% test coverage already in this repo, but that's just mechanical coverage by line, and doesn't necessarily mean that additional tests are unnecessary. In this particular case, I think we have sufficient coverage for GraphQLResolveInfo in combination with our TypeScript types and existing GraphQLResolveInfo tests, so I will close this PR. We nevertheless very much appreciate the interest in improving the code base! If you have in mind to continue to contribute, feel free to ping me on our Discord if that would be helpful, or opening up an issue to start a discussion about what gaps you would like to fill.

Thanks again!

@yaacovCR yaacovCR closed this May 19, 2026
@tommyhgunz14

Copy link
Copy Markdown
Author

@yaacovCR you're killing my sn73 credibility score, it had already taken a hit from some gold standard ones I pushed before I understood the tiering system. What am I supposed to do to make sure I'm not resolving issues that you're not interested in please.

@yaacovCR yaacovCR reopened this May 23, 2026
@yaacovCR

yaacovCR commented May 23, 2026

Copy link
Copy Markdown
Contributor

I failed to read your PR closely enough, I didn't see that this closes:

Not only was there a pre-existing issue discussing this, it was marked as "help wanted" by @leebyron himself. :)

So reopening. :)

Having said that, please make a few changes:

  1. can you set the base for this PR to 17.x.x. Otherwise I have to front-port it.
  2. can you integrate the expanded tests with our current tests. we can think about another file entirely for all of these tests, resolveInfo-test.ts perhaps? and maybe that file could contain an expectResolveInfo helper that could streamline some of these tests. Just thinking out loud, the helper certainly not a must, but it would be nice if after this PR the number of files testing resolveInfo stayed constant or (preferably) -- at least at the moment I write this -- were reduced.

we have some tests for resolveInfo in a few places:

https://github.com/graphql/graphql-js/blob/17.x.x/src/execution/__tests__/executor-test.ts#L226-L379

and also

https://github.com/graphql/graphql-js/blob/17.x.x/src/execution/__tests__/executor-test.ts#L226-L379
https://github.com/graphql/graphql-js/blob/17.x.x/src/execution/__tests__/union-interface-test.ts#L609-L656

Apologies, happy coding!

@yaacovCR

Copy link
Copy Markdown
Contributor

it had already taken a hit from some gold standard ones I pushed before I understood the tiering system

Also, what is this in reference to? I searched, but could not find. Is anything else stalled?

@tommyhgunz14

Copy link
Copy Markdown
Author

Hi - wasnt sure which one you wanted to persist, I've created this to address your feedback sir. #4764

@yaacovCR

Copy link
Copy Markdown
Contributor

let's use the other PR as that has the best base already.

it had already taken a hit from some gold standard ones I pushed before I understood the tiering system

Also, what is this in reference to? I searched, but could not find. Is anything else stalled?

Circling back to this, still not sure what this is in reference to. :)

@yaacovCR

Copy link
Copy Markdown
Contributor

Closing in favor of #4764

@yaacovCR yaacovCR closed this May 25, 2026
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.

Expand test suite for resolve data

2 participants