Skip to content

Commit

Permalink
Fixes #1007 (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
aklish committed Oct 16, 2019
1 parent 65a911c commit 105cff0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public GraphQLList classToQueryMap(Class<?> keyClazz, Class<?> valueClazz, DataF
*/
public GraphQLList classToInputMap(Class<?> keyClazz,
Class<?> valueClazz) {
String mapName = toValidNameName("__input__" + keyClazz.getName() + valueClazz.getCanonicalName() + MAP);
String mapName = toValidNameName("_input__" + keyClazz.getName() + valueClazz.getCanonicalName() + MAP);

if (mapConversions.containsKey(mapName)) {
return mapConversions.get(mapName);
Expand Down Expand Up @@ -396,7 +396,7 @@ public GraphQLInputObjectType classToInputObject(Class<?> clazz) {
}

GraphQLInputObjectType.Builder objectBuilder = newInputObject();
objectBuilder.name(toValidNameName("__input__" + clazz.getName()));
objectBuilder.name(toValidNameName("_input__" + clazz.getName()));

for (String attribute : nonEntityDictionary.getAttributes(clazz)) {
log.info("Building input object attribute: {}", attribute);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public ModelBuilder(EntityDictionary dictionary, DataFetcher dataFetcher) {
.build();

pageInfoObject = newObject()
.name("__pageInfoObject")
.name("_pageInfoObject")
.field(newFieldDefinition()
.name("hasNextPage")
.dataFetcher(dataFetcher)
Expand Down Expand Up @@ -158,7 +158,7 @@ public GraphQLSchema build() {
resolveInputObjectRelationships();

/* Construct root object */
GraphQLObjectType.Builder root = newObject().name("__root");
GraphQLObjectType.Builder root = newObject().name("_root");
for (Class<?> clazz : rootClasses) {
String entityName = dictionary.getJsonAliasFor(clazz);
root.field(newFieldDefinition()
Expand All @@ -175,7 +175,7 @@ public GraphQLSchema build() {
}

GraphQLObjectType queryRoot = root.build();
GraphQLObjectType mutationRoot = root.name("__mutation_root").build();
GraphQLObjectType mutationRoot = root.name("_mutation_root").build();

/*
* Walk the object graph (avoiding cycles) and construct the GraphQL output object types.
Expand Down Expand Up @@ -239,7 +239,7 @@ private GraphQLObjectType buildQueryObject(Class<?> entityClass) {
String entityName = dictionary.getJsonAliasFor(entityClass);

GraphQLObjectType.Builder builder = newObject()
.name("__node__" + entityName);
.name("_node__" + entityName);

String id = dictionary.getIdFieldName(entityClass);

Expand Down Expand Up @@ -314,7 +314,7 @@ private GraphQLObjectType buildQueryObject(Class<?> entityClass) {

private GraphQLList buildEdgesObject(String relationName, GraphQLOutputType entityType) {
return new GraphQLList(newObject()
.name("__edges__" + relationName)
.name("_edges__" + relationName)
.field(newFieldDefinition()
.name("node")
.dataFetcher(dataFetcher)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void testRelationshipParameters() {
assertNotNull(bookField.getArgument(AFTER));

/* book.publisher is a 'to one' relationship so it should be missing all but the data parameter */
GraphQLObjectType bookType = (GraphQLObjectType) schema.getType("__node__" + BOOK);
GraphQLObjectType bookType = (GraphQLObjectType) schema.getType("_node__" + BOOK);
GraphQLFieldDefinition publisherField = bookType.getFieldDefinition("publisher");
assertNotNull(publisherField.getArgument(DATA));
assertNull(publisherField.getArgument(FILTER));
Expand Down Expand Up @@ -142,7 +142,7 @@ public void testBuild() {
assertNotEquals(schema.getType(BOOK), null);
assertNotEquals(schema.getType(AUTHOR_INPUT), null);
assertNotEquals(schema.getType(BOOK_INPUT), null);
assertNotEquals(schema.getType("__root"), null);
assertNotEquals(schema.getType("_root"), null);

GraphQLObjectType bookType = getConnectedType((GraphQLObjectType) schema.getType(BOOK), null);
GraphQLObjectType authorType = getConnectedType((GraphQLObjectType) schema.getType(AUTHOR), null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
],
"__typename": "book"
},
"__typename": "__node__author"
"__typename": "_node__author"
},
"__typename": "__edges__author"
"__typename": "_edges__author"
},
{
"node": {
Expand All @@ -39,9 +39,9 @@
],
"__typename": "book"
},
"__typename": "__node__author"
"__typename": "_node__author"
},
"__typename": "__edges__author"
"__typename": "_edges__author"
}
]
}
Expand Down

0 comments on commit 105cff0

Please sign in to comment.