Skip to content

Commit 677a693

Browse files
committed
fix code review fixes
1 parent 0320eab commit 677a693

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ graphqlAnnotations.getContainer().getCodeRegistryBuilder().build();
8282

8383
## Annotations Schema Creator
8484

85-
Using the `GraphQLAnnotations` processor object can be a little bit confused if you wish to use it to create a GraphQL schema.
85+
Using the `GraphQLAnnotations` processor object can be a little bit confusing if you wish to use it to create a GraphQL schema.
8686
So we created a util class to help you create your desired GraphQL schema, in a syntax similiar to the graphql-java syntax.
8787

8888
In order to do so you can use the ``AnnotationsSchemaCreator.Builder`` in the following way:

src/main/java/graphql/annotations/AnnotationsSchemaCreator.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* Copyright 2016 Yurii Rashkovskii
3-
*
3+
* <p>
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -112,31 +112,32 @@ public GraphQLAnnotations getGraphQLAnnotations() {
112112
public GraphQLSchema build() {
113113
assert this.queryObject != null;
114114

115-
if (graphQLAnnotations == null) {
116-
graphQLAnnotations = new GraphQLAnnotations();
115+
if (this.graphQLAnnotations == null) {
116+
this.graphQLAnnotations = new GraphQLAnnotations();
117117
}
118118

119-
if (graphqlSchemaBuilder == null) {
120-
graphqlSchemaBuilder = new GraphQLSchema.Builder();
119+
if (this.graphqlSchemaBuilder == null) {
120+
this.graphqlSchemaBuilder = new GraphQLSchema.Builder();
121121
}
122122

123123
Set<GraphQLDirective> directives = directivesObjectList.stream().map(dir -> graphQLAnnotations.directive(dir)).collect(Collectors.toSet());
124-
Set<GraphQLType> additionalTypes = additionalTypesList.stream().map(x -> x.isInterface() ?
125-
graphQLAnnotations.generateInterface(x) : graphQLAnnotations.object(x)).collect(Collectors.toSet());
124+
Set<GraphQLType> additionalTypes = additionalTypesList.stream().map(additionalType ->
125+
additionalType.isInterface() ?
126+
graphQLAnnotations.generateInterface(additionalType) : graphQLAnnotations.object(additionalType)).collect(Collectors.toSet());
126127

127-
graphqlSchemaBuilder.query(graphQLAnnotations.object(queryObject));
128+
this.graphqlSchemaBuilder.query(graphQLAnnotations.object(queryObject));
128129
if (this.mutationObject != null) {
129-
graphqlSchemaBuilder.mutation(graphQLAnnotations.object(mutationObject));
130+
this.graphqlSchemaBuilder.mutation(graphQLAnnotations.object(mutationObject));
130131
}
131132
if (this.subscriptionObject != null) {
132-
graphqlSchemaBuilder.subscription(graphQLAnnotations.object(subscriptionObject));
133+
this.graphqlSchemaBuilder.subscription(graphQLAnnotations.object(subscriptionObject));
133134
}
134135
if (!this.directivesObjectList.isEmpty()) {
135136
graphqlSchemaBuilder.additionalDirectives(directives);
136137
}
137-
graphqlSchemaBuilder.additionalTypes(additionalTypes).additionalType(Relay.pageInfoType)
138+
this.graphqlSchemaBuilder.additionalTypes(additionalTypes).additionalType(Relay.pageInfoType)
138139
.codeRegistry(graphQLAnnotations.getContainer().getCodeRegistryBuilder().build());
139-
return graphqlSchemaBuilder.build();
140+
return this.graphqlSchemaBuilder.build();
140141
}
141142
}
142143
}

0 commit comments

Comments
 (0)