Skip to content

Commit

Permalink
chore: update to graphql-java 21.3 (#369)
Browse files Browse the repository at this point in the history
`graphql-java` added support for `@oneOf` built-in directive.

Supersedes: #358
  • Loading branch information
dariuszkuc authored Jan 21, 2024
1 parent 93694d5 commit d543029
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version = 3.0-SNAPSHOT

# dependencies
annotationsVersion = 24.1.0
graphQLJavaVersion = 21.1
graphQLJavaVersion = 21.3
mockWebServerVersion = 4.12.0
protobufVersion = 3.25.2
slf4jVersion = 2.0.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class ServiceSDLPrinter {

// Apollo Gateway will fail Federation v1 composition if it sees standard directive definitions.
private static final Set<String> STANDARD_DIRECTIVES =
new HashSet<>(Arrays.asList("deprecated", "include", "skip", "specifiedBy"));
new HashSet<>(Arrays.asList("deprecated", "include", "oneOf", "skip", "specifiedBy"));

private ServiceSDLPrinter() {
// hidden constructor as this is static utility class
Expand Down Expand Up @@ -130,13 +130,11 @@ public GraphQLFieldDefinition getFieldDefinition(
*/
public static String generateServiceSDLV2(GraphQLSchema schema) {
// federation v2 SDL does not need to filter federation directive definitions
final Set<String> standardDirectives =
new HashSet<>(Arrays.asList("deprecated", "include", "skip", "specifiedBy"));
return new SchemaPrinter(
SchemaPrinter.Options.defaultOptions()
.includeSchemaDefinition(true)
.includeScalarTypes(true)
.includeDirectives(def -> !standardDirectives.contains(def)))
.includeDirectives(def -> !STANDARD_DIRECTIVES.contains(def)))
.print(schema)
.trim();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

final class FederatedSchemaVerifier {
public static final Set<String> standardDirectives =
new HashSet<>(Arrays.asList("deprecated", "include", "skip", "specifiedBy"));
new HashSet<>(Arrays.asList("deprecated", "include", "oneOf", "skip", "specifiedBy"));

private FederatedSchemaVerifier() {}

Expand Down

0 comments on commit d543029

Please sign in to comment.