INNER CODE UNIT · Kotlin

resultProjection

neo4j-graphql/neo4j-graphql · src/main/kotlin/org/neo4j/graphql/CypherGenerator.kt:354

        val resultProjection = projectFields.map { pair ->
            val (fieldName, projection) = pair
            // todo fix handling of primitive arrays in graphql-java
            val type = md.properties[fieldName]?.type
            if (type?.array == true && md.cypherFor(fieldName) == null) {
                "[x IN $projection |x] AS `$fieldName`"
            } else {
                "$projection AS `$fieldName`"
            }
        }.joinToString(",\n","RETURN ")

        val resultFieldNames = projectFields.map { it.first }.toSet()
        val where = if (isDynamic) "" else where(field, variable, md, orderBys, params)
        val parts = listOf(
                query,
                where,
                resultProjection,
                // todo check if result is in returned projections

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…