Skip to content

Commit

Permalink
refactor: Cleanup names in InjectCustomDocumentation as requested in …
Browse files Browse the repository at this point in the history
…review.
  • Loading branch information
t2gran committed Jan 13, 2025
1 parent bba0903 commit 3dd1efe
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ private <T extends GraphQLNamedSchemaElement> TraversalControl fieldDoc(
var fieldName = field.getName();
var typeName = parent.getName();

Optional<T> f1 = customDocumentation
Optional<T> withDescription = customDocumentation
.fieldDescription(typeName, fieldName, field.getDescription())
.map(doc -> setDescription.apply(field, doc));

Optional<T> f2 = customDocumentation
Optional<T> withDeprecated = customDocumentation
.fieldDeprecatedReason(typeName, fieldName, originalDeprecatedReason)
.map(doc -> setDeprecatedReason.apply(f1.orElse(field), doc));
.map(doc -> setDeprecatedReason.apply(withDescription.orElse(field), doc));

f2.or(() -> f1).ifPresent(f -> changeNode(context, f));
withDeprecated.or(() -> withDescription).ifPresent(f -> changeNode(context, f));

return CONTINUE;
}
Expand Down

0 comments on commit 3dd1efe

Please sign in to comment.