Skip to content

Validate SDL directive argument values#4699

Open
afurm wants to merge 1 commit intographql:16.x.xfrom
afurm:af/validate-sdl-directive-args
Open

Validate SDL directive argument values#4699
afurm wants to merge 1 commit intographql:16.x.xfrom
afurm:af/validate-sdl-directive-args

Conversation

@afurm
Copy link
Copy Markdown

@afurm afurm commented Apr 29, 2026

Summary

  • Add SDL validation for directive argument value types, including custom directive usages.
  • Reuse ValuesOfCorrectTypeRule for SDL directive nodes through a directive-aware validation context.
  • Add coverage for validateSDL and buildSchema rejecting invalid directive argument values.

Why

Fixes #3912.

SDL already rejects invalid values for built-in directives, but custom directive usages could accept invalid argument values such as @foo(bar: FOOBAR) when bar is declared as String!.

Validation

  • npm run lint
  • npm run check
  • npm run testonly
  • npm run prettier:check
  • git diff --check

Full npm test was attempted, but the Docker-backed supported-node integration could not run locally because the Docker daemon was unavailable.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

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

A member of the Team first needs to authorize it.

@linux-foundation-easycla
Copy link
Copy Markdown

CLA Not Signed

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.

Missing validation of schema directive argument types

1 participant