Skip to content

Commit 7cf28cf

Browse files
committed
input prefix to static class
1 parent e2e8245 commit 7cf28cf

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/main/java/graphql/annotations/processor/graphQLProcessors/GraphQLInputProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525

2626
import java.util.Map;
2727

28+
import static graphql.annotations.processor.util.InputPropertiesUtil.DEFAULT_INPUT_PREFIX;
29+
2830
public class GraphQLInputProcessor {
2931

30-
private static final String DEFAULT_INPUT_PREFIX = "Input";
3132

3233
private GraphQLObjectInfoRetriever graphQLObjectInfoRetriever;
3334
private GraphQLTypeRetriever graphQLOutputObjectRetriever;

src/main/java/graphql/annotations/processor/retrievers/GraphQLTypeRetriever.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@
2525
import graphql.annotations.processor.typeBuilders.InterfaceBuilder;
2626
import graphql.annotations.processor.typeBuilders.ObjectBuilder;
2727
import graphql.annotations.processor.typeBuilders.UnionBuilder;
28+
import graphql.annotations.processor.util.InputPropertiesUtil;
2829
import graphql.schema.*;
2930

31+
import static graphql.annotations.processor.util.InputPropertiesUtil.DEFAULT_INPUT_PREFIX;
32+
3033
public class GraphQLTypeRetriever {
3134

3235
private GraphQLObjectInfoRetriever graphQLObjectInfoRetriever;
@@ -62,7 +65,7 @@ public GraphQLType getGraphQLType(Class<?> object, ProcessingElementsContainer c
6265
String typeName = graphQLObjectInfoRetriever.getTypeName(object);
6366
GraphQLType type;
6467
if (isInput) {
65-
String typeNameWithPrefix = "Input" + typeName;
68+
String typeNameWithPrefix = DEFAULT_INPUT_PREFIX + typeName;
6669
type = container.getTypeRegistry().get(typeNameWithPrefix);
6770
if (type != null) return type;
6871
} else {
@@ -83,7 +86,7 @@ public GraphQLType getGraphQLType(Class<?> object, ProcessingElementsContainer c
8386
type = new ObjectBuilder(graphQLObjectInfoRetriever, new ParentalSearch(graphQLObjectInfoRetriever), new BreadthFirstSearch(graphQLObjectInfoRetriever), graphQLFieldRetriever, new GraphQLInterfaceRetriever()).getObjectBuilder(object, container).build();
8487
}
8588

86-
if (isInput) typeName = "Input" + typeName;
89+
if (isInput) typeName = DEFAULT_INPUT_PREFIX + typeName;
8790
container.getTypeRegistry().put(typeName, type);
8891
container.getProcessing().pop();
8992

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package graphql.annotations.processor.util;
2+
3+
public class InputPropertiesUtil {
4+
public static final String DEFAULT_INPUT_PREFIX = "Input";
5+
}

0 commit comments

Comments
 (0)