Skip to content

docs: backport v17 updates to v16 - #4911

Merged
yaacovCR merged 16 commits into
graphql:16.x.xfrom
yaacovCR:v16-api-examples
Nov 3, 2026
Merged

yaacovCR merged 16 commits into
graphql:16.x.xfrom
yaacovCR:v16-api-examples

Conversation

@yaacovCR

@yaacovCR yaacovCR commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

Cito and others added 2 commits October 22, 2026 14:48
…aphql#4860)

While porting the new API docs to GraphQL-core (the Python port), every `@example` was run as a doctest. That turned up a few examples that don't produce what their `// =>` comments say, and some descriptions that were copied from a different API. This PR fixes them.

(cherry picked from commit e35a025)
Backports v17 PR graphql#4907: graphql#4907
Source commit: 106e879

Adapt the example runner to v16's Mocha, TypeScript 4.6, and Babel source
loader instead of requiring native Node type stripping and ES modules.
Keep assertion tracking, async examples, expected errors, and JSON-aware
comparisons. Run examples in npm test and CI, and document annotations.

Apply the example corrections for v16 APIs, including schema coordinates,
directive extension parsing, scalar imports, and printed input values.
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@yaacovCR 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 yaacovCR changed the title docs: backport v16 updates docs: backport v17 updates to v16 Oct 22, 2026
Backport runner assertion and module-resolution fixes from v17 commit
1d3056f.

Normalize node: builtin imports for Node 12, reject top-level returns,
and validate runtime import and re-export bindings before TypeScript can
erase unused imports or compile missing exports into unchecked properties.
Backport of graphql#4981.
Source commit: 953fc7c

Use v16 serialize/parseValue hooks; v16 has no scalar valueToLiteral hook.
Backport of graphql#4981.
Source commit: 670fe3d

Type the corresponding v16 subscription and coerceInputValue examples; omit v17-only harness and input validation APIs.
Backport of graphql#4981.
Source commit: 862e619

Narrow the corresponding v16 AST examples, including getOperationRootType and schema-coordinate parsing. Preserve v16 directive-extension parsing options.
Backport of graphql#4981.
Source commit: e47c4a3

Handle the equivalent optional v16 results, and use normalized schema definitions in v16-only required argument/input-field examples.
Backport of graphql#4981.
Source commit: 3c12e76

Convert the matching v16 execution and schema-change annotations into executable substring checks as well.
Accept an optional output directory in build:npm, defaulting to npmDist. Resolve repository inputs independently of the caller and generate portable module paths so temporary consumers can invoke the existing build command.

Backport of graphql#4981.
Source commit: 2d7a065

Adapt the existing v16 Babel build, keeping repository inputs independent of the caller working directory.
Discover examples using TypeScript JSDoc tag positions and Markdown code blocks. Preserve source ranges for diagnostics and use the extractor in the formatter, checking that formatting preserves example boundaries.

Backport of graphql#4981.
Source commit: 8c2ced7

Add the formatter missing from v16, using Prettier 2 and TypeScript 4.6. Include tooling type checking and format the existing examples; retain documented exceptions for nonstandard GraphQL syntax.
Keep await and yield in their original scope, preserve initializer names and bindings, and avoid collisions with example identifiers. Track every assertion invocation through a dedicated runtime helper and reject annotations that do not run or finish.

Backport of graphql#4981.
Source commit: 5ce4fc1

Keep the Mocha/CommonJS runner, use the shared source-edit helper, and preserve scope, initializer names, bindings, and every assertion invocation.
Rename the runner and supply its types in the same commit so the migration
passes strict type checking. Adopt the shared JSDoc extractor and source-edit
helpers, and validate original modules with Node before instrumentation.

Backport of graphql#4981.
Source commit: 77e5035

Migrate to the shared extractor and strictly checked TypeScript while retaining Mocha/CommonJS execution. Validate uninstrumented modules with the Node 17 experimental VM API.
Invoke build:npm into a temporary project, pack and install the result, and execute examples through native package resolution. Run from the consumer directory, restore the caller during cleanup, and use side-effect entry points so exported then functions are not invoked.

Backport of graphql#4981.
Source commit: 17e5bcb

Build and install the v16 package in a temporary consumer project, run transpiled examples through its CommonJS resolution, and restore the working directory during cleanup.
Require ts or typescript fences for executable examples, keeping GraphQL fences as documentation. Check each uninstrumented example against the installed declarations before execution and document the TypeScript and optional-value conventions.

Backport of graphql#4981.
Source commit: 77439f5

Type-check original snippets with TypeScript 4.6 against the installed v16 declarations before running them; require TypeScript fences for executable examples.
@yaacovCR
yaacovCR merged commit ee43c4d into graphql:16.x.x Nov 3, 2026
19 of 20 checks passed
@yaacovCR
yaacovCR deleted the v16-api-examples branch November 3, 2026 20:20
yaacovCR added a commit that referenced this pull request Nov 4, 2026
## v16.15.0 (2026-11-04)

#### New Feature 🚀
* [#4984](#4984) Backport v17 fixes to v16 ([@yaacovCR](https://github.com/yaacovCR))

#### Bug Fix 🐞
* [#4900](#4900) Backport OverlappingFieldsCanMerge changes (v16) ([@yaacovCR](https://github.com/yaacovCR))
* [#4909](#4909) Backport maxLexicalTokens, maxComments, maxSourceLength parser options (v16) ([@yaacovCR](https://github.com/yaacovCR))
* [#4917](#4917) fix: bound shared fragment traversal in introspection validation (v16) ([@yaacovCR](https://github.com/yaacovCR))

#### Docs 📝
* [#4911](#4911) docs: backport v17 updates to v16 ([@yaacovCR](https://github.com/yaacovCR))

#### Internal 🏠
* [#4826](#4826) chore(release): protect latest release channels from v16 ([@yaacovCR](https://github.com/yaacovCR))

#### Committers: 1
* Yaacov Rydzinski ([@yaacovCR](https://github.com/yaacovCR))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants