Skip to content

test: consolidate resolveInfo tests into dedicated resolveInfo-test.ts#4764

Open
tommyhgunz14 wants to merge 1 commit into
graphql:17.x.xfrom
tommyhgunz14:test/resolve-info-suite
Open

test: consolidate resolveInfo tests into dedicated resolveInfo-test.ts#4764
tommyhgunz14 wants to merge 1 commit into
graphql:17.x.xfrom
tommyhgunz14:test/resolve-info-suite

Conversation

@tommyhgunz14

@tommyhgunz14 tommyhgunz14 commented May 23, 2026

Copy link
Copy Markdown

Consolidate GraphQLResolveInfo tests into resolveInfo-test.ts

Addresses feedback from #4698 — consolidates scattered resolveInfo tests into a single dedicated file with a helper to streamline assertions.

What changed

New file: src/execution/__tests__/resolveInfo-test.ts

  • Moved two existing resolveInfo tests from executor-test.ts:
    • provides info about current execution state
    • populates path correctly with complex types
  • Added new coverage for:
    • Nested field resolution (parentType, returnType, fieldName)
    • NonNull / List wrapper types in returnType
    • fieldNodes with aliases and arguments
    • Fragment definitions in info.fragments
    • resolveType on interfaces and unions
    • isTypeOf receiving correct info
    • path for deeply nested fields
    • variableValues and operation

Helper utilities

  • expectResolveInfo() — executes a query and returns the captured GraphQLResolveInfo, removing boilerplate from each test
  • captureInfo() — reusable resolver that stores its info argument for later assertions

Cleanup in executor-test.ts

  • Removed the two moved tests
  • Removed now-unused imports (GraphQLResolveInfo, GraphQLUnionType, Kind, promiseWithResolvers)

Result

@vercel

vercel Bot commented May 23, 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.

- Move 'provides info about current execution state' and 'populates path
  correctly with complex types' from executor-test.ts to resolveInfo-test.ts
- Add new tests for nested fields, NonNull/List wrappers, fieldNodes with
  aliases and arguments, fragments, resolveType on interfaces and unions,
  isTypeOf, deeply nested paths, and variableValues
- Add expectResolveInfo helper and captureInfo resolver for streamlined
  test assertions
- Remove unused imports from executor-test.ts (GraphQLResolveInfo,
  GraphQLUnionType, Kind, promiseWithResolvers)
- Target: 17.x.x branch
- Reduces number of files testing resolveInfo (consolidated from
  executor-test.ts into a single dedicated file)
@tommyhgunz14 tommyhgunz14 force-pushed the test/resolve-info-suite branch from 39f9039 to 949422e Compare May 23, 2026 20:54
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.

1 participant