Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
t1 committed May 27, 2022
1 parent 55ef56e commit e57eb42
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import jakarta.json.bind.Jsonb;

import com.apollographql.federation.graphqljava.Federation;

import graphql.introspection.Introspection.DirectiveLocation;
import graphql.schema.DataFetcher;
import graphql.schema.FieldCoordinates;
Expand Down Expand Up @@ -134,10 +135,10 @@ private void verifyInjectionIsAvailable() {
// This crazy stream operation basically collects all class names where we need to verify that
// it belongs to an injectable bean
Stream.of(
schema.getQueries().stream().map(Operation::getClassName),
schema.getMutations().stream().map(Operation::getClassName),
schema.getGroupedQueries().values().stream().flatMap(Collection::stream).map(Operation::getClassName),
schema.getGroupedMutations().values().stream().flatMap(Collection::stream).map(Operation::getClassName))
schema.getQueries().stream().map(Operation::getClassName),
schema.getMutations().stream().map(Operation::getClassName),
schema.getGroupedQueries().values().stream().flatMap(Collection::stream).map(Operation::getClassName),
schema.getGroupedMutations().values().stream().flatMap(Collection::stream).map(Operation::getClassName))
.flatMap(stream -> stream)
.distinct().forEach(beanClassName -> {
// verify that the bean is injectable
Expand Down Expand Up @@ -288,7 +289,7 @@ private void addSubscriptions(GraphQLSchema.Builder schemaBuilder) {
}

private void addRootObject(GraphQLObjectType.Builder rootBuilder, Set<Operation> operations,
String rootName) {
String rootName) {

for (Operation operation : operations) {
operation = eventEmitter.fireCreateOperation(operation);
Expand All @@ -299,7 +300,7 @@ private void addRootObject(GraphQLObjectType.Builder rootBuilder, Set<Operation>
}

private void addGroupedRootObject(GraphQLObjectType.Builder rootBuilder,
Map<Group, Set<Operation>> operationMap, String rootName) {
Map<Group, Set<Operation>> operationMap, String rootName) {
Set<Map.Entry<Group, Set<Operation>>> operationsSet = operationMap.entrySet();

for (Map.Entry<Group, Set<Operation>> operationsEntry : operationsSet) {
Expand Down Expand Up @@ -547,7 +548,7 @@ private GraphQLDirective createGraphQLDirectiveFrom(DirectiveInstance directiveI
}

private GraphQLFieldDefinition createGraphQLFieldDefinitionFromBatchOperation(String operationTypeName,
Operation operation) {
Operation operation) {
// Fields
GraphQLFieldDefinition.Builder fieldBuilder = GraphQLFieldDefinition.newFieldDefinition()
.name(operation.getName())
Expand Down Expand Up @@ -720,8 +721,7 @@ private GraphQLInputType createGraphQLInputType(Field field) {
graphQLInputType = GraphQLNonNull.nonNull(graphQLInputType);
}
// Collection depth
do
{
do {
if (wrapper.isCollectionOrArrayOrMap()) {
graphQLInputType = list(graphQLInputType);
wrapper = wrapper.getWrapper();
Expand Down Expand Up @@ -751,8 +751,7 @@ private GraphQLOutputType createGraphQLOutputType(Field field, boolean isBatch)
graphQLOutputType = GraphQLNonNull.nonNull(graphQLOutputType);
}
// Collection depth
do
{
do {
if (wrapper.isCollectionOrArrayOrMap()) {
graphQLOutputType = list(graphQLOutputType);
wrapper = wrapper.getWrapper();
Expand Down Expand Up @@ -852,8 +851,7 @@ private GraphQLArgument createGraphQLArgument(Argument argument) {
graphQLInputType = GraphQLNonNull.nonNull(graphQLInputType);
}
// Collection depth
do
{
do {
if (wrapper.isCollectionOrArrayOrMap()) {
graphQLInputType = list(graphQLInputType);
wrapper = wrapper.getWrapper();
Expand Down Expand Up @@ -925,7 +923,7 @@ private Object sanitizeDefaultValue(Field field) {
private boolean isJsonString(String string) {
if (string != null && !string.isEmpty() && (string.contains("{") || string.contains("["))) {
try (StringReader stringReader = new StringReader(string);
JsonReader jsonReader = jsonReaderFactory.createReader(stringReader)) {
JsonReader jsonReader = jsonReaderFactory.createReader(stringReader)) {

jsonReader.readValue();
return true;
Expand Down

0 comments on commit e57eb42

Please sign in to comment.