From 0660de0112a15d61f1ceb6f2b621f7fd98b03431 Mon Sep 17 00:00:00 2001 From: Andreas Berger Date: Thu, 3 Sep 2020 16:37:20 +0200 Subject: [PATCH] fix build (#125) --- src/main/kotlin/org/neo4j/graphql/BuildingEnv.kt | 6 ++---- .../org/neo4j/graphql/handler/projection/ProjectionBase.kt | 2 +- src/test/resources/translator-tests1.adoc | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/org/neo4j/graphql/BuildingEnv.kt b/src/main/kotlin/org/neo4j/graphql/BuildingEnv.kt index 70574b3d..d21ae252 100644 --- a/src/main/kotlin/org/neo4j/graphql/BuildingEnv.kt +++ b/src/main/kotlin/org/neo4j/graphql/BuildingEnv.kt @@ -3,8 +3,6 @@ package org.neo4j.graphql import graphql.Scalars import graphql.schema.* -import graphql.schema.GraphQLTypeUtil.simplePrint - class BuildingEnv(val types: MutableMap) { private val typesForRelation = types.values @@ -25,7 +23,7 @@ class BuildingEnv(val types: MutableMap) { type = GraphQLNonNull(type) } return GraphQLFieldDefinition.newFieldDefinition() - .name("$prefix${simplePrint(resultType)}") + .name("$prefix${resultType.name()}") .arguments(getInputValueDefinitions(scalarFields, forceOptionalProvider)) .type(type.ref() as GraphQLOutputType) } @@ -73,7 +71,7 @@ class BuildingEnv(val types: MutableMap) { } val existingFilterType = types[filterName] if (existingFilterType != null) { - return simplePrint(existingFilterType as? GraphQLInputType) + return (existingFilterType as? GraphQLInputType)?.name() ?: throw IllegalStateException("Filter type $filterName is already defined but not an input type") } createdTypes.add(filterName) diff --git a/src/main/kotlin/org/neo4j/graphql/handler/projection/ProjectionBase.kt b/src/main/kotlin/org/neo4j/graphql/handler/projection/ProjectionBase.kt index 46927850..4fd49711 100644 --- a/src/main/kotlin/org/neo4j/graphql/handler/projection/ProjectionBase.kt +++ b/src/main/kotlin/org/neo4j/graphql/handler/projection/ProjectionBase.kt @@ -214,7 +214,7 @@ open class ProjectionBase { } ?: when { isObjectField -> { val patternComprehensions = if (fieldDefinition.isNeo4jType()) { - if (propertiesToSkipDeepProjection.contains(fieldDefinition.innerName())) { + if (propertiesToSkipDeepProjection.contains(fieldDefinition.name)) { // if the property has an internal type like Date or DateTime and we want to compute on this // type (e.g sorting), we need to pass out the whole property and do the concrete projection // after the outer computation is done diff --git a/src/test/resources/translator-tests1.adoc b/src/test/resources/translator-tests1.adoc index 7eb046f5..e9900196 100644 --- a/src/test/resources/translator-tests1.adoc +++ b/src/test/resources/translator-tests1.adoc @@ -408,7 +408,10 @@ MATCH (person:Person) RETURN person { .name, .age } AS person .GraphQL-Query [source,graphql] ---- -{ foo:person {n:name } } + { foo:person { + n:name + } + } ---- .Cypher params