Skip to content

Reject duplicate additional directive definitions#4394

Merged
andimarek merged 2 commits into
masterfrom
reproduce-3453-duplicate-directives
May 20, 2026
Merged

Reject duplicate additional directive definitions#4394
andimarek merged 2 commits into
masterfrom
reproduce-3453-duplicate-directives

Conversation

@andimarek
Copy link
Copy Markdown
Member

Summary

  • change the standard GraphQLSchema.Builder additional directives holder to be keyed by directive name
  • add additionalDirectives(Collection<? extends GraphQLDirective>) and deprecate the Set overload
  • reject same-name different-instance directive definitions like FastBuilder does
  • add SDL and programmatic reproducer coverage for duplicate directive definitions

Fixes #3453

Testing

  • ./gradlew test --tests graphql.schema.GraphQLSchemaTest --tests graphql.schema.validation.NoDirectiveRedefinitionTest

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 5865 (+7 🟢) 5809 (+7 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 17 5865 (+7 🟢) 5808 (+7 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 21 5865 (+7 🟢) 5808 (+7 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 25 5865 (+7 🟢) 5808 (+7 🟢) 0 (±0) 0 (±0) 57 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 23492 (+28 🟢) 23265 (+28 🟢) 0 (±0) 0 (±0) 227 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 29640 3129 90.5% ±0.0%
Branches 8712 1532 85.0% ±0.0%
Methods 7914 1209 86.7% ±0.0%

Changed Class Coverage (2 classes)

Class Line Branch Method
g.s.GraphQLSchema
$Builder
+0.3% 🟢 +2.8% 🟢 +0.5% 🟢
g.s.i.e.SchemaProblem +16.7% 🟢 ±0.0% +25.0% 🟢

Full HTML report: build artifact jacoco-html-report

Updated: 2026-05-20 09:36:49 UTC

@andimarek andimarek merged commit 26648a3 into master May 20, 2026
11 checks passed
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.

Schema introspection in JSON can return directive definition many times

1 participant