Skip to content

Commit

Permalink
chore: fix linter suggestions (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszkuc authored May 16, 2024
1 parent eaecd5c commit 8c6cf6a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private static RuntimeWiring ensureFederationV2DirectiveDefinitionsExist(
importedDefinitions.forEach(
def -> {
if (def instanceof DirectiveDefinition
&& !typeRegistry.getDirectiveDefinition(def.getName()).isPresent()) {
&& typeRegistry.getDirectiveDefinition(def.getName()).isEmpty()) {
typeRegistry.add(def);
} else if (def instanceof ScalarTypeDefinition) {
if (!typeRegistry.scalars().containsKey(def.getName())) {
Expand Down Expand Up @@ -193,11 +193,11 @@ private static RuntimeWiring ensureFederationDirectiveDefinitionsExist(

// Add Federation directives if they don't exist.
FederationDirectives.federation1DirectiveDefinitions.stream()
.filter(def -> !typeRegistry.getDirectiveDefinition(def.getName()).isPresent())
.filter(def -> typeRegistry.getDirectiveDefinition(def.getName()).isEmpty())
.forEachOrdered(typeRegistry::add);

// Add scalar type for _FieldSet, since the directives depend on it.
if (!typeRegistry.getType(_FieldSet.typeName).isPresent()) {
if (typeRegistry.getType(_FieldSet.typeName).isEmpty()) {
typeRegistry.add(_FieldSet.definition);
}

Expand Down

0 comments on commit 8c6cf6a

Please sign in to comment.