Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
t1 committed Jan 4, 2022
1 parent 0062a55 commit 8294643
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 javax.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 @@ -141,10 +142,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 @@ -294,7 +295,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 @@ -305,7 +306,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 @@ -546,7 +547,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 @@ -713,8 +714,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 @@ -744,8 +744,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 @@ -845,8 +844,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 @@ -912,7 +910,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 8294643

Please sign in to comment.