Skip to content

fix(KnownDirectivesRule): locations for input field arguments in extensions#4814

Merged
yaacovCR merged 2 commits into
graphql:17.x.xfrom
yaacovCR:fix-directive-on-input-field-arguments-in-extensions
Jun 12, 2026
Merged

fix(KnownDirectivesRule): locations for input field arguments in extensions#4814
yaacovCR merged 2 commits into
graphql:17.x.xfrom
yaacovCR:fix-directive-on-input-field-arguments-in-extensions

Conversation

@yaacovCR

Copy link
Copy Markdown
Contributor

No description provided.

yaacovCR added 2 commits June 12, 2026 17:55
KnownDirectivesRule enforces that directives are only used in their allowed locations. The parser already represents input object extensions correctly, but when resolving the location for a directive at location `INPUT_VALUE_DEFINITION`, the validation rule did not consider input object extensions, and the location would be misunderstood as ARGUMENT_DEFINITION.

That made this SDL look invalid, even though the directive is allowed on INPUT_FIELD_DEFINITION:

```graphql
directive @onInputFieldDefinition on INPUT_FIELD_DEFINITION

input MyInput {
  base: Int
}

extend input MyInput {
  extra: Int @onInputFieldDefinition
}
```

It also made the reverse look valid, even though this directive is only allowed on ARGUMENT_DEFINITION and the extension member is an input field with no argument:

```graphql
directive @onArgumentDefinition on ARGUMENT_DEFINITION

input MyInput {
  base: Int
}

extend input MyInput {
  extra: Int @onArgumentDefinition
}
```

The extension field is now classified as INPUT_FIELD_DEFINITION, so the first case is accepted and the second is rejected.
…sions

Add SDL coverage for field argument directive locations in object and interface definitions and extensions, including both valid ARGUMENT_DEFINITION directives and misplaced INPUT_FIELD_DEFINITION directives.
@vercel

vercel Bot commented Jun 12, 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 added the PR: bug fix 🐞 requires increase of "patch" version number label Jun 12, 2026
@yaacovCR yaacovCR merged commit 6618357 into graphql:17.x.x Jun 12, 2026
23 of 24 checks passed
@yaacovCR yaacovCR deleted the fix-directive-on-input-field-arguments-in-extensions branch June 12, 2026 15:02
yaacovCR added a commit that referenced this pull request Jun 15, 2026
## v17.0.0 (2026-06-15)

#### New Feature 🚀
* [#4819](#4819) feat: graduate directives on directives ([@yaacovCR](https://github.com/yaacovCR))

#### Bug Fix 🐞
* [#4799](#4799) fix: raise request error on invalid fragment variables ([@yaacovCR](https://github.com/yaacovCR))
* [#4800](#4800) fix: apply directives when SDL contains type definitions and extensions with directives ([@yaacovCR](https://github.com/yaacovCR))
* [#4564](#4564) OneOf Inhabitability ([@jbellenger](https://github.com/jbellenger))
* [#4814](#4814) fix(KnownDirectivesRule): locations for input field arguments in extensions ([@yaacovCR](https://github.com/yaacovCR))
* [#4726](#4726) feat(validation): reject directive definition cycles ([@yaacovCR](https://github.com/yaacovCR))
* [#4815](#4815) Revert "feat(validation): reject directive definition cycles (#4726)" ([@yaacovCR](https://github.com/yaacovCR))

#### Docs 📝
<details>
<summary> 11 PRs were merged </summary>

* [#4790](#4790) docs: minor diagnostics doc comment improvements ([@yaacovCR](https://github.com/yaacovCR))
* [#4791](#4791) fix: docs: polish diagnostics comments further ([@yaacovCR](https://github.com/yaacovCR))
* [#4793](#4793) docs: further improve general execution and tracing docs ([@yaacovCR](https://github.com/yaacovCR))
* [#4802](#4802) docs: correct extension field comments - v17 ([@yaacovCR](https://github.com/yaacovCR))
* [#4805](#4805) docs: publish fixed extensions comments ([@yaacovCR](https://github.com/yaacovCR))
* [#4807](#4807) docs: add prettier for jsdoc examples ([@yaacovCR](https://github.com/yaacovCR))
* [#4435](#4435) Subscriptions docs suggestions ([@Urigo](https://github.com/Urigo))
* [#4811](#4811) docs: fix a few indentations inside string literals ([@yaacovCR](https://github.com/yaacovCR))
* [#4813](#4813) internal: docs update ([@yaacovCR](https://github.com/yaacovCR))
* [#4820](#4820) docs: document `@experimental_disableErrorPropagation` ([@yaacovCR](https://github.com/yaacovCR))
* [#4817](#4817) docs: post 17.rc-0 update ([@yaacovCR](https://github.com/yaacovCR))
</details>

#### Polish 💅
<details>
<summary> 2 PRs were merged </summary>

* [#4809](#4809) internal: use prettier for non-generated website files ([@yaacovCR](https://github.com/yaacovCR))
* [#4812](#4812) polish: fix stream test cases ([@yaacovCR](https://github.com/yaacovCR))
</details>

#### Internal 🏠
<details>
<summary> 6 PRs were merged </summary>

* [#4795](#4795) chore: move website publishing from 16.x.x to 17.x.x ([@yaacovCR](https://github.com/yaacovCR))
* [#4796](#4796) internal: fix broken npm/deno deployments ([@yaacovCR](https://github.com/yaacovCR))
* [#4797](#4797) ci: update GitHub Actions versions ([@yaacovCR](https://github.com/yaacovCR))
* [#4806](#4806) internal: update frontmatter ([@yaacovCR](https://github.com/yaacovCR))
* [#4808](#4808) intenral: fix ci badge ([@yaacovCR](https://github.com/yaacovCR))
* [#4810](#4810) internal: add prettier:examples to lint-staged ([@yaacovCR](https://github.com/yaacovCR))
</details>

#### Committers: 3
* James Bellenger([@jbellenger](https://github.com/jbellenger))
* Uri Goldshtein([@Urigo](https://github.com/Urigo))
* 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

Labels

PR: bug fix 🐞 requires increase of "patch" version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant