From d830527eae4c2ff445b22fe83d234679c9722367 Mon Sep 17 00:00:00 2001 From: Andreas Berger Date: Sun, 10 Nov 2024 12:14:37 +0100 Subject: [PATCH 1/7] add integration tests (wip) --- .../kotlin/org/neo4j/graphql/Constants.kt | 17 +-- .../neo4j/graphql/CypherDataFetcherResult.kt | 10 -- .../kotlin/org/neo4j/graphql/QueryContext.kt | 3 - .../kotlin/org/neo4j/graphql/SchemaBuilder.kt | 29 ++--- .../neo4j/graphql/domain/fields/PointField.kt | 6 +- .../domain/naming/RelationshipBaseNames.kt | 2 +- .../neo4j/graphql/handler/BaseDataFetcher.kt | 28 +++-- .../graphql/handler/ConnectionResolver.kt | 6 +- ...ImplementingTypeConnectionFieldResolver.kt | 83 +++++++++++++ .../org/neo4j/graphql/handler/ReadResolver.kt | 16 ++- .../org/neo4j/graphql/scalars/BigIntScalar.kt | 4 +- .../neo4j/graphql/scalars/DurationScalar.kt | 55 ++++++++ .../neo4j/graphql/scalars/TemporalScalar.kt | 117 ++++++++++++++++++ .../neo4j/graphql/schema/AugmentationBase.kt | 8 ++ .../graphql/schema/AugmentationHandler.kt | 2 +- .../model/inputs/options/OptionsInput.kt | 8 +- .../schema/model/outputs/BaseSelection.kt | 49 ++++++++ .../model/outputs/FieldContainerSelection.kt | 2 +- .../model/outputs/InterfaceSelection.kt | 2 +- .../NodeConnectionEdgeFieldSelection.kt | 32 ++++- .../outputs/NodeConnectionFieldSelection.kt | 36 +++++- .../schema/model/outputs/NodeSelection.kt | 2 +- .../schema/model/outputs/PageInfoSelection.kt | 43 +++++++ .../model/outputs/point/BasePointSelection.kt | 22 ++-- .../outputs/point/CartesianPointSelection.kt | 41 ++++-- .../model/outputs/point/PointSelection.kt | 41 ++++-- .../RootNodeConnectionSelection.kt | 3 +- .../CreateConnectionClause.kt | 4 +- .../projection/ProjectScalarField.kt | 4 +- .../graphql/translate/where/CreateWhere.kt | 5 +- .../graphql/utils/InvalidCursorException.kt | 4 + .../org/neo4j/graphql/utils/PagingUtils.kt | 34 +++++ .../org/neo4j/graphql/utils/ResolveTree.kt | 7 ++ .../src/main/resources/lib_directives.graphql | 12 ++ core/src/main/resources/neo4j_types.graphql | 8 -- .../kotlin/org/neo4j/graphql/CypherTests.kt | 12 +- .../neo4j/graphql/utils/AsciiDocTestSuite.kt | 9 +- .../neo4j/graphql/utils/CypherTestSuite.kt | 100 ++++++++------- .../cypher/v2/connections/alias.adoc | 10 +- .../v2/connections/filtering/composite.adoc | 20 +-- .../v2/connections/filtering/node/and.adoc | 8 +- .../v2/connections/filtering/node/arrays.adoc | 8 +- .../connections/filtering/node/equality.adoc | 4 +- .../connections/filtering/node/numerical.adoc | 16 +-- .../v2/connections/filtering/node/or.adoc | 4 +- .../v2/connections/filtering/node/points.adoc | 4 +- .../v2/connections/filtering/node/string.adoc | 16 +-- .../filtering/relationship/and.adoc | 8 +- .../filtering/relationship/arrays.adoc | 8 +- .../filtering/relationship/equality.adoc | 4 +- .../filtering/relationship/numerical.adoc | 16 +-- .../filtering/relationship/or.adoc | 4 +- .../filtering/relationship/points.adoc | 4 +- .../filtering/relationship/string.adoc | 16 +-- .../filtering/relationship/temporal.adoc | 6 +- .../cypher/v2/connections/interfaces.adoc | 56 ++++----- .../connections/projections/projections.adoc | 18 +-- .../connections/relationship-properties.adoc | 40 +++--- .../cypher/v2/connections/unions.adoc | 40 +++--- .../cypher/v2/directives/alias.adoc | 4 +- .../cypher/v2/directives/coalesce_2.adoc | 2 +- .../cypher/v2/directives/coalesce_3.adoc | 2 +- ...r_require-fields-on-nested-interfaces.adoc | 12 +- ...olver_require-fields-on-nested-unions.adoc | 12 +- .../interface-relationships/read.adoc | 28 ++--- .../directives/node/node-label-interface.adoc | 4 +- .../v2/directives/node/node-label-union.adoc | 4 +- .../cypher/v2/directives/node/node-label.adoc | 2 +- .../cypher/v2/experimental/typename-in.adoc | 18 +-- .../union-relationship-filtering.adoc | 4 +- .../v2/experimental/union-top-level.adoc | 12 +- .../tck-test-files/cypher/v2/issues/1348.adoc | 12 +- .../tck-test-files/cypher/v2/issues/2262.adoc | 4 +- .../tck-test-files/cypher/v2/issues/2614.adoc | 4 +- .../tck-test-files/cypher/v2/issues/3394.adoc | 4 +- .../tck-test-files/cypher/v2/issues/360.adoc | 8 +- .../tck-test-files/cypher/v2/issues/4007.adoc | 2 +- .../tck-test-files/cypher/v2/issues/4015.adoc | 4 +- .../tck-test-files/cypher/v2/issues/4287.adoc | 4 +- .../tck-test-files/cypher/v2/issues/433.adoc | 2 +- .../tck-test-files/cypher/v2/issues/4432.adoc | 8 +- .../tck-test-files/cypher/v2/issues/583.adoc | 6 +- .../cypher/v2/rfcs/query-limits.adoc | 6 +- .../cypher/v2/root-connection.adoc | 10 +- .../cypher/v2/types/datetime.adoc | 2 +- .../cypher/v2/types/localdatetime.adoc | 2 +- .../cypher/v2/types/localtime.adoc | 2 +- .../tck-test-files/cypher/v2/types/time.adoc | 4 +- .../query-direction-connection_1.adoc | 2 +- .../query-direction-connection_2.adoc | 2 +- .../query-direction-connection_3.adoc | 2 +- .../undirected-connection.adoc | 2 +- .../undirected-relationships_2.adoc | 4 +- .../undirected-relationships_3.adoc | 4 +- .../graphql/driver/adapter/Neo4jAdapter.kt | 2 + 95 files changed, 949 insertions(+), 433 deletions(-) delete mode 100644 core/src/main/kotlin/org/neo4j/graphql/CypherDataFetcherResult.kt create mode 100644 core/src/main/kotlin/org/neo4j/graphql/handler/ImplementingTypeConnectionFieldResolver.kt create mode 100644 core/src/main/kotlin/org/neo4j/graphql/scalars/DurationScalar.kt create mode 100644 core/src/main/kotlin/org/neo4j/graphql/scalars/TemporalScalar.kt create mode 100644 core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/BaseSelection.kt create mode 100644 core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/PageInfoSelection.kt create mode 100644 core/src/main/kotlin/org/neo4j/graphql/utils/InvalidCursorException.kt create mode 100644 core/src/main/kotlin/org/neo4j/graphql/utils/PagingUtils.kt diff --git a/core/src/main/kotlin/org/neo4j/graphql/Constants.kt b/core/src/main/kotlin/org/neo4j/graphql/Constants.kt index da41f60f..cad50286 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/Constants.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/Constants.kt @@ -4,6 +4,7 @@ import graphql.language.TypeName import org.neo4j.graphql.domain.directives.RelationshipDirective object Constants { + const val TYPE_NAME = "__typename" const val JS_COMPATIBILITY: Boolean = true const val ID_FIELD = "id" @@ -26,18 +27,9 @@ object Constants { const val RELATIONSHIP_FIELD = "relationship" const val TYPENAME_IN = "typename_IN" - const val RESOLVE_TYPE = "__resolveType" + const val RESOLVE_TYPE = TYPE_NAME const val RESOLVE_ID = "__id" - const val X = "x" - const val Y = "y" - const val Z = "z" - const val LONGITUDE = "longitude" - const val LATITUDE = "latitude" - const val HEIGHT = "height" - const val CRS = "crs" - const val SRID = "srid" - const val POINT_TYPE = "Point" const val CARTESIAN_POINT_TYPE = "CartesianPoint" const val POINT_INPUT_TYPE = "PointInput" @@ -68,8 +60,6 @@ object Constants { RelationshipDirective.NAME, ) - const val TYPE_NAME = "__typename" - const val OPTIONS = "options" const val WHERE = "where" @@ -85,6 +75,9 @@ object Constants { val SortDirection = TypeName("SortDirection") val PointDistance = TypeName("PointDistance") val CartesianPointDistance = TypeName("CartesianPointDistance") + + val POINT = TypeName(POINT_TYPE) + val CARTESIAN_POINT = TypeName(CARTESIAN_POINT_TYPE) } diff --git a/core/src/main/kotlin/org/neo4j/graphql/CypherDataFetcherResult.kt b/core/src/main/kotlin/org/neo4j/graphql/CypherDataFetcherResult.kt deleted file mode 100644 index 0ba52a8a..00000000 --- a/core/src/main/kotlin/org/neo4j/graphql/CypherDataFetcherResult.kt +++ /dev/null @@ -1,10 +0,0 @@ -package org.neo4j.graphql - -import graphql.schema.GraphQLType - -internal data class CypherDataFetcherResult @JvmOverloads constructor( - val query: String, - val params: Map = emptyMap(), - var type: GraphQLType? = null, - val variable: String -) diff --git a/core/src/main/kotlin/org/neo4j/graphql/QueryContext.kt b/core/src/main/kotlin/org/neo4j/graphql/QueryContext.kt index 4dfabde9..3e1caba6 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/QueryContext.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/QueryContext.kt @@ -3,12 +3,9 @@ package org.neo4j.graphql import org.neo4j.cypherdsl.core.Cypher import org.neo4j.cypherdsl.core.Parameter import org.neo4j.graphql.domain.fields.RelationField -import org.neo4j.graphql.driver.adapter.Neo4jAdapter.Dialect import java.util.concurrent.atomic.AtomicInteger data class QueryContext @JvmOverloads constructor( - var neo4jDialect: Dialect = Dialect.NEO4J_5, - val contextParams: Map? = emptyMap(), ) { diff --git a/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt b/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt index afb6a3bc..8dbff41f 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt @@ -13,8 +13,11 @@ import org.neo4j.graphql.domain.directives.Annotations.Companion.LIBRARY_DIRECTI import org.neo4j.graphql.domain.fields.RelationField import org.neo4j.graphql.driver.adapter.Neo4jAdapter import org.neo4j.graphql.handler.ConnectionResolver +import org.neo4j.graphql.handler.ImplementingTypeConnectionFieldResolver import org.neo4j.graphql.handler.ReadResolver import org.neo4j.graphql.scalars.BigIntScalar +import org.neo4j.graphql.scalars.DurationScalar +import org.neo4j.graphql.scalars.TemporalScalar import org.neo4j.graphql.schema.AugmentationContext import org.neo4j.graphql.schema.AugmentationHandler import org.neo4j.graphql.schema.model.outputs.InterfaceSelection @@ -95,6 +98,7 @@ class SchemaBuilder @JvmOverloads constructor( handler = mutableListOf( ReadResolver.Factory(ctx), ConnectionResolver.Factory(ctx), + ImplementingTypeConnectionFieldResolver.Factory(ctx) ) } @@ -266,6 +270,12 @@ class SchemaBuilder @JvmOverloads constructor( .forEach { (name, definition) -> val scalar = when (name) { Constants.BIG_INT -> BigIntScalar.INSTANCE + Constants.DATE -> TemporalScalar.DATE + Constants.TIME -> TemporalScalar.TIME + Constants.LOCAL_TIME -> TemporalScalar.LOCAL_TIME + Constants.DATE_TIME -> TemporalScalar.DATE_TIME + Constants.LOCAL_DATE_TIME -> TemporalScalar.LOCAL_DATE_TIME + Constants.DURATION -> DurationScalar.INSTANCE else -> GraphQLScalarType.newScalar() .name(name) .description( @@ -310,20 +320,11 @@ class SchemaBuilder @JvmOverloads constructor( neo4jAdapter: Neo4jAdapter, ) { codeRegistryBuilder.defaultDataFetcher { AliasPropertyDataFetcher() } - augmentedFields.forEach { augmentedField -> - val interceptedDataFetcher: DataFetcher<*> = DataFetcher { env -> - val neo4jDialect = neo4jAdapter.getDialect() - env.graphQlContext.setQueryContext(QueryContext(neo4jDialect = neo4jDialect)) - val (cypher, params, type, variable) = augmentedField.dataFetcher.get(env) - val result = neo4jAdapter.executeQuery(cypher, params) - return@DataFetcher if (type?.isList() == true) { - result.map { it[variable] } - } else { - result.map { it[variable] } - .firstOrNull() ?: emptyMap() - } - } - codeRegistryBuilder.dataFetcher(augmentedField.coordinates, interceptedDataFetcher) + augmentedFields.forEach { (coordinates, dataFetcher) -> + codeRegistryBuilder.dataFetcher(coordinates, DataFetcher { env -> + env.graphQlContext.put(Neo4jAdapter.CONTEXT_KEY, neo4jAdapter) + dataFetcher.get(env) + }) } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/domain/fields/PointField.kt b/core/src/main/kotlin/org/neo4j/graphql/domain/fields/PointField.kt index e1810b00..cf2ed16f 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/domain/fields/PointField.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/domain/fields/PointField.kt @@ -103,9 +103,9 @@ class PointField( enum class CoordinateType( internal val inputType: TypeName, - internal val selectionFactory: (IResolveTree) -> BasePointSelection + internal val selectionFactory: (IResolveTree) -> BasePointSelection<*> ) { - GEOGRAPHIC(Constants.Types.PointDistance, ::PointSelection), - CARTESIAN(Constants.Types.CartesianPointDistance, ::CartesianPointSelection) + GEOGRAPHIC(Constants.Types.PointDistance, PointSelection::parse), + CARTESIAN(Constants.Types.CartesianPointDistance, CartesianPointSelection::parse) } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/domain/naming/RelationshipBaseNames.kt b/core/src/main/kotlin/org/neo4j/graphql/domain/naming/RelationshipBaseNames.kt index c288c588..7f66e3cc 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/domain/naming/RelationshipBaseNames.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/domain/naming/RelationshipBaseNames.kt @@ -28,7 +28,7 @@ sealed class RelationshipBaseNames( val relationshipFieldTypename get() = "${prefixForTypenameWithInheritance}Relationship" - val connectionFieldName get() = "${prefixForTypenameWithInheritance}Connection" + val connectionFieldName get() = "${relationship.fieldName}Connection" fun getConnectionWhereTypename(target: ImplementingType) = "$prefixForTypenameWithInheritance${target.useNameIfFieldIsUnion()}ConnectionWhere" diff --git a/core/src/main/kotlin/org/neo4j/graphql/handler/BaseDataFetcher.kt b/core/src/main/kotlin/org/neo4j/graphql/handler/BaseDataFetcher.kt index 946e250d..e4518710 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/handler/BaseDataFetcher.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/handler/BaseDataFetcher.kt @@ -7,21 +7,20 @@ import org.neo4j.cypherdsl.core.Statement import org.neo4j.cypherdsl.core.renderer.Configuration import org.neo4j.cypherdsl.core.renderer.Dialect import org.neo4j.cypherdsl.core.renderer.Renderer -import org.neo4j.graphql.CypherDataFetcherResult import org.neo4j.graphql.SchemaConfig import org.neo4j.graphql.driver.adapter.Neo4jAdapter -import org.neo4j.graphql.queryContext +import org.neo4j.graphql.isList /** * This is a base class for the implementation of graphql data fetcher used in this project */ internal abstract class BaseDataFetcher(protected val schemaConfig: SchemaConfig) : - DataFetcher { + DataFetcher { - final override fun get(env: DataFetchingEnvironment): CypherDataFetcherResult { - val variable = "this" - val statement = generateCypher(variable, env) - val dialect = when (env.queryContext().neo4jDialect) { + final override fun get(env: DataFetchingEnvironment): Any { + val statement = generateCypher(env) + val neo4jAdapter = env.graphQlContext.get(Neo4jAdapter.CONTEXT_KEY) + val dialect = when (neo4jAdapter.getDialect()) { Neo4jAdapter.Dialect.NEO4J_4 -> Dialect.NEO4J_4 Neo4jAdapter.Dialect.NEO4J_5 -> Dialect.NEO4J_5 Neo4jAdapter.Dialect.NEO4J_5_23 -> Dialect.NEO4J_5_23 @@ -38,8 +37,19 @@ internal abstract class BaseDataFetcher(protected val schemaConfig: SchemaConfig val params = statement.catalog.parameters.mapValues { (_, value) -> (value as? VariableReference)?.let { env.variables[it.name] } ?: value } - return CypherDataFetcherResult(query, params, env.fieldDefinition.type, variable = variable) + + val result = neo4jAdapter.executeQuery(query, params) + return if (env.fieldDefinition.type?.isList() == true) { + result.map { it[RESULT_VARIABLE] } + } else { + result.map { it[RESULT_VARIABLE] } + .firstOrNull() ?: emptyMap() + } } - protected abstract fun generateCypher(variable: String, env: DataFetchingEnvironment): Statement + protected abstract fun generateCypher(env: DataFetchingEnvironment): Statement + + companion object { + const val RESULT_VARIABLE = "this" + } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/handler/ConnectionResolver.kt b/core/src/main/kotlin/org/neo4j/graphql/handler/ConnectionResolver.kt index 122708c0..503c9316 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/handler/ConnectionResolver.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/handler/ConnectionResolver.kt @@ -83,7 +83,7 @@ internal class ConnectionResolver private constructor( } } - override fun generateCypher(variable: String, env: DataFetchingEnvironment): Statement { + override fun generateCypher(env: DataFetchingEnvironment): Statement { val queryContext = env.queryContext() if (implementingType !is Node) { TODO() @@ -95,7 +95,7 @@ internal class ConnectionResolver private constructor( val input = InputArguments(node, resolveTree.args) - val dslNode = node.asCypherNode(queryContext, variable) + val dslNode = node.asCypherNode(queryContext, RESULT_VARIABLE) val ongoingReading = TopLevelMatchTranslator(schemaConfig, env.variables, queryContext) .translateTopLevelMatch( @@ -184,7 +184,7 @@ internal class ConnectionResolver private constructor( ) .with(edges, Cypher.size(edges).`as`(totalCount)) .withSubQueries(subQueries) - .returning(Cypher.mapOf(*topProjection.toTypedArray()).`as`(variable)) + .returning(Cypher.mapOf(*topProjection.toTypedArray()).`as`(RESULT_VARIABLE)) .build() } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/handler/ImplementingTypeConnectionFieldResolver.kt b/core/src/main/kotlin/org/neo4j/graphql/handler/ImplementingTypeConnectionFieldResolver.kt new file mode 100644 index 00000000..2a0f6197 --- /dev/null +++ b/core/src/main/kotlin/org/neo4j/graphql/handler/ImplementingTypeConnectionFieldResolver.kt @@ -0,0 +1,83 @@ +package org.neo4j.graphql.handler + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment +import graphql.schema.FieldCoordinates +import org.neo4j.graphql.Constants +import org.neo4j.graphql.domain.Entity +import org.neo4j.graphql.domain.ImplementingType +import org.neo4j.graphql.domain.fields.RelationBaseField +import org.neo4j.graphql.schema.AugmentationContext +import org.neo4j.graphql.schema.AugmentationHandler +import org.neo4j.graphql.schema.model.outputs.NodeConnectionEdgeFieldSelection +import org.neo4j.graphql.schema.model.outputs.NodeConnectionFieldSelection +import org.neo4j.graphql.schema.model.outputs.PageInfoSelection +import org.neo4j.graphql.utils.PagingUtils +import org.neo4j.graphql.utils.ResolveTree + +internal class ImplementingTypeConnectionFieldResolver( + private val relationBaseField: RelationBaseField +) : DataFetcher { + + class Factory(ctx: AugmentationContext) : AugmentationHandler(ctx), AugmentationHandler.EntityAugmentation { + + override fun augmentEntity(entity: Entity): List { + if (entity !is ImplementingType) { + return emptyList() + } + return entity.relationBaseFields.map { + AugmentedField( + FieldCoordinates.coordinates(entity.name, it.namings.connectionFieldName), + ImplementingTypeConnectionFieldResolver(it) + ) + } + } + } + + override fun get(env: DataFetchingEnvironment): Any { + val resolveTree = ResolveTree.resolve(env) + + val source = env.getSource>() ?: error("No source") + val connection = (source[resolveTree.aliasOrName] as? Map<*, *>) + ?.toMutableMap() + ?: error("No connection field ${resolveTree.aliasOrName} in source $source") + + val selection = NodeConnectionFieldSelection.parse(relationBaseField.connectionField, resolveTree) + + val first = env.getArgument(Constants.FIRST) + val after = env.getArgument(Constants.AFTER) + + val edges = connection[Constants.EDGES_FIELD] as List<*> + val totalCount = connection[Constants.TOTAL_COUNT] as Long + + val lastEdgeCursor = PagingUtils.getOffsetFromCursor(after) ?: -1 + val sliceStart = lastEdgeCursor + 1 + val sliceEnd = sliceStart + (first ?: edges.size) + + return selection.project { + field(NodeConnectionFieldSelection::edges) { + edges + .filterIsInstance>() + .mapIndexed { index, value -> + project { + lazyField(NodeConnectionEdgeFieldSelection::cursor) { PagingUtils.createCursor(sliceStart + index) } + allOf(value) + } + } + } + field(NodeConnectionFieldSelection::totalCount, totalCount) + field(NodeConnectionFieldSelection::pageInfo) { + project { + lazyField(PageInfoSelection::startCursor) { + if (edges.isEmpty()) null else PagingUtils.createCursor(sliceStart) + } + lazyField(PageInfoSelection::endCursor) { + if (edges.isEmpty()) null else PagingUtils.createCursor(sliceStart + edges.size - 1) + } + field(PageInfoSelection::hasNextPage, if (first != null) sliceEnd < totalCount else false) + field(PageInfoSelection::hasPreviousPage, sliceStart > 0) + } + } + } + } +} diff --git a/core/src/main/kotlin/org/neo4j/graphql/handler/ReadResolver.kt b/core/src/main/kotlin/org/neo4j/graphql/handler/ReadResolver.kt index af25cba5..cb582e9a 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/handler/ReadResolver.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/handler/ReadResolver.kt @@ -73,7 +73,7 @@ internal class ReadResolver internal constructor( } } - override fun generateCypher(variable: String, env: DataFetchingEnvironment): Statement { + override fun generateCypher(env: DataFetchingEnvironment): Statement { val queryContext = env.queryContext() val resolveTree = ResolveTree.resolve(env) @@ -82,7 +82,7 @@ internal class ReadResolver internal constructor( { node -> val input = InputArguments(node, resolveTree.args) - val dslNode = node.asCypherNode(queryContext, variable) + val dslNode = node.asCypherNode(queryContext, RESULT_VARIABLE) val optionsInput = input.options.merge(node) @@ -95,7 +95,6 @@ internal class ReadResolver internal constructor( additionalPredicates = null, ) - val projection = ProjectionTranslator() .createProjectionAndParams( node, @@ -114,10 +113,10 @@ internal class ReadResolver internal constructor( .build() }, { interfaze -> - createUnionRead(interfaze.implementations.values, resolveTree, interfaze, variable, queryContext) + createUnionRead(interfaze.implementations.values, resolveTree, interfaze, queryContext) }, { union -> - createUnionRead(union.nodes.values, resolveTree, union, variable, queryContext) + createUnionRead(union.nodes.values, resolveTree, union, queryContext) } ) } @@ -126,7 +125,6 @@ internal class ReadResolver internal constructor( nodes: Collection, resolveTree: ResolveTree, entity: Entity, - variable: String, queryContext: QueryContext ): ResultStatement { val input = InputArguments(entity, resolveTree.args) @@ -134,14 +132,14 @@ internal class ReadResolver internal constructor( val unionQueries = createUnionQueries( nodes, resolveTree, - Cypher.name(variable), + Cypher.name(RESULT_VARIABLE), queryContext, schemaConfig, input.where, { node -> Cypher.match(node) } ) - val returnVariable = Cypher.name(variable) + val returnVariable = Cypher.name(RESULT_VARIABLE) val ongoingReading: StatementBuilder.OngoingReading = when { unionQueries.size > 1 -> Cypher.call(Cypher.union(unionQueries)) @@ -151,7 +149,7 @@ internal class ReadResolver internal constructor( return ongoingReading .with(returnVariable) .applySortingSkipAndLimit(returnVariable, input.options.merge(entity as? ImplementingType), queryContext) - .returning(returnVariable.`as`(variable)) + .returning(returnVariable.`as`(RESULT_VARIABLE)) .build() } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/scalars/BigIntScalar.kt b/core/src/main/kotlin/org/neo4j/graphql/scalars/BigIntScalar.kt index a4f3f3fe..c7aa4b03 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/scalars/BigIntScalar.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/scalars/BigIntScalar.kt @@ -23,8 +23,8 @@ object BigIntScalar { override fun parseValue(input: Any, graphQLContext: GraphQLContext, locale: Locale): Number? { return when (input) { is StringValue -> input.value.toLong() - is FloatValue -> input.value - is IntValue -> input.value + is FloatValue -> input.value.toLong() + is IntValue -> input.value.toLong() is String -> input.toLong() is Float, is Int, is Long -> input as Number else -> Assert.assertShouldNeverHappen("Only string or number is expected") diff --git a/core/src/main/kotlin/org/neo4j/graphql/scalars/DurationScalar.kt b/core/src/main/kotlin/org/neo4j/graphql/scalars/DurationScalar.kt new file mode 100644 index 00000000..461f4b2a --- /dev/null +++ b/core/src/main/kotlin/org/neo4j/graphql/scalars/DurationScalar.kt @@ -0,0 +1,55 @@ +package org.neo4j.graphql.scalars + +import graphql.Assert +import graphql.GraphQLContext +import graphql.execution.CoercedVariables +import graphql.language.* +import graphql.schema.* +import org.neo4j.graphql.Constants +import java.time.Duration +import java.time.Period +import java.time.format.DateTimeParseException +import java.time.temporal.TemporalAmount +import java.util.* + +object DurationScalar { + + val INSTANCE: GraphQLScalarType = GraphQLScalarType.newScalar() + .name(Constants.DURATION) + .coercing(object : Coercing { + + private fun parse(value: String): TemporalAmount { + try { + return Duration.parse(value) + } catch (e: DateTimeParseException){ + return Period.parse(value) + } + } + + @Throws(CoercingSerializeException::class) + override fun serialize(dataFetcherResult: Any, graphQLContext: GraphQLContext, locale: Locale): String { + return dataFetcherResult.toString() + } + + @Throws(CoercingParseValueException::class) + override fun parseValue(input: Any, graphQLContext: GraphQLContext, locale: Locale): TemporalAmount? { + return when (input) { + is StringValue -> parse(input.value) + is String -> parse(input) + else -> Assert.assertShouldNeverHappen("Only string is expected") + } + } + + @Throws(CoercingParseLiteralException::class) + override fun parseLiteral( + input: Value<*>, + variables: CoercedVariables, + graphQLContext: GraphQLContext, + locale: Locale + ): TemporalAmount? { + return parseValue(input, graphQLContext, locale) + } + }) + .build() + +} diff --git a/core/src/main/kotlin/org/neo4j/graphql/scalars/TemporalScalar.kt b/core/src/main/kotlin/org/neo4j/graphql/scalars/TemporalScalar.kt new file mode 100644 index 00000000..3e12e095 --- /dev/null +++ b/core/src/main/kotlin/org/neo4j/graphql/scalars/TemporalScalar.kt @@ -0,0 +1,117 @@ +package org.neo4j.graphql.scalars + +import graphql.Assert +import graphql.GraphQLContext +import graphql.execution.CoercedVariables +import graphql.language.* +import graphql.schema.* +import org.neo4j.graphql.Constants +import java.time.* +import java.time.format.DateTimeFormatter +import java.time.format.DateTimeFormatterBuilder +import java.time.temporal.TemporalAccessor +import java.util.* + +class TemporalScalar private constructor(val transformer: (t: TemporalAccessor) -> T) : + Coercing { + + @Throws(CoercingSerializeException::class) + override fun serialize(dataFetcherResult: Any, graphQLContext: GraphQLContext, locale: Locale): String { + return dataFetcherResult.toString() + } + + @Throws(CoercingParseValueException::class) + override fun parseValue(input: Any, graphQLContext: GraphQLContext, locale: Locale): T? { + return when (input) { + is StringValue -> transformer(parse(input.value)) + is String -> transformer(parse(input)) + else -> Assert.assertShouldNeverHappen("Only string is expected") + } + } + + @Throws(CoercingParseLiteralException::class) + override fun parseLiteral( + input: Value<*>, + variables: CoercedVariables, + graphQLContext: GraphQLContext, + locale: Locale + ): T? { + return parseValue(input, graphQLContext, locale) + } + + + companion object { + private val OFFSET_DATE_TIME_FORMATTER = DateTimeFormatterBuilder() + .parseCaseInsensitive() + .append(DateTimeFormatter.ISO_LOCAL_DATE_TIME) + .appendZoneOrOffsetId() + .toFormatter() + private val TIME_WITH_ZONE_FORMATTER = DateTimeFormatterBuilder() + .parseCaseInsensitive() + .append(DateTimeFormatter.ISO_LOCAL_TIME) + .appendZoneOrOffsetId() + .toFormatter() + private val CUSTOM_OFFSET_DATE_TIME_FORMATTER = DateTimeFormatterBuilder() + .parseCaseInsensitive() + .append(DateTimeFormatter.ISO_LOCAL_DATE_TIME) + .appendPattern("Z") + .toFormatter() + + val DATE = createTemporalScalar(Constants.DATE) { LocalDate.from(it) } + val TIME = createTemporalScalar(Constants.TIME) { + val time = LocalTime.from(it) + val offset = try { + ZoneOffset.from(it) + } catch (e: Exception) { + ZoneOffset.UTC + } + OffsetTime.of(time, offset) + } + val LOCAL_TIME = createTemporalScalar(Constants.LOCAL_TIME) { LocalTime.from(it) } + val DATE_TIME = createTemporalScalar(Constants.DATE_TIME) { OffsetDateTime.from(it) } + val LOCAL_DATE_TIME = createTemporalScalar(Constants.LOCAL_DATE_TIME) { LocalDateTime.from(it) } + + fun parse(input: String): TemporalAccessor { + try { + return LocalDate.parse(input) + } catch (ignore: Exception) { + } + try { + return LocalTime.parse(input) + } catch (ignore: Exception) { + } + try { + return LocalDateTime.parse(input) + } catch (ignore: Exception) { + } + try { + return OffsetTime.parse(input, TIME_WITH_ZONE_FORMATTER) + } catch (ignore: Exception) { + } + try { + return OffsetDateTime.parse(input, OFFSET_DATE_TIME_FORMATTER) + } catch (ignore: Exception) { + } + try { + return OffsetDateTime.parse(input, CUSTOM_OFFSET_DATE_TIME_FORMATTER) + } catch (ignore: Exception) { + } + try { + return ZonedDateTime.parse(input) + } catch (ignore: Exception) { + } + error("Input string cannot be parsed to any known Temporal type: $input") + } + + private fun createTemporalScalar( + name: String, + transformer: (t: TemporalAccessor) -> T + ): GraphQLScalarType { + return GraphQLScalarType.newScalar() + .name(name) + .coercing(TemporalScalar(transformer)) + .build() + } + } + +} diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/AugmentationBase.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/AugmentationBase.kt index 10852659..21e556da 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/AugmentationBase.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/AugmentationBase.kt @@ -3,6 +3,7 @@ package org.neo4j.graphql.schema import graphql.language.FieldDefinition import graphql.language.InputValueDefinition import graphql.language.Type +import kotlin.reflect.KProperty1 interface AugmentationBase { @@ -18,6 +19,13 @@ interface AugmentationBase { return input.build() } + fun field( + name: KProperty1<*, *>, + type: Type<*>, + args: List? = emptyList(), + init: (FieldDefinition.Builder.() -> Unit)? = null + ): FieldDefinition = field(name.name, type, args, init) + fun field( name: String, type: Type<*>, diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/AugmentationHandler.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/AugmentationHandler.kt index 68501141..2fcbe67f 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/AugmentationHandler.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/AugmentationHandler.kt @@ -33,7 +33,7 @@ internal abstract class AugmentationHandler(val ctx: AugmentationContext) : Augm internal data class AugmentedField( val coordinates: FieldCoordinates, - val dataFetcher: DataFetcher, + val dataFetcher: DataFetcher<*>, ) fun addQueryField( diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/inputs/options/OptionsInput.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/inputs/options/OptionsInput.kt index fa06924b..89df2e96 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/inputs/options/OptionsInput.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/inputs/options/OptionsInput.kt @@ -10,6 +10,7 @@ import org.neo4j.graphql.domain.directives.LimitDirective import org.neo4j.graphql.schema.AugmentationBase import org.neo4j.graphql.schema.AugmentationContext import org.neo4j.graphql.schema.model.inputs.Dict +import org.neo4j.graphql.utils.PagingUtils data class OptionsInput( val limit: Int? = null, @@ -66,10 +67,9 @@ data class OptionsInput( ) = OptionsInput( map.nestedObject(limitName) as? Int, when (offsetName) { - Constants.AFTER -> (map.nestedObject(offsetName) as? String)?.let { - TODO("implement navigation by cursor") - } - + Constants.AFTER -> (map.nestedObject(offsetName) as? String) + ?.let { PagingUtils.getOffsetFromCursor(it) } + ?.let { it + 1 } else -> map.nestedObject(offsetName) as? Int }, if (sortFactory == null) emptyList() else map.nestedDictList(sortName).map { sortFactory(it) } diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/BaseSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/BaseSelection.kt new file mode 100644 index 00000000..07b24890 --- /dev/null +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/BaseSelection.kt @@ -0,0 +1,49 @@ +package org.neo4j.graphql.schema.model.outputs + +import org.neo4j.graphql.utils.IResolveTree +import kotlin.reflect.KProperty1 + +open class BaseSelection>( + val selection: IResolveTree, +) : IResolveTree by selection { + + + inline fun project(projection: ProjectionBuilder.() -> Unit): Map { + val result = mutableMapOf() + val selection = (this as? R + ?: throw ClassCastException("Cannot cast ${this::class.simpleName} to ${R::class.simpleName}")) + projection(ProjectionBuilder(selection, result)) + return result + } + + inner class ProjectionBuilder(val selection: T, val result: MutableMap) { + + fun field(prop: KProperty1>, value: Any?) { + prop.get(selection).forEach { field -> result[field.aliasOrName] = value } + } + + fun lazyField(prop: KProperty1>, value: () -> Any?) { + prop.get(selection).forEach { field -> result[field.aliasOrName] = value() } + } + + fun allOf(value: Map<*, *>) { + value.forEach { (k, v) -> if (k is String) result[k] = v } + } + + fun > field( + prop: KProperty1>>, + nestedProjection: BaseSelection.() -> Any? + ) { + prop.get(selection).forEach { field -> result[field.aliasOrName] = nestedProjection(field) } + } + +// fun > field(prop: KProperty1>>, value: BaseSelection.() -> Unit) { +// prop.get(selection).forEach { field -> result[field.aliasOrName] = value() } +// } + +// fun project(value: BaseSelection<*>.() -> Any?) { +// prop.get(selection).forEach { field -> result[field.aliasOrName] = value(BaseSelection()) } +// } + } + +} diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/FieldContainerSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/FieldContainerSelection.kt index 005b7ea2..1f3e5716 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/FieldContainerSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/FieldContainerSelection.kt @@ -10,7 +10,7 @@ import org.neo4j.graphql.schema.model.inputs.field_arguments.ConnectionFieldInpu import org.neo4j.graphql.schema.model.inputs.field_arguments.RelationFieldInputArgs import org.neo4j.graphql.wrapLike -sealed class FieldContainerSelection { +sealed interface FieldContainerSelection { object Augmentation : AugmentationBase { diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/InterfaceSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/InterfaceSelection.kt index e19f4d79..b75a43e3 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/InterfaceSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/InterfaceSelection.kt @@ -4,7 +4,7 @@ import org.neo4j.graphql.asType import org.neo4j.graphql.domain.Interface import org.neo4j.graphql.schema.AugmentationContext -data object InterfaceSelection : FieldContainerSelection() { +data object InterfaceSelection : FieldContainerSelection { object Augmentation { diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeConnectionEdgeFieldSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeConnectionEdgeFieldSelection.kt index d7e47d5c..f958d9cf 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeConnectionEdgeFieldSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeConnectionEdgeFieldSelection.kt @@ -1,30 +1,39 @@ package org.neo4j.graphql.schema.model.outputs -import org.neo4j.graphql.* +import org.neo4j.graphql.Constants +import org.neo4j.graphql.NonNull +import org.neo4j.graphql.asDescription +import org.neo4j.graphql.asRequiredType import org.neo4j.graphql.domain.RelationshipProperties import org.neo4j.graphql.domain.fields.ConnectionField import org.neo4j.graphql.schema.AugmentationBase import org.neo4j.graphql.schema.AugmentationContext +import org.neo4j.graphql.utils.IResolveTree -data object NodeConnectionEdgeFieldSelection : FieldContainerSelection() { +class NodeConnectionEdgeFieldSelection( + selection: IResolveTree, + val cursor: List, + val node: List, + val properties: List, +) : BaseSelection(selection), FieldContainerSelection { object Augmentation : AugmentationBase { fun generateRelationshipSelection(field: ConnectionField, ctx: AugmentationContext): String = ctx.getOrCreateObjectType(field.relationshipField.namings.relationshipFieldTypename) { fields, _ -> - fields += field(Constants.CURSOR_FIELD, Constants.Types.String.makeRequired()) + fields += field(NodeConnectionEdgeFieldSelection::cursor, Constants.Types.String.NonNull) field.relationshipField.extractOnTarget( onNode = { NodeSelection.Augmentation.generateNodeSelection(it, ctx) }, onInterface = { InterfaceSelection.Augmentation.generateInterfaceSelection(it, ctx) }, onUnion = { it.name } )?.let { - fields += field(Constants.NODE_FIELD, it.asType(required = true)) + fields += field(NodeConnectionEdgeFieldSelection::node, it.asRequiredType()) } field.properties?.let { generateEdgeRelationshipSelection(it, ctx) } - ?.let { fields += field(Constants.PROPERTIES_FIELD, it.asRequiredType()) } + ?.let { fields += field(NodeConnectionEdgeFieldSelection::properties, it.asRequiredType()) } } ?: throw IllegalStateException("Expected ${field.relationshipField.namings.relationshipFieldTypename} to have fields") @@ -53,4 +62,17 @@ data object NodeConnectionEdgeFieldSelection : FieldContainerSelection() { } } + + companion object { + + fun parse(field: ConnectionField, selection: IResolveTree): NodeConnectionEdgeFieldSelection { + val typeName = field.relationshipField.namings.relationshipFieldTypename + return NodeConnectionEdgeFieldSelection( + selection, + selection.getFieldOfType(typeName, NodeConnectionEdgeFieldSelection::cursor), + selection.getFieldOfType(typeName, NodeConnectionEdgeFieldSelection::node), + selection.getFieldOfType(typeName, NodeConnectionEdgeFieldSelection::properties), + ) + } + } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeConnectionFieldSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeConnectionFieldSelection.kt index 24d79e17..74d80a3e 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeConnectionFieldSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeConnectionFieldSelection.kt @@ -4,8 +4,14 @@ import org.neo4j.graphql.* import org.neo4j.graphql.domain.fields.ConnectionField import org.neo4j.graphql.schema.AugmentationBase import org.neo4j.graphql.schema.AugmentationContext +import org.neo4j.graphql.utils.IResolveTree -class NodeConnectionFieldSelection { +class NodeConnectionFieldSelection( + selection: IResolveTree, + val edges: List, + val pageInfo: List, + val totalCount: List, +) : BaseSelection(selection) { object Augmentation : AugmentationBase { @@ -17,12 +23,34 @@ class NodeConnectionFieldSelection { // TODO should we use this instead? .generateRelationshipSelection(field.interfaceField as? ConnectionField ?: field, ctx) // .generateRelationshipSelection(field, ctx) - .let { fields += field(Constants.EDGES_FIELD, it.asRequiredType().List.NonNull) } + .let { fields += field(NodeConnectionFieldSelection::edges, it.asRequiredType().List.NonNull) } - fields += field(Constants.TOTAL_COUNT, Constants.Types.Int.NonNull) - fields += field(Constants.PAGE_INFO, Constants.Types.PageInfo.NonNull) + fields += field(NodeConnectionFieldSelection::totalCount, Constants.Types.Int.NonNull) + fields += field( + NodeConnectionFieldSelection::pageInfo, + PageInfoSelection.Augmentation.generateNodeSelection(ctx).NonNull + ) } ?: throw IllegalStateException("Expected ${field.type.name()} to have fields") } + + companion object { + + fun parse(field: ConnectionField, selection: IResolveTree): NodeConnectionFieldSelection { + val typeName = field.relationshipField.namings.connectionFieldTypename + return NodeConnectionFieldSelection( + selection, + selection.getFieldOfType( + typeName, + NodeConnectionFieldSelection::edges + ) { NodeConnectionEdgeFieldSelection.parse(field, it) }, + selection.getFieldOfType( + typeName, + NodeConnectionFieldSelection::pageInfo + ) { PageInfoSelection.parse(it) }, + selection.getFieldOfType(typeName, NodeConnectionFieldSelection::totalCount), + ) + } + } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeSelection.kt index 75c9e27c..347d6f72 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/NodeSelection.kt @@ -7,7 +7,7 @@ import org.neo4j.graphql.domain.Node import org.neo4j.graphql.schema.AugmentationBase import org.neo4j.graphql.schema.AugmentationContext -data object NodeSelection : FieldContainerSelection() { +data object NodeSelection : FieldContainerSelection { object Augmentation : AugmentationBase { diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/PageInfoSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/PageInfoSelection.kt new file mode 100644 index 00000000..6676c1de --- /dev/null +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/PageInfoSelection.kt @@ -0,0 +1,43 @@ +package org.neo4j.graphql.schema.model.outputs + +import org.neo4j.graphql.Constants +import org.neo4j.graphql.NonNull +import org.neo4j.graphql.schema.AugmentationBase +import org.neo4j.graphql.schema.AugmentationContext +import org.neo4j.graphql.utils.IResolveTree + +class PageInfoSelection( + selection: IResolveTree, + val startCursor: List, + val endCursor: List, + val hasNextPage: List, + val hasPreviousPage: List, +) : BaseSelection(selection) { + + + object Augmentation : AugmentationBase { + + fun generateNodeSelection(ctx: AugmentationContext) = + ctx.getOrCreateObjectType(TYPE_NAME) { fields, _ -> + fields += field(PageInfoSelection::startCursor, Constants.Types.String) + fields += field(PageInfoSelection::endCursor, Constants.Types.String) + fields += field(PageInfoSelection::hasNextPage, Constants.Types.Boolean.NonNull) + fields += field(PageInfoSelection::hasPreviousPage, Constants.Types.Boolean.NonNull) + }!! + } + + companion object { + val TYPE_NAME = Constants.Types.PageInfo.name + + fun parse(selection: IResolveTree): PageInfoSelection { + return PageInfoSelection( + selection, + selection.getFieldOfType(TYPE_NAME, PageInfoSelection::startCursor), + selection.getFieldOfType(TYPE_NAME, PageInfoSelection::endCursor), + selection.getFieldOfType(TYPE_NAME, PageInfoSelection::hasNextPage), + selection.getFieldOfType(TYPE_NAME, PageInfoSelection::hasPreviousPage), + ) + } + } + +} diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/BasePointSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/BasePointSelection.kt index 9ed3decd..1ab18b69 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/BasePointSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/BasePointSelection.kt @@ -1,18 +1,24 @@ package org.neo4j.graphql.schema.model.outputs.point import org.neo4j.cypherdsl.core.Expression -import org.neo4j.graphql.Constants +import org.neo4j.graphql.schema.model.outputs.BaseSelection import org.neo4j.graphql.utils.IResolveTree -sealed class BasePointSelection(val selection: IResolveTree) { +sealed class BasePointSelection>( + val typeName: String, + selection: IResolveTree, + val crs: List, + val srid: List, +): BaseSelection(selection) { - val crs = selection.getFieldOfType(Constants.POINT_TYPE, Constants.CRS) + protected open val relevantFields = listOf( + BasePointSelection<*>::crs, + BasePointSelection<*>::srid) + .map { it.name } + .toSet() - val srid = selection.getFieldOfType(Constants.POINT_TYPE, Constants.SRID) - - protected open val relevantFields = setOf(Constants.CRS, Constants.SRID) - fun project(prop: Expression): List? = selection - .fieldsByTypeName[Constants.POINT_TYPE] + fun cypherProject(prop: Expression): List? = selection + .fieldsByTypeName[typeName] ?.values ?.filter { relevantFields.contains(it.name) } ?.flatMap { diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/CartesianPointSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/CartesianPointSelection.kt index d424f6df..d5b2ec40 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/CartesianPointSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/CartesianPointSelection.kt @@ -6,19 +6,26 @@ import org.neo4j.graphql.Constants import org.neo4j.graphql.asCypherLiteral import org.neo4j.graphql.utils.IResolveTree -class CartesianPointSelection(selection: IResolveTree) : BasePointSelection(selection) { +class CartesianPointSelection( + selection: IResolveTree, + crs: List, + srid: List, + val x: List, + val y: List, + val z: List, +) : BasePointSelection(TYPE_NAME, selection, crs, srid) { - val x = selection.getFieldOfType(Constants.POINT_TYPE, Constants.X) + override val relevantFields = + super.relevantFields + listOf( + CartesianPointSelection::x, + CartesianPointSelection::y, + CartesianPointSelection::z + ).map { it.name } - val y = selection.getFieldOfType(Constants.POINT_TYPE, Constants.Y) - - val z = selection.getFieldOfType(Constants.POINT_TYPE, Constants.Z) - - override val relevantFields = super.relevantFields + setOf(Constants.X, Constants.Y, Constants.Z) override fun ensureValidity(name: String, point: Expression): Expression { - return if (name == Constants.Z) { + return if (name == CartesianPointSelection::z.name) { Cypher.caseExpression().`when`( - point.property(Constants.SRID) + point.property(BasePointSelection<*>::srid.name) .isEqualTo(Constants.SpatialReferenceIdentifier.cartesian_3D.asCypherLiteral()) ) .then(point.property(name)) @@ -27,4 +34,20 @@ class CartesianPointSelection(selection: IResolveTree) : BasePointSelection(sele point.property(name) } } + + companion object { + + val TYPE_NAME = Constants.Types.CARTESIAN_POINT.name + + fun parse(selection: IResolveTree): CartesianPointSelection { + return CartesianPointSelection( + selection, + selection.getFieldOfType(TYPE_NAME, CartesianPointSelection::crs), + selection.getFieldOfType(TYPE_NAME, CartesianPointSelection::srid), + selection.getFieldOfType(TYPE_NAME, CartesianPointSelection::x), + selection.getFieldOfType(TYPE_NAME, CartesianPointSelection::y), + selection.getFieldOfType(TYPE_NAME, CartesianPointSelection::z), + ) + } + } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/PointSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/PointSelection.kt index 93b7e6d1..bbbadbfa 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/PointSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/point/PointSelection.kt @@ -6,21 +6,26 @@ import org.neo4j.graphql.Constants import org.neo4j.graphql.asCypherLiteral import org.neo4j.graphql.utils.IResolveTree -class PointSelection(selection: IResolveTree) : BasePointSelection(selection) { - - val longitude = selection.getFieldOfType(Constants.POINT_TYPE, Constants.LONGITUDE) - - val latitude = selection.getFieldOfType(Constants.POINT_TYPE, Constants.LATITUDE) - - val height = selection.getFieldOfType(Constants.POINT_TYPE, Constants.HEIGHT) +class PointSelection( + selection: IResolveTree, + crs: List, + srid: List, + val longitude: List, + val latitude: List, + val height: List, +) : BasePointSelection(TYPE_NAME, selection, crs, srid) { override val relevantFields = - super.relevantFields + setOf(Constants.LONGITUDE, Constants.LATITUDE, Constants.HEIGHT) + super.relevantFields + listOf( + PointSelection::longitude, + PointSelection::latitude, + PointSelection::height + ).map { it.name } override fun ensureValidity(name: String, point: Expression): Expression { - return if (name == Constants.HEIGHT) { + return if (name == PointSelection::height.name) { Cypher.caseExpression().`when`( - point.property(Constants.SRID) + point.property(BasePointSelection<*>::srid.name) .isEqualTo(Constants.SpatialReferenceIdentifier.wgs_84_3D.asCypherLiteral()) ) .then(point.property(name)) @@ -29,4 +34,20 @@ class PointSelection(selection: IResolveTree) : BasePointSelection(selection) { point.property(name) } } + + companion object { + + val TYPE_NAME = Constants.Types.POINT.name + + fun parse(selection: IResolveTree): PointSelection { + return PointSelection( + selection, + selection.getFieldOfType(TYPE_NAME, PointSelection::crs), + selection.getFieldOfType(TYPE_NAME, PointSelection::srid), + selection.getFieldOfType(TYPE_NAME, PointSelection::longitude), + selection.getFieldOfType(TYPE_NAME, PointSelection::latitude), + selection.getFieldOfType(TYPE_NAME, PointSelection::height), + ) + } + } } diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/root_connection/RootNodeConnectionSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/root_connection/RootNodeConnectionSelection.kt index e74b83d9..58e7d9fa 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/root_connection/RootNodeConnectionSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/root_connection/RootNodeConnectionSelection.kt @@ -6,6 +6,7 @@ import org.neo4j.graphql.NonNull import org.neo4j.graphql.domain.ImplementingType import org.neo4j.graphql.schema.AugmentationBase import org.neo4j.graphql.schema.AugmentationContext +import org.neo4j.graphql.schema.model.outputs.PageInfoSelection class RootNodeConnectionSelection { @@ -21,7 +22,7 @@ class RootNodeConnectionSelection { .let { fields += field(Constants.EDGES_FIELD, it.NonNull.List.NonNull) } fields += field(Constants.TOTAL_COUNT, Constants.Types.Int.NonNull) - fields += field(Constants.PAGE_INFO, Constants.Types.PageInfo.NonNull) + fields += field(Constants.PAGE_INFO, PageInfoSelection.Augmentation.generateNodeSelection(ctx).NonNull) } ?: throw IllegalStateException("Expected $name to have fields") } diff --git a/core/src/main/kotlin/org/neo4j/graphql/translate/connection_clause/CreateConnectionClause.kt b/core/src/main/kotlin/org/neo4j/graphql/translate/connection_clause/CreateConnectionClause.kt index d524c3ce..c661ee0e 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/translate/connection_clause/CreateConnectionClause.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/translate/connection_clause/CreateConnectionClause.kt @@ -329,7 +329,7 @@ private fun createEdgeProjection( val nodeSortProperties = args.options.sort.flatMap { it.node?.keys ?: emptyList() } if (edgeSortProperties.isNotEmpty() || nodeSortProperties.isNotEmpty()) { adjustedResolveTree = adjustedResolveTree.extend { - select(Constants.EDGES_FIELD, field.relationshipField.namings.connectionFieldName) { + select(Constants.EDGES_FIELD, field.relationshipField.namings.connectionFieldTypename) { if (edgeSortProperties.isNotEmpty()) { select(Constants.PROPERTIES_FIELD, field.relationshipField.namings.relationshipFieldTypename) { edgeSortProperties.forEach { name -> @@ -348,7 +348,7 @@ private fun createEdgeProjection( } } - val connection = adjustedResolveTree.fieldsByTypeName[field.relationshipField.namings.connectionFieldName] + val connection = adjustedResolveTree.fieldsByTypeName[field.relationshipField.namings.connectionFieldTypename] ?: return ProjectionTranslator.Projection.EMPTY connection.forEachField(Constants.EDGES_FIELD) { edges -> diff --git a/core/src/main/kotlin/org/neo4j/graphql/translate/projection/ProjectScalarField.kt b/core/src/main/kotlin/org/neo4j/graphql/translate/projection/ProjectScalarField.kt index d909cf9d..06b52f5d 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/translate/projection/ProjectScalarField.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/translate/projection/ProjectScalarField.kt @@ -29,13 +29,13 @@ fun projectScalarField( val projectionVar = queryContext.getNextVariable("p_var") Cypher.listWith(projectionVar).`in`(property).returning( pointSelection - .project(projectionVar) + .cypherProject(projectionVar) ?.let { Cypher.mapOf(*it.toTypedArray()) } ?: error("expected at leas one selected field") ) } else { pointSelection - .project(property) + .cypherProject(property) ?.let { Cypher.mapOf(*it.toTypedArray()) } ?: error("expected at leas one selected field") } diff --git a/core/src/main/kotlin/org/neo4j/graphql/translate/where/CreateWhere.kt b/core/src/main/kotlin/org/neo4j/graphql/translate/where/CreateWhere.kt index be56d0f0..571e3d20 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/translate/where/CreateWhere.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/translate/where/CreateWhere.kt @@ -40,7 +40,10 @@ fun createWhere( val nodes = field.extractOnTarget( { node -> listOf(node) }, { interfaze -> interfaze.implementations.values }, - { union -> union.nodes.values } + { union -> + val dataPerNode = (predicate.where as WhereInput.UnionWhereInput).dataPerNode + if (dataPerNode.isEmpty()) union.nodes.values else dataPerNode.keys + } ) var allConditions: Condition? = null diff --git a/core/src/main/kotlin/org/neo4j/graphql/utils/InvalidCursorException.kt b/core/src/main/kotlin/org/neo4j/graphql/utils/InvalidCursorException.kt new file mode 100644 index 00000000..5dcb2ff8 --- /dev/null +++ b/core/src/main/kotlin/org/neo4j/graphql/utils/InvalidCursorException.kt @@ -0,0 +1,4 @@ +package org.neo4j.graphql.utils + +class InvalidCursorException internal constructor(message: String?, cause: Throwable? = null) : + RuntimeException(message, cause) diff --git a/core/src/main/kotlin/org/neo4j/graphql/utils/PagingUtils.kt b/core/src/main/kotlin/org/neo4j/graphql/utils/PagingUtils.kt new file mode 100644 index 00000000..d68e5489 --- /dev/null +++ b/core/src/main/kotlin/org/neo4j/graphql/utils/PagingUtils.kt @@ -0,0 +1,34 @@ +package org.neo4j.graphql.utils + +import java.nio.charset.StandardCharsets +import java.util.* + +object PagingUtils { + const val PREFIX = "arrayconnection:" + + fun createCursor(offset: Int): String { + val bytes: ByteArray = (PREFIX + offset.toString()).toByteArray(StandardCharsets.UTF_8) + return Base64.getEncoder().encodeToString(bytes) + } + + fun getOffsetFromCursor(cursor: String?): Int? { + if (cursor == null) { + return null + } + val decode: ByteArray + try { + decode = Base64.getDecoder().decode(cursor) + } catch (e: IllegalArgumentException) { + throw InvalidCursorException(String.format("The cursor is not in base64 format : '%s'", cursor), e) + } + val string = String(decode, StandardCharsets.UTF_8) + if (PREFIX.length > string.length) { + throw InvalidCursorException(String.format("The cursor prefix is missing from the cursor : '%s'", cursor)) + } + try { + return string.substring(PREFIX.length).toInt() + } catch (nfe: NumberFormatException) { + throw InvalidCursorException(String.format("The cursor was not created by this class : '%s'", cursor), nfe) + } + } +} diff --git a/core/src/main/kotlin/org/neo4j/graphql/utils/ResolveTree.kt b/core/src/main/kotlin/org/neo4j/graphql/utils/ResolveTree.kt index 74c14151..f8d016e9 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/utils/ResolveTree.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/utils/ResolveTree.kt @@ -5,6 +5,7 @@ import graphql.schema.DataFetchingFieldSelectionSet import graphql.schema.SelectedField import org.neo4j.graphql.aliasOrName import org.neo4j.graphql.schema.model.inputs.Dict +import kotlin.reflect.KProperty1 interface IResolveTree { val name: String @@ -16,6 +17,12 @@ interface IResolveTree { fun getFieldOfType(typeName: String, fieldName: String) = this.fieldsByTypeName[typeName]?.values?.filter { it.name == fieldName } ?: emptyList() + + fun getFieldOfType(typeName: String, fieldName: KProperty1<*, List>): List = + getFieldOfType(typeName, fieldName) { it } + + fun getFieldOfType(typeName: String, fieldName: KProperty1<*, List>, transformer: (IResolveTree)-> T): List = + getFieldOfType(typeName, fieldName.name).map(transformer) } class SelectionOfType( diff --git a/core/src/main/resources/lib_directives.graphql b/core/src/main/resources/lib_directives.graphql index 49ba139e..a13d124f 100644 --- a/core/src/main/resources/lib_directives.graphql +++ b/core/src/main/resources/lib_directives.graphql @@ -39,6 +39,14 @@ directive @limit( max: Int ) on OBJECT | INTERFACE + +"Instructs neo4j-graphql-java to exclude create, delete or update operations from the mutation root type." +directive @mutation( + "Describe operations available for this type" + operations: [MutationFields!]! = [ DELETE ] +) on OBJECT | INTERFACE + + "Informs neo4j-graphql-java of node metadata" directive @node( "The labels to map this GraphQL type to in the Neo4j database", @@ -110,3 +118,7 @@ input LimitInput { "Maximum limit to be used for queries." max: Int } + +enum MutationFields { + DELETE +} diff --git a/core/src/main/resources/neo4j_types.graphql b/core/src/main/resources/neo4j_types.graphql index f9e6ad2a..7662fc42 100644 --- a/core/src/main/resources/neo4j_types.graphql +++ b/core/src/main/resources/neo4j_types.graphql @@ -6,14 +6,6 @@ enum SortDirection { DESC } -#Pagination information (Relay) -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - "A point in a coordinate system." type Point { """ diff --git a/core/src/test/kotlin/org/neo4j/graphql/CypherTests.kt b/core/src/test/kotlin/org/neo4j/graphql/CypherTests.kt index 88eddba8..61aca7cb 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/CypherTests.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/CypherTests.kt @@ -1,7 +1,6 @@ package org.neo4j.graphql -import apoc.coll.Coll -import apoc.cypher.CypherFunctions +import apoc.date.Date import demo.org.neo4j.graphql.utils.TestUtils.createTestsInPath import org.junit.jupiter.api.* import org.neo4j.graphql.utils.CypherTestSuite @@ -19,10 +18,7 @@ class CypherTests { if (INTEGRATION_TESTS) { neo4j = Neo4jBuilders .newInProcessBuilder(Path.of("target/test-db")) - .withProcedure(apoc.cypher.Cypher::class.java) - .withFunction(CypherFunctions::class.java) - .withProcedure(Coll::class.java) - .withFunction(Coll::class.java) + .withFunction(Date::class.java) .build() } } @@ -89,6 +85,10 @@ class CypherTests { fun `new cypher tck tests v2`() = createTestsInPath("tck-test-files/cypher/v2", { CypherTestSuite(it, neo4j).generateTests() }) + @TestFactory + fun `integration-tests`() = + createTestsInPath("integration-test-files", { CypherTestSuite(it, neo4j, createMissingBlocks = false).generateTests() }) + companion object { private val INTEGRATION_TESTS = System.getProperty("neo4j-graphql-java.integration-tests", "false") == "true" } diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt index 5be2bbd0..43c05417 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt @@ -1,6 +1,7 @@ package org.neo4j.graphql.utils import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.module.kotlin.registerKotlinModule import com.intellij.rt.execution.junit.FileComparisonFailure import demo.org.neo4j.graphql.utils.asciidoc.AsciiDocParser @@ -21,6 +22,7 @@ import kotlin.reflect.KMutableProperty1 abstract class AsciiDocTestSuite( private val fileName: String, private val relevantBlocks: List>, + private val createMissingBlocks: Boolean = true ) { abstract class CodeBlockMatcher( @@ -188,7 +190,7 @@ abstract class AsciiDocTestSuite( headline: String, attributes: Map = emptyMap() ): CodeBlock? { - if (!GENERATE_TEST_FILE_DIFF && !UPDATE_TEST_FILE) { + if (!createMissingBlocks || (!GENERATE_TEST_FILE_DIFF && !UPDATE_TEST_FILE)) { return null } val codeBlock = CodeBlock(insertPoint.uri, language, insertPoint.parent, attributes) @@ -211,7 +213,10 @@ abstract class AsciiDocTestSuite( val UPDATE_TEST_FILE = System.getProperty("neo4j-graphql-java.update-test-file", "false") == "true" val UPDATE_SEMANTIC_EQUALLY_BLOCKS = System.getProperty("neo4j-graphql-java.update-semantic-equally-blocks", "false") == "true" - val MAPPER = ObjectMapper().registerKotlinModule() + val MAPPER = ObjectMapper() + .registerKotlinModule() + .registerModules(JavaTimeModule()) + .disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) fun String.parseJsonMap(): Map = this.let { @Suppress("UNCHECKED_CAST") diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt index 0bee84b6..d31859d2 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt @@ -1,8 +1,9 @@ package org.neo4j.graphql.utils +import demo.org.neo4j.graphql.utils.InvalidQueryException import demo.org.neo4j.graphql.utils.asciidoc.ast.CodeBlock import demo.org.neo4j.graphql.utils.asciidoc.ast.Section -import demo.org.neo4j.graphql.utils.InvalidQueryException +import graphql.ExceptionWhileDataFetching import graphql.ExecutionInput import graphql.GraphQL import graphql.GraphQLError @@ -24,29 +25,33 @@ import org.neo4j.graphql.QueryContext import org.neo4j.graphql.SchemaBuilder import org.neo4j.graphql.SchemaConfig import org.neo4j.graphql.driver.adapter.Neo4jAdapter +import org.neo4j.graphql.scalars.TemporalScalar import org.neo4j.harness.Neo4j import org.opentest4j.AssertionFailedError import java.math.BigInteger import java.time.* import java.time.format.DateTimeFormatter import java.time.format.DateTimeParseException +import java.time.temporal.TemporalAccessor import java.util.* import java.util.concurrent.FutureTask import java.util.function.Consumer import java.util.regex.Matcher import java.util.regex.Pattern -class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null) : AsciiDocTestSuite( - fileName, - listOf( - matcher("cypher", exactly = true) { t, c -> t.cypher.add(c) }, - matcher("json", exactly = true) { t, c -> t.cypherParams.add(c) }, - matcher("graphql", exactly = true, setter = TestCase::graphqlRequest), - matcher("json", mapOf("request" to "true"), setter = TestCase::graphqlRequestVariables), - matcher("json", mapOf("response" to "true"), setter = TestCase::graphqlResponse), - matcher("json", mapOf("query-config" to "true"), setter = TestCase::queryConfig), - ) -) { +class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingBlocks: Boolean = true) : + AsciiDocTestSuite( + fileName, + listOf( + matcher("cypher", exactly = true) { t, c -> t.cypher.add(c) }, + matcher("json", exactly = true) { t, c -> t.cypherParams.add(c) }, + matcher("graphql", exactly = true, setter = TestCase::graphqlRequest), + matcher("json", mapOf("request" to "true"), setter = TestCase::graphqlRequestVariables), + matcher("json", mapOf("response" to "true"), setter = TestCase::graphqlResponse), + matcher("json", mapOf("query-config" to "true"), setter = TestCase::queryConfig), + ), + createMissingBlocks, + ) { data class TestCase( var schema: CodeBlock, @@ -224,7 +229,8 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null) : AsciiDocTest DynamicTest.dynamicTest(name, cypherBlock.uri) { val renderer = Renderer.getRenderer(RENDER_OPTIONS) val cypher = cypherBlock.content - val expectedNormalized = renderer.render(CypherParser.parse(cypher, PARSE_OPTIONS)) + val expectedNormalized = + if (cypher.isNotBlank()) renderer.render(CypherParser.parse(cypher, PARSE_OPTIONS)) else "" val actual = (result().getOrNull(index)?.query ?: throw IllegalStateException("missing cypher query for $title ($index)")) val actualNormalized = renderer.render(CypherParser.parse(actual, PARSE_OPTIONS)) @@ -299,31 +305,6 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null) : AsciiDocTest } } - private fun setupNeo4jAdapter(testData: CodeBlock?): Neo4jAdapter { - return object : Neo4jAdapter { - override fun executeQuery(cypher: String, params: Map): List> { - if (neo4j == null) { - return emptyList() - } - val db = neo4j.defaultDatabaseService() - - // cleanup the database - db.executeTransactionally("MATCH (n) DETACH DELETE n") - - // load the test data - testData?.content - ?.split(";") - ?.filter { it.isNotBlank() } - ?.forEach { db.executeTransactionally(it) } - - // execute the query - return db.executeTransactionally(cypher, params) { result -> - result.stream().toList() - } - } - } - } - private fun integrationTest( title: String, testCase: TestCase, @@ -332,11 +313,31 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null) : AsciiDocTest ?: error("missing graphql response for $title") return DynamicTest.dynamicTest("Integration Test", graphqlResponse.uri) { - val neo4jAdapter = setupNeo4jAdapter(testCase.testData.firstOrNull()) + val neo4jAdapter = when { + neo4j != null -> { + val database = neo4j.defaultDatabaseService() + database.executeTransactionally("MATCH (n) DETACH DELETE n") + // load the test data + testCase.testData.firstOrNull()?.content + ?.split(";") + ?.filter { it.isNotBlank() } + ?.forEach { database.executeTransactionally(it) } + object : Neo4jAdapter { + override fun executeQuery(cypher: String, params: Map): List> { + // execute the query + return database.executeTransactionally(cypher, params) { it.stream().toList() } + } + } + } + + else -> Neo4jAdapter.NO_OP + } + val request = testCase.graphqlRequest?.content ?: error("missing graphql for $title") - val requestParams = testCase.graphqlRequestVariables?.content?.parseJsonMap() ?: emptyMap() + val requestParams = + testCase.graphqlRequestVariables?.content?.parseJsonMap() ?: emptyMap() val queryContext = testCase.queryConfig?.content ?.let { config -> return@let MAPPER.readValue(config, QueryContext::class.java) } @@ -352,7 +353,13 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null) : AsciiDocTest .graphQLContext(mapOf(QueryContext.KEY to queryContext)) .build() ) - Assertions.assertThat(result.errors).isEmpty() + if (result.errors.isNotEmpty()) { + val exception = + result.errors.filterIsInstance().firstOrNull() + ?: result.errors.filterIsInstance().firstOrNull()?.exception + + Assertions.fail(result.errors.joinToString("\n") { it.message }, exception) + } val values = result?.getData() @@ -443,6 +450,12 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null) : AsciiDocTest } is String -> { + when (actual) { + is TemporalAccessor -> { + Assertions.assertThat(actual).isEqualTo(TemporalScalar.parse(expected)) + return + } + } try { val expectedDate = ZonedDateTime.parse(expected) val actualDate = ZonedDateTime.parse(actual as String) @@ -458,8 +471,8 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null) : AsciiDocTest } catch (ignore: DateTimeParseException) { } try { - val expectedTime = LocalTime.parse(expected, DateTimeFormatter.ISO_TIME) - val actualTime = LocalTime.parse(actual as String) + val expectedTime = LocalDate.parse(expected, DateTimeFormatter.ISO_DATE) + val actualTime = LocalDate.parse(actual as String) Assertions.assertThat(actualTime).isEqualTo(expectedTime) return } catch (ignore: DateTimeParseException) { @@ -563,6 +576,5 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null) : AsciiDocTest return InternalIsoDuration(period.toTotalMonths(), period.days.toLong(), duration.seconds, duration.nano) } - } } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/alias.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/alias.adoc index 03d3728a..6ba1c898 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/alias.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/alias.adoc @@ -60,7 +60,7 @@ CALL { RETURN collect( { node: { __id: elementId(actor0), - __resolveType: 'Actor' + __typename: 'Actor' } }) AS actorsEdges } @@ -138,11 +138,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS hanksEdges @@ -167,11 +167,11 @@ CALL { WITH edge.node AS actor1, edge.relationship AS actedIn1 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor1.name } }) AS jennyEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/composite.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/composite.adoc index 89273a1a..653007e9 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/composite.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/composite.adoc @@ -82,11 +82,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', firstName: actor0.firstName, lastName: actor0.lastName } @@ -165,11 +165,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', firstName: actor0.firstName, lastName: actor0.lastName } @@ -252,11 +252,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', firstName: actor0.firstName, lastName: actor0.lastName } @@ -335,11 +335,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', firstName: actor0.firstName, lastName: actor0.lastName } @@ -418,11 +418,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', firstName: actor0.firstName, lastName: actor0.lastName } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/and.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/and.adoc index 2303b2c4..596b7511 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/and.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/and.adoc @@ -76,11 +76,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', firstName: actor0.firstName, lastName: actor0.lastName } @@ -149,11 +149,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', firstName: actor0.firstName, lastName: actor0.lastName } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/arrays.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/arrays.adoc index 154ffab7..5d1b7fc9 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/arrays.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/arrays.adoc @@ -71,11 +71,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -143,11 +143,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name, favouriteColours: actor0.favouriteColours } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/equality.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/equality.adoc index 3d8443d6..10673beb 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/equality.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/equality.adoc @@ -70,11 +70,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/numerical.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/numerical.adoc index 8d1d27be..92cb889e 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/numerical.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/numerical.adoc @@ -72,11 +72,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name, age: actor0.age } @@ -145,11 +145,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name, age: actor0.age } @@ -218,11 +218,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name, age: actor0.age } @@ -291,11 +291,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name, age: actor0.age } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/or.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/or.adoc index f3f0f61b..f454afba 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/or.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/or.adoc @@ -74,11 +74,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', firstName: actor0.firstName, lastName: actor0.lastName } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/points.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/points.adoc index e8d43157..d3519a74 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/points.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/points.adoc @@ -83,11 +83,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name, currentLocation: CASE WHEN actor0.currentLocation IS NOT NULL THEN { latitude: actor0.currentLocation.latitude, diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/string.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/string.adoc index 5dba1ee2..bbc2ea8a 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/string.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/string.adoc @@ -86,11 +86,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -157,11 +157,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -228,11 +228,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -299,11 +299,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/and.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/and.adoc index 31ce125b..3d861f66 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/and.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/and.adoc @@ -76,12 +76,12 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', role: actedIn0.role, screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -149,12 +149,12 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', role: actedIn0.role, screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/arrays.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/arrays.adoc index 7e519e8d..fb742584 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/arrays.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/arrays.adoc @@ -71,11 +71,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -144,11 +144,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/equality.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/equality.adoc index d05c482d..28713567 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/equality.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/equality.adoc @@ -70,11 +70,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/numerical.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/numerical.adoc index 1ea5dbe3..3c65a030 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/numerical.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/numerical.adoc @@ -70,11 +70,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -141,11 +141,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -212,11 +212,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -283,11 +283,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/or.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/or.adoc index 199b6e40..6e32ca15 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/or.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/or.adoc @@ -76,12 +76,12 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', role: actedIn0.role, screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/points.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/points.adoc index f05f3d86..c83f6a62 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/points.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/points.adoc @@ -83,7 +83,7 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime, location: CASE WHEN actedIn0.location IS NOT NULL THEN { latitude: actedIn0.location.latitude, @@ -91,7 +91,7 @@ CALL { } ELSE NULL END }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/string.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/string.adoc index 9eb4ff0e..b3821e96 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/string.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/string.adoc @@ -87,11 +87,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', role: actedIn0.role }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -158,11 +158,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', role: actedIn0.role }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -229,11 +229,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', role: actedIn0.role }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -300,11 +300,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', role: actedIn0.role }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/temporal.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/temporal.adoc index f66d24b3..737b5b84 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/temporal.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/temporal.adoc @@ -52,7 +52,7 @@ type ActedIn @relationshipProperties { ---- { "param0" : "2000-01-01", - "param1" : "2010-01-01T00:00:00.000Z" + "param1" : "2010-01-01T00:00:00Z" } ---- @@ -76,12 +76,12 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', startDate: actedIn0.startDate, endDateTime: apoc.date.convertFormat(toString(actedIn0.endDateTime), 'iso_zoned_date_time', 'iso_offset_date_time') }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/interfaces.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/interfaces.adoc index 3d480dd6..82108c86 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/interfaces.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/interfaces.adoc @@ -79,11 +79,11 @@ CALL { WHERE movie0.title STARTS WITH $param0 WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, runtime: movie0.runtime, __id: elementId(movie0) @@ -95,11 +95,11 @@ CALL { WHERE series0.title STARTS WITH $param1 WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, episodes: series0.episodes, __id: elementId(series0) @@ -167,11 +167,11 @@ CALL { MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, runtime: movie0.runtime, __id: elementId(movie0) @@ -182,11 +182,11 @@ CALL { MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, episodes: series0.episodes, __id: elementId(series0) @@ -258,11 +258,11 @@ CALL { WHERE actedIn0.screenTime > $param0 WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, runtime: movie0.runtime, __id: elementId(movie0) @@ -274,11 +274,11 @@ CALL { WHERE actedIn1.screenTime > $param1 WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, episodes: series0.episodes, __id: elementId(series0) @@ -350,11 +350,11 @@ CALL { MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, runtime: movie0.runtime, __id: elementId(movie0) @@ -365,11 +365,11 @@ CALL { MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, episodes: series0.episodes, __id: elementId(series0) @@ -443,11 +443,11 @@ CALL { MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, runtime: movie0.runtime, __id: elementId(movie0) @@ -458,11 +458,11 @@ CALL { MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, episodes: series0.episodes, __id: elementId(series0) @@ -535,11 +535,11 @@ CALL { MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, runtime: movie0.runtime, __id: elementId(movie0) @@ -550,11 +550,11 @@ CALL { MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, episodes: series0.episodes, __id: elementId(series0) @@ -627,11 +627,11 @@ CALL { MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', runtime: movie0.runtime, title: movie0.title, __id: elementId(movie0) @@ -642,11 +642,11 @@ CALL { MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', episodes: series0.episodes, title: series0.title, __id: elementId(series0) diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/projections/projections.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/projections/projections.adoc index 612e84ad..479ee29c 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/projections/projections.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/projections/projections.adoc @@ -72,7 +72,7 @@ CALL { RETURN collect( { node: { __id: elementId(actor0), - __resolveType: 'Actor' + __typename: 'Actor' } }) AS actorsConnectionEdges } @@ -130,7 +130,7 @@ CALL { WITH { node: { __id: elementId(movie0), - __resolveType: 'Movie' + __typename: 'Movie' } } AS edge RETURN edge UNION @@ -139,7 +139,7 @@ CALL { WITH { node: { __id: elementId(series0), - __resolveType: 'Series' + __typename: 'Series' } } AS edge RETURN edge @@ -202,7 +202,7 @@ CALL { RETURN collect( { node: { __id: elementId(actor0), - __resolveType: 'Actor' + __typename: 'Actor' } }) AS actorsConnectionEdges } @@ -255,7 +255,7 @@ CALL { WITH { node: { __id: elementId(movie0), - __resolveType: 'Movie' + __typename: 'Movie' } } AS edge RETURN edge UNION @@ -264,7 +264,7 @@ CALL { WITH { node: { __id: elementId(series0), - __resolveType: 'Series' + __typename: 'Series' } } AS edge RETURN edge @@ -328,7 +328,7 @@ CALL { RETURN collect( { node: { __id: elementId(actor0), - __resolveType: 'Actor' + __typename: 'Actor' } }) AS actorsConnectionEdges } @@ -392,7 +392,7 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -458,7 +458,7 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 RETURN collect( { node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/relationship-properties.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/relationship-properties.adoc index 471fc335..664710bf 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/relationship-properties.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/relationship-properties.adoc @@ -71,11 +71,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -142,11 +142,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actedIn0.screenTime DESC RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -209,11 +209,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actedIn0.year DESC, actor0.name ASC RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', year: actedIn0.year }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -275,11 +275,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actor0.name ASC, actedIn0.year DESC RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', year: actedIn0.year }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -347,11 +347,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -462,11 +462,11 @@ CALL { WITH edge.node AS actor1, edge.relationship AS actedIn2 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn2.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor1.name } }) AS actorsConnectionEdges @@ -478,11 +478,11 @@ CALL { } RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, actorsConnection: actorsConnection } @@ -495,11 +495,11 @@ CALL { } RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name, moviesConnection: moviesConnection } @@ -589,11 +589,11 @@ CALL { WITH edge.node AS movie0, edge.relationship AS actedIn1 RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title } }) AS moviesConnectionEdges @@ -605,11 +605,11 @@ CALL { } RETURN collect( { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name, moviesConnection: moviesConnection } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/unions.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/unions.adoc index 562e0a2c..e03e54d5 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/unions.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/unions.adoc @@ -72,11 +72,11 @@ CALL { MATCH (this)-[wrote0:WROTE]->(book0:Book) WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote0.words }, node: { - __resolveType: 'Book', + __typename: 'Book', title: book0.title, __id: elementId(book0) } @@ -86,11 +86,11 @@ CALL { MATCH (this)-[wrote1:WROTE]->(journal0:Journal) WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote1.words }, node: { - __resolveType: 'Journal', + __typename: 'Journal', subject: journal0.subject, __id: elementId(journal0) } @@ -156,11 +156,11 @@ CALL { MATCH (this)-[wrote0:WROTE]->(book0:Book) WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote0.words }, node: { - __resolveType: 'Book', + __typename: 'Book', title: book0.title, __id: elementId(book0) } @@ -170,11 +170,11 @@ CALL { MATCH (this)-[wrote1:WROTE]->(journal0:Journal) WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote1.words }, node: { - __resolveType: 'Journal', + __typename: 'Journal', subject: journal0.subject, __id: elementId(journal0) } @@ -252,11 +252,11 @@ CALL { WHERE book0.title = $param0 WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote0.words }, node: { - __resolveType: 'Book', + __typename: 'Book', title: book0.title, __id: elementId(book0) } @@ -267,11 +267,11 @@ CALL { WHERE journal0.subject = $param1 WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote1.words }, node: { - __resolveType: 'Journal', + __typename: 'Journal', subject: journal0.subject, __id: elementId(journal0) } @@ -346,11 +346,11 @@ CALL { AND wrote0.words = $param1) WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote0.words }, node: { - __resolveType: 'Book', + __typename: 'Book', title: book0.title, __id: elementId(book0) } @@ -362,11 +362,11 @@ CALL { AND wrote1.words = $param3) WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote1.words }, node: { - __resolveType: 'Journal', + __typename: 'Journal', subject: journal0.subject, __id: elementId(journal0) } @@ -438,11 +438,11 @@ CALL { WHERE wrote0.words = $param0 WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote0.words }, node: { - __resolveType: 'Book', + __typename: 'Book', title: book0.title, __id: elementId(book0) } @@ -453,11 +453,11 @@ CALL { WHERE wrote1.words = $param1 WITH { properties: { - __resolveType: 'Wrote', + __typename: 'Wrote', words: wrote1.words }, node: { - __resolveType: 'Journal', + __typename: 'Journal', subject: journal0.subject, __id: elementId(journal0) } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/alias.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/alias.adoc index def7a561..910e1ace 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/alias.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/alias.adoc @@ -117,12 +117,12 @@ CALL { WITH edge.node AS movie0, edge.relationship AS actedIn0 RETURN collect( { properties: { - __resolveType: 'ActorActedInProps', + __typename: 'ActorActedInProps', character: actedIn0.characterPropInDb, screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, rating: movie0.ratingPropInDb } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_2.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_2.adoc index 98679ef7..5b91ab6b 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_2.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_2.adoc @@ -83,7 +83,7 @@ CALL { WITH edge.node AS movie0, edge.relationship AS actedIn0 RETURN collect( { node: { - __resolveType: 'Movie', + __typename: 'Movie', id: movie0.id, status: movie0.status } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_3.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_3.adoc index eb7af871..62571288 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_3.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_3.adoc @@ -67,7 +67,7 @@ CALL { WITH edge.node AS movie0, edge.relationship AS actedIn0 RETURN collect( { node: { - __resolveType: 'Movie', + __typename: 'Movie', id: movie0.id, statuses: movie0.statuses } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-interfaces.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-interfaces.adoc index b5426853..5bc912c5 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-interfaces.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-interfaces.adoc @@ -96,7 +96,7 @@ CALL { WITH * MATCH (this)-[wrote0:WROTE]->(book0:Book) WITH book0 { - __resolveType: 'Book', + __typename: 'Book', __id: elementId(book0), .publicationYear, .title @@ -105,7 +105,7 @@ CALL { WITH * MATCH (this)-[wrote1:WROTE]->(journal0:Journal) WITH journal0 { - __resolveType: 'Journal', + __typename: 'Journal', __id: elementId(journal0), .publicationYear, .subject @@ -151,7 +151,7 @@ CALL { WITH * MATCH (this)-[wrote0:WROTE]->(book0:Book) WITH book0 { - __resolveType: 'Book', + __typename: 'Book', __id: elementId(book0), .title } AS book0 @@ -159,7 +159,7 @@ CALL { WITH * MATCH (this)-[wrote1:WROTE]->(journal0:Journal) WITH journal0 { - __resolveType: 'Journal', + __typename: 'Journal', __id: elementId(journal0), .subject } AS journal0 @@ -209,7 +209,7 @@ CALL { WITH * MATCH (this)-[wrote0:WROTE]->(book0:Book) WITH book0 { - __resolveType: 'Book', + __typename: 'Book', __id: elementId(book0), .title } AS book0 @@ -217,7 +217,7 @@ CALL { WITH * MATCH (this)-[wrote1:WROTE]->(journal0:Journal) WITH journal0 { - __resolveType: 'Journal', + __typename: 'Journal', __id: elementId(journal0), .subject } AS journal0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-unions.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-unions.adoc index 285a4e47..7d329837 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-unions.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-unions.adoc @@ -91,7 +91,7 @@ CALL { WITH * MATCH (this)-[wrote0:WROTE]->(book0:Book) WITH book0 { - __resolveType: 'Book', + __typename: 'Book', __id: elementId(book0), .title } AS book0 @@ -99,7 +99,7 @@ CALL { WITH * MATCH (this)-[wrote1:WROTE]->(journal0:Journal) WITH journal0 { - __resolveType: 'Journal', + __typename: 'Journal', __id: elementId(journal0), .subject } AS journal0 @@ -144,7 +144,7 @@ CALL { WITH * MATCH (this)-[wrote0:WROTE]->(book0:Book) WITH book0 { - __resolveType: 'Book', + __typename: 'Book', __id: elementId(book0), .title } AS book0 @@ -152,7 +152,7 @@ CALL { WITH * MATCH (this)-[wrote1:WROTE]->(journal0:Journal) WITH journal0 { - __resolveType: 'Journal', + __typename: 'Journal', __id: elementId(journal0), .subject } AS journal0 @@ -202,7 +202,7 @@ CALL { WITH * MATCH (this)-[wrote0:WROTE]->(book0:Book) WITH book0 { - __resolveType: 'Book', + __typename: 'Book', __id: elementId(book0), .title } AS book0 @@ -210,7 +210,7 @@ CALL { WITH * MATCH (this)-[wrote1:WROTE]->(journal0:Journal) WITH journal0 { - __resolveType: 'Journal', + __typename: 'Journal', __id: elementId(journal0), .subject } AS journal0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/interface-relationships/read.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/interface-relationships/read.adoc index 4b97bba6..cdba5b1e 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/interface-relationships/read.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/interface-relationships/read.adoc @@ -75,11 +75,11 @@ CALL { MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, runtime: movie0.runtime, __id: elementId(movie0) @@ -90,11 +90,11 @@ CALL { MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, episodes: series0.episodes, __id: elementId(series0) @@ -169,11 +169,11 @@ CALL { AND actedIn0.screenTime > $param1) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn0.screenTime }, node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, runtime: movie0.runtime, __id: elementId(movie0) @@ -186,11 +186,11 @@ CALL { AND actedIn1.screenTime > $param3) WITH { properties: { - __resolveType: 'ActedIn', + __typename: 'ActedIn', screenTime: actedIn1.screenTime }, node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, episodes: series0.episodes, __id: elementId(series0) @@ -248,7 +248,7 @@ CALL { WITH * MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title, .runtime @@ -257,7 +257,7 @@ CALL { WITH * MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title, .episodes @@ -310,7 +310,7 @@ CALL { WITH * MATCH (this)-[currentlyActingIn0:CURRENTLY_ACTING_IN]->(movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title, .runtime @@ -319,7 +319,7 @@ CALL { WITH * MATCH (this)-[currentlyActingIn1:CURRENTLY_ACTING_IN]->(series0:Series) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title, .episodes @@ -375,7 +375,7 @@ CALL { WITH * MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title, .runtime @@ -384,7 +384,7 @@ CALL { WITH * MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title, .episodes diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-interface.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-interface.adoc index 452fdd62..497e5d89 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-interface.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-interface.adoc @@ -64,7 +64,7 @@ CALL { MATCH (this)-[search0:SEARCH]->(genre0:Category:ExtraLabel1:ExtraLabel2) WHERE genre0.name = $param1 WITH genre0 { - __resolveType: 'Genre', + __typename: 'Genre', __id: elementId(genre0), .name } AS genre0 @@ -73,7 +73,7 @@ CALL { MATCH (this)-[search1:SEARCH]->(movie0:Film) WHERE movie0.name = $param2 WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-union.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-union.adoc index 8f796ae1..f70c3816 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-union.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-union.adoc @@ -64,7 +64,7 @@ CALL { MATCH (this)-[search1:SEARCH]->(genre0:Category:ExtraLabel1:ExtraLabel2) WHERE genre0.name = $param1 WITH genre0 { - __resolveType: 'Genre', + __typename: 'Genre', __id: elementId(genre0), .name } AS genre0 @@ -73,7 +73,7 @@ CALL { MATCH (this)-[search2:SEARCH]->(movie0:Film) WHERE movie0.title = $param2 WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label.adoc index c1499d20..73e17370 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label.adoc @@ -102,7 +102,7 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc b/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc index 515afba8..94c05899 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc @@ -78,7 +78,7 @@ CALL { AND cartoon0:Series) OR cartoon0:Movie) WITH cartoon0 { - __resolveType: 'Cartoon', + __typename: 'Cartoon', __id: elementId(cartoon0), .title } AS cartoon0 @@ -89,7 +89,7 @@ CALL { AND movie0:Series) OR movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 @@ -100,7 +100,7 @@ CALL { AND series0:Series) OR series0:Movie) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title } AS series0 @@ -149,7 +149,7 @@ CALL { AND cartoon0:Series) OR cartoon0:Movie) WITH cartoon0 { - __resolveType: 'Cartoon', + __typename: 'Cartoon', __id: elementId(cartoon0), .title } AS cartoon0 @@ -159,7 +159,7 @@ CALL { AND movie0:Series) OR movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 @@ -169,7 +169,7 @@ CALL { AND series0:Series) OR series0:Movie) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title } AS series0 @@ -225,7 +225,7 @@ CALL { WITH * MATCH (this)-[actedIn0:ACTED_IN]->(cartoon0:Cartoon) WITH cartoon0 { - __resolveType: 'Cartoon', + __typename: 'Cartoon', __id: elementId(cartoon0), .title } AS cartoon0 @@ -233,7 +233,7 @@ CALL { WITH * MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 @@ -241,7 +241,7 @@ CALL { WITH * MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title } AS series0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-relationship-filtering.adoc b/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-relationship-filtering.adoc index 09472d01..3f4948c6 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-relationship-filtering.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-relationship-filtering.adoc @@ -108,7 +108,7 @@ CALL { MATCH (movie0:Movie) WHERE movie0.title = $param0 WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 @@ -116,7 +116,7 @@ CALL { MATCH (series0:Series) WHERE series0.title = $param1 WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title } AS series0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-top-level.adoc b/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-top-level.adoc index 48cca3ea..e7598bdc 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-top-level.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-top-level.adoc @@ -47,14 +47,14 @@ type Movie { CALL { MATCH (genre0:Genre) WITH genre0 { - __resolveType: 'Genre', + __typename: 'Genre', __id: elementId(genre0), .name } AS genre0 RETURN genre0 AS this UNION MATCH (movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 @@ -100,7 +100,7 @@ RETURN this AS this CALL { MATCH (genre0:Genre) WITH genre0 { - __resolveType: 'Genre', + __typename: 'Genre', __id: elementId(genre0), .name } AS genre0 @@ -112,7 +112,7 @@ CALL { WITH * MATCH (movie0)-[search1:SEARCH]->(genre1:Genre) WITH genre1 { - __resolveType: 'Genre', + __typename: 'Genre', __id: elementId(genre1), .name } AS genre1 @@ -120,7 +120,7 @@ CALL { WITH * MATCH (movie0)-[search2:SEARCH]->(movie1:Movie) WITH movie1 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie1) } AS movie1 RETURN movie1 AS search0 @@ -129,7 +129,7 @@ CALL { RETURN collect(search0) AS search0 } WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title, search: search0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/1348.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/1348.adoc index 3a3bbf86..6c78654f 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/1348.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/1348.adoc @@ -64,7 +64,7 @@ CALL { WITH * MATCH (this)-[relatesTo0:RELATES_TO]-(programmeItem0:ProgrammeItem) WITH programmeItem0 { - __resolveType: 'ProgrammeItem', + __typename: 'ProgrammeItem', __id: elementId(programmeItem0), .productTitle } AS programmeItem0 @@ -72,7 +72,7 @@ CALL { WITH * MATCH (this)-[relatesTo1:RELATES_TO]-(season0:Season) WITH season0 { - __resolveType: 'Season', + __typename: 'Season', __id: elementId(season0), .productTitle } AS season0 @@ -80,7 +80,7 @@ CALL { WITH * MATCH (this)-[relatesTo2:RELATES_TO]-(series0:Series) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .productTitle } AS series0 @@ -143,7 +143,7 @@ CALL { MATCH (this)-[relatesTo0:RELATES_TO]-(programmeItem0:ProgrammeItem) WITH { node: { - __resolveType: 'ProgrammeItem', + __typename: 'ProgrammeItem', productTitle: programmeItem0.productTitle, __id: elementId(programmeItem0) } @@ -153,7 +153,7 @@ CALL { MATCH (this)-[relatesTo1:RELATES_TO]-(season0:Season) WITH { node: { - __resolveType: 'Season', + __typename: 'Season', productTitle: season0.productTitle, __id: elementId(season0) } @@ -163,7 +163,7 @@ CALL { MATCH (this)-[relatesTo2:RELATES_TO]-(series0:Series) WITH { node: { - __resolveType: 'Series', + __typename: 'Series', productTitle: series0.productTitle, __id: elementId(series0) } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/2262.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/2262.adoc index 5a5948d2..7e3b455c 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/2262.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/2262.adoc @@ -84,7 +84,7 @@ CALL { WITH edge.node AS component0, edge.relationship AS input0 ORDER BY component0.uuid DESC RETURN collect( { node: { - __resolveType: 'Component', + __typename: 'Component', uuid: component0.uuid } }) AS componentInputsConnectionEdges @@ -96,7 +96,7 @@ CALL { } RETURN collect( { node: { - __resolveType: 'Process', + __typename: 'Process', uuid: process0.uuid, componentInputsConnection: componentInputsConnection } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/2614.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/2614.adoc index 9c890898..6576f091 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/2614.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/2614.adoc @@ -67,7 +67,7 @@ CALL { MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Film) WHERE movie0.title = $param0 WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 @@ -76,7 +76,7 @@ CALL { MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WHERE series0.title = $param1 WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title } AS series0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/3394.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/3394.adoc index acc11af3..546264f6 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/3394.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/3394.adoc @@ -135,7 +135,7 @@ CALL { WITH * ORDER BY this.fg_item DESC RETURN collect( { node: { - __resolveType: 'Product', + __typename: 'Product', id: this.fg_item_id, partNumber: this.fg_item, description: this.description @@ -194,7 +194,7 @@ CALL { WITH edge.node AS product0, edge.relationship AS canAccess0 ORDER BY product0.fg_item DESC RETURN collect( { node: { - __resolveType: 'Product', + __typename: 'Product', id: product0.fg_item_id, partNumber: product0.fg_item, description: product0.description diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/360.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/360.adoc index f0fcaddb..4e5426d1 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/360.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/360.adoc @@ -43,8 +43,8 @@ query ($rangeStart: DateTime, $rangeEnd: DateTime, $activity: String) { [source,json] ---- { - "param0" : "2021-07-18T00:00:00+0100", - "param1" : "2021-07-18T23:59:59+0100" + "param0" : "2021-07-18T00:00:00+01:00", + "param1" : "2021-07-18T23:59:59+01:00" } ---- @@ -90,8 +90,8 @@ query ($rangeStart: DateTime, $rangeEnd: DateTime, $activity: String) { [source,json] ---- { - "param0" : "2021-07-18T00:00:00+0100", - "param1" : "2021-07-18T23:59:59+0100" + "param0" : "2021-07-18T00:00:00+01:00", + "param1" : "2021-07-18T23:59:59+01:00" } ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4007.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4007.adoc index fe3f2e80..814aebc9 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4007.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4007.adoc @@ -59,7 +59,7 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { n: { - __resolveType: 'Actor', + __typename: 'Actor', na: actor0.name } }) AS tEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4015.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4015.adoc index 4a1dc7cd..e25c6db0 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4015.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4015.adoc @@ -63,11 +63,11 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { node: { - __resolveType: 'Actor', + __typename: 'Actor', surname: actor0.surname }, no: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4287.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4287.adoc index f95b9dbe..acffd187 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4287.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4287.adoc @@ -75,7 +75,7 @@ CALL { OR movie0.title = $param1) WITH { node: { - __resolveType: 'Movie', + __typename: 'Movie', title: movie0.title, __id: elementId(movie0) } @@ -87,7 +87,7 @@ CALL { OR series0.title = $param3) WITH { node: { - __resolveType: 'Series', + __typename: 'Series', title: series0.title, __id: elementId(series0) } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/433.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/433.adoc index 76a94158..99b1e263 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/433.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/433.adoc @@ -59,7 +59,7 @@ CALL { WITH edge.node AS person0, edge.relationship AS actedIn0 RETURN collect( { node: { - __resolveType: 'Person', + __typename: 'Person', name: person0.name } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4432.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4432.adoc index 0ed734d2..5ea34fcd 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4432.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4432.adoc @@ -67,11 +67,11 @@ CALL { MATCH (this)-[haschildren0:HasChildren]->(image0:Image) WITH { properties: { - __resolveType: 'InventoryChildRelation', + __typename: 'InventoryChildRelation', order: haschildren0.order }, node: { - __resolveType: 'Image', + __typename: 'Image', id: image0.id, __id: elementId(image0) } @@ -81,11 +81,11 @@ CALL { MATCH (this)-[haschildren1:HasChildren]->(video0:Video) WITH { properties: { - __resolveType: 'InventoryChildRelation', + __typename: 'InventoryChildRelation', order: haschildren1.order }, node: { - __resolveType: 'Video', + __typename: 'Video', id: video0.id, __id: elementId(video0) } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/583.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/583.adoc index 8d6f5442..99b0d135 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/583.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/583.adoc @@ -70,7 +70,7 @@ CALL { WITH * MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title, .awardsGiven @@ -79,7 +79,7 @@ CALL { WITH * MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title, .awardsGiven @@ -88,7 +88,7 @@ CALL { WITH * MATCH (this)-[actedIn2:ACTED_IN]->(shortFilm0:ShortFilm) WITH shortFilm0 { - __resolveType: 'ShortFilm', + __typename: 'ShortFilm', __id: elementId(shortFilm0), .title } AS shortFilm0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/rfcs/query-limits.adoc b/core/src/test/resources/tck-test-files/cypher/v2/rfcs/query-limits.adoc index db4a76bf..5ede8331 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/rfcs/query-limits.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/rfcs/query-limits.adoc @@ -74,7 +74,7 @@ CALL { WITH edge.node AS person0, edge.relationship AS actedIn0 LIMIT $param0 RETURN collect( { node: { - __resolveType: 'Person', + __typename: 'Person', id: person0.id } }) AS actorsConnectionEdges @@ -137,7 +137,7 @@ CALL { WITH edge.node AS show0, edge.relationship AS partOf0 LIMIT $param0 RETURN collect( { node: { - __resolveType: 'Show', + __typename: 'Show', id: show0.id } }) AS showsConnectionEdges @@ -202,7 +202,7 @@ CALL { WITH edge.node AS person0, edge.relationship AS actedIn0 LIMIT $param0 RETURN collect( { node: { - __resolveType: 'Person', + __typename: 'Person', id: person0.id } }) AS actorsConnectionEdges diff --git a/core/src/test/resources/tck-test-files/cypher/v2/root-connection.adoc b/core/src/test/resources/tck-test-files/cypher/v2/root-connection.adoc index 608fb310..e91493ed 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/root-connection.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/root-connection.adoc @@ -57,7 +57,7 @@ CALL { WITH * ORDER BY this.title ASC LIMIT $param0 RETURN collect( { node: { - __resolveType: 'Movie', + __typename: 'Movie', title: this.title } }) AS edges0 @@ -115,7 +115,7 @@ CALL { WITH * ORDER BY this.title ASC LIMIT $param1 RETURN collect( { node: { - __resolveType: 'Movie', + __typename: 'Movie', title: this.title } }) AS edges0 @@ -187,7 +187,7 @@ CALL { WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { node: { - __resolveType: 'Actor', + __typename: 'Actor', name: actor0.name } }) AS actorsConnectionEdges @@ -199,7 +199,7 @@ CALL { } RETURN collect( { node: { - __resolveType: 'Movie', + __typename: 'Movie', title: this.title, actorsConnection: actorsConnection } @@ -253,7 +253,7 @@ CALL { WITH edge.node AS this RETURN collect( { node: { - __resolveType: 'Movie', + __typename: 'Movie', title: this.title } }) AS edges0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/datetime.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/datetime.adoc index 4b18f68c..d7982fb8 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/datetime.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/datetime.adoc @@ -28,7 +28,7 @@ type Movie { [source,json] ---- { - "param0" : "1970-01-01T00:00:00.000Z" + "param0" : "1970-01-01T00:00:00Z" } ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/localdatetime.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/localdatetime.adoc index ccd56955..16878bd3 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/localdatetime.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/localdatetime.adoc @@ -28,7 +28,7 @@ type Movie { [source,json] ---- { - "param0" : "2010-08-23T13:45:33.250" + "param0" : "2010-08-23T13:45:33.25" } ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/localtime.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/localtime.adoc index de6864ba..a2617e79 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/localtime.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/localtime.adoc @@ -28,7 +28,7 @@ type Movie { [source,json] ---- { - "param0" : "13:45:33.250" + "param0" : "13:45:33.25" } ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/time.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/time.adoc index 87eb50b9..7a85c322 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/time.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/time.adoc @@ -28,7 +28,7 @@ type Movie { [source,json] ---- { - "param0" : "13:45:33.250" + "param0" : "13:45:33.250Z" } ---- @@ -60,7 +60,7 @@ RETURN this { [source,json] ---- { - "param0" : "12:00:00" + "param0" : "12:00Z" } ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_1.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_1.adoc index fb70d310..1d534e8c 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_1.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_1.adoc @@ -51,7 +51,7 @@ CALL { RETURN collect( { node: { __id: elementId(user0), - __resolveType: 'User' + __typename: 'User' } }) AS friendsConnectionEdges } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_2.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_2.adoc index bf092924..6e6a5d42 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_2.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_2.adoc @@ -51,7 +51,7 @@ CALL { RETURN collect( { node: { __id: elementId(user0), - __resolveType: 'User' + __typename: 'User' } }) AS friendsConnectionEdges } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_3.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_3.adoc index 42d3e49d..2edb3f89 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_3.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_3.adoc @@ -51,7 +51,7 @@ CALL { RETURN collect( { node: { __id: elementId(user0), - __resolveType: 'User' + __typename: 'User' } }) AS friendsConnectionEdges } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-connection.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-connection.adoc index 01fc7b91..a7fa26cf 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-connection.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-connection.adoc @@ -51,7 +51,7 @@ CALL { RETURN collect( { node: { __id: elementId(user0), - __resolveType: 'User' + __typename: 'User' } }) AS friendsConnectionEdges } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_2.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_2.adoc index aaad2e0c..2385c297 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_2.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_2.adoc @@ -58,7 +58,7 @@ CALL { WITH * MATCH (this)-[hasContent0:HAS_CONTENT]-(blog0:Blog) WITH blog0 { - __resolveType: 'Blog', + __typename: 'Blog', __id: elementId(blog0), .title } AS blog0 @@ -66,7 +66,7 @@ CALL { WITH * MATCH (this)-[hasContent1:HAS_CONTENT]-(post0:Post) WITH post0 { - __resolveType: 'Post', + __typename: 'Post', __id: elementId(post0), .content } AS post0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_3.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_3.adoc index 2eefa88a..8cabde63 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_3.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_3.adoc @@ -63,7 +63,7 @@ CALL { WITH * MATCH (this)-[actedIn0:ACTED_IN]-(movie0:Movie) WITH movie0 { - __resolveType: 'Movie', + __typename: 'Movie', __id: elementId(movie0), .title } AS movie0 @@ -71,7 +71,7 @@ CALL { WITH * MATCH (this)-[actedIn1:ACTED_IN]-(series0:Series) WITH series0 { - __resolveType: 'Series', + __typename: 'Series', __id: elementId(series0), .title } AS series0 diff --git a/neo4j-graphql-neo4j-adapter-api/src/main/kotlin/org/neo4j/graphql/driver/adapter/Neo4jAdapter.kt b/neo4j-graphql-neo4j-adapter-api/src/main/kotlin/org/neo4j/graphql/driver/adapter/Neo4jAdapter.kt index 1d38153c..a917bfc5 100644 --- a/neo4j-graphql-neo4j-adapter-api/src/main/kotlin/org/neo4j/graphql/driver/adapter/Neo4jAdapter.kt +++ b/neo4j-graphql-neo4j-adapter-api/src/main/kotlin/org/neo4j/graphql/driver/adapter/Neo4jAdapter.kt @@ -14,6 +14,8 @@ interface Neo4jAdapter { fun executeQuery(cypher: String, params: Map): List> companion object { + const val CONTEXT_KEY = "neo4jAdapter" + val NO_OP = object : Neo4jAdapter { override fun executeQuery(cypher: String, params: Map): List> { return emptyList() From 71faad7d353763f176f014d4bb5fa45540047b8e Mon Sep 17 00:00:00 2001 From: Andreas Berger Date: Thu, 12 Dec 2024 17:09:41 +0100 Subject: [PATCH 2/7] add integration tests --- core/pom.xml | 12 + .../org/neo4j/graphql/ExtensionFunctions.kt | 3 + .../kotlin/org/neo4j/graphql/SchemaBuilder.kt | 84 +- .../neo4j/graphql/scalars/DurationScalar.kt | 19 +- .../schema/model/outputs/PageInfoSelection.kt | 5 +- .../graphql/translate/ProjectionTranslator.kt | 30 +- .../CreateConnectionClause.kt | 15 +- .../graphql/translate/where/CreateWhere.kt | 9 +- .../kotlin/org/neo4j/graphql/CypherTests.kt | 45 +- .../ArrayFieldCustomResolver.kt | 21 + .../ArrayFieldCustomResolver2.kt | 22 + .../ComplexFieldCustomResolver.kt | 16 + .../ComplexFieldCustomResolver2.kt | 21 + .../ComplexFieldCustomResolver3.kt | 24 + .../FieldFromInterfaceCustomResolver.kt | 34 + .../FieldFromUnionCustomResolver.kt | 29 + .../ScalarFieldCustomResolver.kt | 14 + .../custom_resolver/TestDataFetcher.kt | 7 + .../neo4j/graphql/utils/AsciiDocTestSuite.kt | 22 +- .../neo4j/graphql/utils/CypherTestSuite.kt | 235 +- .../graphql/utils/asciidoc/AsciiDocParser.kt | 36 + .../neo4j/graphql/utils/asciidoc/ast/Table.kt | 19 + .../integration-test-files/aliasing.adoc | 198 + .../config-options/query-options.adoc | 86 + .../config-options/startup-validation.adoc | 833 +++ .../connection-resolvers.adoc | 128 + .../connections/alias.adoc | 1651 +++++ .../connections/filtering.adoc | 112 + .../connections/interfaces.adoc | 869 +++ .../connections/nested.adoc | 353 + .../connections/unions.adoc | 1320 ++++ .../custom-resolvers.adoc | 171 + .../custom-scalar-filtering.adoc | 355 + .../authorization/custom-resolvers.adoc | 151 + .../directives/coalesce.adoc | 204 + .../directives/customResolver.adoc | 2507 +++++++ .../directives/default.adoc | 200 + .../directives/node/label.adoc | 62 + .../errors.adoc} | 77 +- .../filtering/advanced-filtering.adoc | 1490 +++++ .../filter-interface-relationship.adoc | 613 ++ .../filtering/filter-union-relationship.adoc | 732 ++ .../filtering/operations.adoc | 89 + .../filtering/single-relationship.adoc | 154 + .../filtering/typename-in.adoc | 234 + .../integration-test-files/find.adoc | 597 ++ .../undirected-relationships.test.ts.adoc} | 41 +- .../interfaces/relationships/read.adoc | 464 ++ .../integration-test-files/issues/1683.adoc | 103 + .../integration-test-files/issues/1686.adoc | 78 + .../integration-test-files/issues/1687.adoc | 86 + .../integration-test-files/issues/1779.adoc | 115 + .../integration-test-files/issues/207.adoc | 60 + .../integration-test-files/issues/2262.adoc | 149 + .../integration-test-files/issues/2820.adoc | 943 +++ .../integration-test-files/issues/2847.adoc | 92 + .../integration-test-files/issues/3009.adoc | 73 + .../integration-test-files/issues/3394.adoc | 351 + .../integration-test-files/issues/360.adoc | 204 + .../integration-test-files/issues/4007.adoc | 120 + .../integration-test-files/issues/4015.adoc | 134 + .../integration-test-files/issues/402.adoc | 83 + .../integration-test-files/issues/4196.adoc | 125 + .../integration-test-files/issues/4287.adoc | 149 + .../integration-test-files/issues/433.adoc | 109 + .../integration-test-files/issues/4450.adoc | 91 + .../integration-test-files/issues/4532.adoc | 322 + .../integration-test-files/issues/4667.adoc | 85 + .../integration-test-files/issues/5142.adoc | 35 + .../issues/5223-cartesian.adoc | 398 ++ .../issues/5223-point.adoc | 394 ++ .../integration-test-files/issues/560.adoc | 147 + .../integration-test-files/issues/583.adoc | 161 + .../integration-test-files/issues/620.adoc | 85 + .../issues/date-in-edge.adoc | 119 + ...r-if-missing-relationship-properties.adoc} | 289 +- .../relationship-properties/read.adoc | 152 + .../rfcs/query-limits.adoc | 70 + .../integration-test-files/scalars.adoc | 64 + .../integration-test-files/types/bigint.adoc | 131 + .../integration-test-files/types/date.adoc | 66 + .../types/datetime.adoc | 127 + .../types/duration.adoc | 395 ++ .../types/localdatetime.adoc | 545 ++ .../types/localtime.adoc | 562 ++ .../types/point-cartesian.adoc | 182 + .../integration-test-files/types/point.adoc | 116 + .../types/points-cartesian.adoc | 270 + .../integration-test-files/types/points.adoc | 137 + .../integration-test-files/types/time.adoc | 544 ++ .../unions/union-relationship-filtering.adoc | 172 + .../unions/unions-top-level.adoc | 225 + .../integration-test-files/unions/unions.adoc | 418 ++ .../cypher/v2/advanced-filtering.adoc | 250 +- .../tck-test-files/cypher/v2/arrays.adoc | 4 +- .../cypher/v2/connections/alias.adoc | 4 +- .../v2/connections/filtering/composite.adoc | 40 +- .../v2/connections/filtering/node/and.adoc | 4 +- .../v2/connections/filtering/node/arrays.adoc | 4 +- .../connections/filtering/node/equality.adoc | 4 +- .../connections/filtering/node/numerical.adoc | 28 +- .../v2/connections/filtering/node/or.adoc | 4 +- .../v2/connections/filtering/node/points.adoc | 4 +- .../v2/connections/filtering/node/string.adoc | 30 +- .../filtering/relationship/and.adoc | 4 +- .../filtering/relationship/arrays.adoc | 4 +- .../filtering/relationship/equality.adoc | 4 +- .../filtering/relationship/numerical.adoc | 28 +- .../filtering/relationship/or.adoc | 4 +- .../filtering/relationship/points.adoc | 4 +- .../filtering/relationship/string.adoc | 30 +- .../filtering/relationship/temporal.adoc | 4 +- .../cypher/v2/connections/interfaces.adoc | 28 +- .../connections/projections/projections.adoc | 136 +- .../connections/relationship-properties.adoc | 146 +- .../cypher/v2/connections/unions.adoc | 58 +- .../cypher/v2/directives/alias.adoc | 4 +- .../cypher/v2/directives/coalesce.adoc | 245 + .../cypher/v2/directives/coalesce_1.adoc | 69 - .../cypher/v2/directives/coalesce_2.adoc | 103 - .../cypher/v2/directives/coalesce_3.adoc | 87 - .../cypher/v2/directives/customResolver.adoc | 893 +++ .../customResolver_no-required-fields.adoc | 73 - ...r_require-fields-on-nested-interfaces.adoc | 236 - ...solver_require-fields-on-nested-types.adoc | 214 - ...olver_require-fields-on-nested-unions.adoc | 229 - ...mResolver_require-fields-on-same-type.adoc | 137 - .../interface-relationships/read.adoc | 356 +- .../node/node-additional-labels.adoc | 36 +- .../directives/node/node-label-interface.adoc | 4 +- .../v2/directives/node/node-label-union.adoc | 4 +- .../cypher/v2/directives/node/node-label.adoc | 62 +- .../cypher/v2/directives/plural.adoc | 12 +- .../cypher/v2/experimental/typename-in.adoc | 158 +- .../union-relationship-filtering.adoc | 88 +- .../v2/experimental/union-top-level.adoc | 4 +- .../tck-test-files/cypher/v2/issues/1348.adoc | 4 +- .../tck-test-files/cypher/v2/issues/1687.adoc | 4 +- .../tck-test-files/cypher/v2/issues/1779.adoc | 4 +- .../tck-test-files/cypher/v2/issues/2262.adoc | 4 +- .../tck-test-files/cypher/v2/issues/2614.adoc | 4 +- .../tck-test-files/cypher/v2/issues/2713.adoc | 4 +- .../tck-test-files/cypher/v2/issues/2925.adoc | 4 +- .../tck-test-files/cypher/v2/issues/3215.adoc | 10 +- .../tck-test-files/cypher/v2/issues/3394.adoc | 5 +- .../tck-test-files/cypher/v2/issues/360.adoc | 4 +- .../tck-test-files/cypher/v2/issues/3765.adoc | 107 +- .../tck-test-files/cypher/v2/issues/4007.adoc | 4 +- .../tck-test-files/cypher/v2/issues/4015.adoc | 4 +- .../tck-test-files/cypher/v2/issues/402.adoc | 4 +- .../tck-test-files/cypher/v2/issues/4287.adoc | 6 +- .../tck-test-files/cypher/v2/issues/433.adoc | 4 +- .../tck-test-files/cypher/v2/issues/4432.adoc | 6 +- .../tck-test-files/cypher/v2/issues/4450.adoc | 6 +- .../tck-test-files/cypher/v2/issues/4667.adoc | 6 +- .../tck-test-files/cypher/v2/issues/583.adoc | 4 +- .../tck-test-files/cypher/v2/null.adoc | 4 +- .../tck-test-files/cypher/v2/pagination.adoc | 68 +- .../cypher/v2/rfcs/query-limits.adoc | 285 +- .../cypher/v2/rfcs/rfc-022.adoc | 44 +- .../cypher/v2/root-connection.adoc | 110 +- .../tck-test-files/cypher/v2/simple.adoc | 42 +- .../cypher/v2/types/bigint.adoc | 36 +- .../tck-test-files/cypher/v2/types/date.adoc | 20 +- .../cypher/v2/types/datetime.adoc | 4 +- .../cypher/v2/types/duration.adoc | 20 +- .../cypher/v2/types/localdatetime.adoc | 20 +- .../cypher/v2/types/localtime.adoc | 20 +- .../tck-test-files/cypher/v2/types/point.adoc | 63 +- .../cypher/v2/types/points.adoc | 32 +- .../tck-test-files/cypher/v2/types/time.adoc | 20 +- .../query-direction-connection.adoc | 197 + .../query-direction-connection_1.adoc | 69 - .../query-direction-connection_2.adoc | 69 - .../query-direction-connection_3.adoc | 69 - .../query-direction.adoc | 229 + .../query-direction_1.adoc | 67 - .../query-direction_2.adoc | 67 - .../query-direction_3.adoc | 55 - .../query-direction_4.adoc | 55 - .../undirected-connection.adoc | 6 +- .../undirected-relationships.adoc | 230 + .../undirected-relationships_2.adoc | 84 - .../undirected-relationships_3.adoc | 89 - .../tck-test-files/cypher/v2/where.adoc | 143 +- ...el-aggregations.adoc => aggregations.adoc} | 195 +- .../aggregations/top-level-aggregations.adoc | 190 - .../schema/v2/array-methods.adoc | 9 +- .../tck-test-files/schema/v2/arrays.adoc | 7 +- .../tck-test-files/schema/v2/comments.adoc | 823 +++ .../v2/comments/relationship/interface.adoc | 314 - .../v2/comments/relationship/simple.adoc | 171 - .../v2/comments/relationship/unions.adoc | 195 - .../schema/v2/comments/simple.adoc | 152 - .../schema/v2/connections/enums.adoc | 9 +- .../schema/v2/connections/sort.adoc | 9 +- .../schema/v2/connections/unions.adoc | 9 +- .../schema/v2/directive-preserve.adoc | 1389 ++++ .../custom-directives-preserved.adoc | 92 - ...irectives-on-base-interface-preserved.adoc | 403 -- ...erved-field-not-declared-relationship.adoc | 403 -- .../directives-on-relations-preserved.adoc | 228 - .../directives-on-unions-preserved.adoc | 278 - .../schema/v2/directives/alias.adoc | 9 +- .../schema/v2/directives/customResolver.adoc | 9 +- .../schema/v2/directives/default.adoc | 9 +- .../schema/v2/directives/filterable.adoc | 2094 ++++++ .../disable-value-filters.adoc | 251 - ...-arguments-should-disable-aggregation.adoc | 267 - .../enable-only-value-filters.adoc | 267 - ...-arguments-should-disable-aggregation.adoc | 218 - .../enable-only-value-filters.adoc | 218 - ...-arguments-should-disable-aggregation.adoc | 218 - ...-arguments-should-disable-aggregation.adoc | 335 - .../enable-only-value-filters.adoc | 335 - ...ate-is-not-inherited.adoc => private.adoc} | 141 +- .../does-not-add-fields-to-schema.adoc | 136 - ...ld-disable-aggregation.adoc => query.adoc} | 44 +- .../should-disable-read-and-aggregate.adoc | 37 - .../v2/directives/relationship-aggregate.adoc | 828 +++ .../should-disable-nested-aggregation.adoc | 177 - ...bstract-does-not-support-aggregation-.adoc | 234 - ...bstract-does-not-support-aggregation-.adoc | 245 - .../relationship-nested-operations.adoc | 5959 +++++++++++++++++ ...ted-type-does-not-have-a-unique-field.adoc | 169 - ...input-input-with-no-nested-operations.adoc | 169 - ...th-nested-operation-connect-specified.adoc | 169 - ...ith-nested-operation-create-specified.adoc | 169 - ...ith-nested-operation-delete-specified.adoc | 169 - ...nested-operation-disconnect-specified.adoc | 169 - ...ith-nested-operation-update-specified.adoc | 169 - ...h-nested-operations-specified-on-both.adoc | 210 - ...th-nested-operations-specified-on-one.adoc | 210 - ...ted-type-does-not-have-a-unique-field.adoc | 237 - ...input-input-with-no-nested-operations.adoc | 237 - ...th-nested-operation-connect-specified.adoc | 237 - ...ith-nested-operation-create-specified.adoc | 237 - ...ith-nested-operation-delete-specified.adoc | 237 - ...nested-operation-disconnect-specified.adoc | 237 - ...ith-nested-operation-update-specified.adoc | 237 - ...h-nested-operations-specified-on-both.adoc | 286 - ...th-nested-operations-specified-on-one.adoc | 286 - ...input-input-with-no-nested-operations.adoc | 267 - ...th-nested-operation-connect-specified.adoc | 267 - ...ith-nested-operation-create-specified.adoc | 267 - ...ith-nested-operation-delete-specified.adoc | 267 - ...nested-operation-disconnect-specified.adoc | 267 - ...ith-nested-operation-update-specified.adoc | 267 - ...h-nested-operations-specified-on-both.adoc | 308 - ...th-nested-operations-specified-on-one.adoc | 308 - .../directives/relationship-properties.adoc | 9 +- ...ti-relationship.adoc => relationship.adoc} | 174 +- .../relationship/single-relationship.adoc | 169 - .../tck-test-files/schema/v2/enum.adoc | 9 +- .../v2/experimental-schema/comments.adoc | 823 +++ .../comments/relationship/interface.adoc | 314 - .../comments/relationship/simple.adoc | 171 - .../comments/relationship/unions.adoc | 195 - .../experimental-schema/comments/simple.adoc | 152 - .../directive-preserve.adoc | 1389 ++++ .../custom-directives-preserved.adoc | 92 - ...irectives-on-base-interface-preserved.adoc | 403 -- ...erved-field-not-declared-relationship.adoc | 403 -- .../directives-on-relations-preserved.adoc | 228 - .../directives-on-unions-preserved.adoc | 278 - .../directives/customResolver.adoc | 9 +- .../directives/default.adoc | 9 +- .../directives/filterable.adoc | 2094 ++++++ .../disable-value-filters.adoc | 251 - ...-arguments-should-disable-aggregation.adoc | 267 - .../enable-only-value-filters.adoc | 267 - ...-arguments-should-disable-aggregation.adoc | 218 - .../enable-only-value-filters.adoc | 218 - ...-arguments-should-disable-aggregation.adoc | 218 - ...-arguments-should-disable-aggregation.adoc | 335 - .../enable-only-value-filters.adoc | 335 - ...ate-is-not-inherited.adoc => private.adoc} | 141 +- .../does-not-add-fields-to-schema.adoc | 136 - .../directives/relationship-aggregate.adoc | 828 +++ .../should-disable-nested-aggregation.adoc | 177 - ...bstract-does-not-support-aggregation-.adoc | 234 - ...bstract-does-not-support-aggregation-.adoc | 245 - .../relationship-nested-operations.adoc | 5959 +++++++++++++++++ ...ted-type-does-not-have-a-unique-field.adoc | 169 - ...input-input-with-no-nested-operations.adoc | 169 - ...th-nested-operation-connect-specified.adoc | 169 - ...ith-nested-operation-create-specified.adoc | 169 - ...ith-nested-operation-delete-specified.adoc | 169 - ...nested-operation-disconnect-specified.adoc | 169 - ...ith-nested-operation-update-specified.adoc | 169 - ...h-nested-operations-specified-on-both.adoc | 210 - ...th-nested-operations-specified-on-one.adoc | 210 - ...ted-type-does-not-have-a-unique-field.adoc | 237 - ...input-input-with-no-nested-operations.adoc | 237 - ...th-nested-operation-connect-specified.adoc | 237 - ...ith-nested-operation-create-specified.adoc | 237 - ...ith-nested-operation-delete-specified.adoc | 237 - ...nested-operation-disconnect-specified.adoc | 237 - ...ith-nested-operation-update-specified.adoc | 237 - ...h-nested-operations-specified-on-both.adoc | 286 - ...th-nested-operations-specified-on-one.adoc | 286 - ...input-input-with-no-nested-operations.adoc | 267 - ...th-nested-operation-connect-specified.adoc | 267 - ...ith-nested-operation-create-specified.adoc | 267 - ...ith-nested-operation-delete-specified.adoc | 267 - ...nested-operation-disconnect-specified.adoc | 267 - ...ith-nested-operation-update-specified.adoc | 267 - ...h-nested-operations-specified-on-both.adoc | 308 - ...th-nested-operations-specified-on-one.adoc | 308 - .../interface-relationships.adoc | 9 +- .../aggregations.adoc} | 165 +- .../interfaces-with-relationships.adoc | 339 - .../interfaces/aggregations/interfaces.adoc | 160 - .../interfaces/typename-in.adoc | 7 +- .../schema/v2/experimental-schema/math.adoc | 989 +++ .../decrement-operators.adoc | 96 - .../subtract/multiply/divide-operators.adoc | 93 - ...-should-be-presents-in-nested-updates.adoc | 207 - .../should-be-supported-in-interfaces.adoc | 269 - ...-supported-in-relationship-properties.adoc | 250 - .../nested-aggregation-on-interface.adoc | 314 +- ...e-correct-schema-without-aggregations.adoc | 339 - .../schema/v2/experimental-schema/plural.adoc | 9 +- .../v2/experimental-schema/subscriptions.adoc | 955 +++ ...empty-eventpayload-type-on-union-type.adoc | 313 - .../empty-eventpayload-type.adoc | 214 - .../subscriptions/subscriptions.adoc | 191 - .../tck-test-files/schema/v2/extend.adoc | 7 +- .../tck-test-files/schema/v2/inputs.adoc | 7 +- .../schema/v2/interface-relationships.adoc | 9 +- .../tck-test-files/schema/v2/issues/1038.adoc | 9 +- .../tck-test-files/schema/v2/issues/1614.adoc | 9 +- .../tck-test-files/schema/v2/issues/162.adoc | 9 +- .../tck-test-files/schema/v2/issues/2187.adoc | 9 +- .../tck-test-files/schema/v2/issues/2969.adoc | 9 +- .../tck-test-files/schema/v2/issues/2981.adoc | 9 +- .../tck-test-files/schema/v2/issues/3816.adoc | 393 ++ ...f-nested-operations-in-reported-issue.adoc | 198 - .../no-nested-operations-in-one-type.adoc | 198 - .../tck-test-files/schema/v2/issues/5428.adoc | 9 +- .../tck-test-files/schema/v2/issues/609.adoc | 9 +- .../schema/v2/lowercase-type-names.adoc | 9 +- .../tck-test-files/schema/v2/math.adoc | 989 +++ .../decrement-operators.adoc | 96 - .../subtract/multiply/divide-operators.adoc | 93 - .../decrement-operators.adoc | 93 - ...-should-be-presents-in-nested-updates.adoc | 207 - .../should-be-supported-in-interfaces.adoc | 269 - ...-supported-in-relationship-properties.adoc | 250 - .../schema/v2/nested-aggregation-on-type.adoc | 9 +- .../tck-test-files/schema/v2/null.adoc | 9 +- .../schema/v2/pluralize-consistency.adoc | 9 +- .../schema/v2/query-direction.adoc | 368 + .../query-direction/default_undirected.adoc | 125 - .../v2/query-direction/directed_only.adoc | 125 - .../v2/query-direction/undirected_only.adoc | 125 - ...el-aggregations.adoc => aggregations.adoc} | 195 +- .../aggregations/top-level-aggregations.adoc | 190 - .../v2/remove-deprecated/array-methods.adoc | 9 +- .../schema/v2/remove-deprecated/comments.adoc | 823 +++ .../comments/relationship/interface.adoc | 314 - .../comments/relationship/simple.adoc | 171 - .../comments/relationship/unions.adoc | 195 - .../v2/remove-deprecated/comments/simple.adoc | 152 - .../tck-test-files/schema/v2/scalar.adoc | 9 +- .../tck-test-files/schema/v2/simple.adoc | 7 +- ...roperties.adoc => string-comparators.adoc} | 290 +- ...ly-the-defined-ones-should-be-present.adoc | 107 - .../schema/v2/subscriptions.adoc | 955 +++ ...-type-but-relationshipproperty-exists.adoc | 248 - ...empty-eventpayload-type-on-union-type.adoc | 313 - .../empty-eventpayload-type.adoc | 214 - .../v2/subscriptions/subscriptions.adoc | 191 - .../schema/v2/types/bigint.adoc | 9 +- .../tck-test-files/schema/v2/types/date.adoc | 7 +- .../schema/v2/types/datetime.adoc | 9 +- .../schema/v2/types/duration.adoc | 7 +- .../schema/v2/types/localdatetime.adoc | 9 +- .../schema/v2/types/localtime.adoc | 9 +- .../tck-test-files/schema/v2/types/point.adoc | 458 ++ .../schema/v2/types/point/cartesianpoint.adoc | 121 - .../v2/types/point/cartesianpoints.adoc | 95 - .../schema/v2/types/point/point.adoc | 140 - .../schema/v2/types/point/points.adoc | 113 - .../tck-test-files/schema/v2/types/time.adoc | 7 +- .../tck-test-files/schema/v2/unions.adoc | 7 +- examples/dgs-spring-boot/pom.xml | 2 +- .../datafetcher/AdditionalDataFetcherTest.kt | 2 +- examples/graphql-kotlin-spring-boot/pom.xml | 2 +- .../graphqlspringboot/controller/QueriesIT.kt | 2 +- examples/graphql-spring-boot/pom.xml | 2 +- .../AdditionalDataFetcherTest.java | 2 +- .../driver/adapter/Neo4jDriverAdapter.kt | 39 +- pom.xml | 4 +- 394 files changed, 56542 insertions(+), 33171 deletions(-) create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver2.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver2.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver3.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/FieldFromInterfaceCustomResolver.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/FieldFromUnionCustomResolver.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ScalarFieldCustomResolver.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/custom_resolver/TestDataFetcher.kt create mode 100644 core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/ast/Table.kt create mode 100644 core/src/test/resources/integration-test-files/aliasing.adoc create mode 100644 core/src/test/resources/integration-test-files/config-options/query-options.adoc create mode 100644 core/src/test/resources/integration-test-files/config-options/startup-validation.adoc create mode 100644 core/src/test/resources/integration-test-files/connection-resolvers.adoc create mode 100644 core/src/test/resources/integration-test-files/connections/alias.adoc create mode 100644 core/src/test/resources/integration-test-files/connections/filtering.adoc create mode 100644 core/src/test/resources/integration-test-files/connections/interfaces.adoc create mode 100644 core/src/test/resources/integration-test-files/connections/nested.adoc create mode 100644 core/src/test/resources/integration-test-files/connections/unions.adoc create mode 100644 core/src/test/resources/integration-test-files/custom-resolvers.adoc create mode 100644 core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc create mode 100644 core/src/test/resources/integration-test-files/directives/authorization/custom-resolvers.adoc create mode 100644 core/src/test/resources/integration-test-files/directives/coalesce.adoc create mode 100644 core/src/test/resources/integration-test-files/directives/customResolver.adoc create mode 100644 core/src/test/resources/integration-test-files/directives/default.adoc create mode 100644 core/src/test/resources/integration-test-files/directives/node/label.adoc rename core/src/test/resources/{tck-test-files/schema/v2/experimental-schema/math/int-fields-should-be-extended-with-increment/decrement-operators.adoc => integration-test-files/errors.adoc} (55%) create mode 100644 core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc create mode 100644 core/src/test/resources/integration-test-files/filtering/filter-interface-relationship.adoc create mode 100644 core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc create mode 100644 core/src/test/resources/integration-test-files/filtering/operations.adoc create mode 100644 core/src/test/resources/integration-test-files/filtering/single-relationship.adoc create mode 100644 core/src/test/resources/integration-test-files/filtering/typename-in.adoc create mode 100644 core/src/test/resources/integration-test-files/find.adoc rename core/src/test/resources/{tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_1.adoc => integration-test-files/home/andreas/projects/neo4j-graphql/packages/graphql/tests/integration/undirected-relationships.test.ts.adoc} (58%) create mode 100644 core/src/test/resources/integration-test-files/interfaces/relationships/read.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/1683.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/1686.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/1687.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/1779.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/207.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/2262.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/2820.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/2847.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/3009.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/3394.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/360.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/4007.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/4015.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/402.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/4196.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/4287.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/433.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/4450.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/4532.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/4667.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/5142.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/5223-point.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/560.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/583.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/620.adoc create mode 100644 core/src/test/resources/integration-test-files/issues/date-in-edge.adoc rename core/src/test/resources/{tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type-but-relationshipproperty-exists.adoc => integration-test-files/relationship-properties/error-if-missing-relationship-properties.adoc} (55%) create mode 100644 core/src/test/resources/integration-test-files/relationship-properties/read.adoc create mode 100644 core/src/test/resources/integration-test-files/rfcs/query-limits.adoc create mode 100644 core/src/test/resources/integration-test-files/scalars.adoc create mode 100644 core/src/test/resources/integration-test-files/types/bigint.adoc create mode 100644 core/src/test/resources/integration-test-files/types/date.adoc create mode 100644 core/src/test/resources/integration-test-files/types/datetime.adoc create mode 100644 core/src/test/resources/integration-test-files/types/duration.adoc create mode 100644 core/src/test/resources/integration-test-files/types/localdatetime.adoc create mode 100644 core/src/test/resources/integration-test-files/types/localtime.adoc create mode 100644 core/src/test/resources/integration-test-files/types/point-cartesian.adoc create mode 100644 core/src/test/resources/integration-test-files/types/point.adoc create mode 100644 core/src/test/resources/integration-test-files/types/points-cartesian.adoc create mode 100644 core/src/test/resources/integration-test-files/types/points.adoc create mode 100644 core/src/test/resources/integration-test-files/types/time.adoc create mode 100644 core/src/test/resources/integration-test-files/unions/union-relationship-filtering.adoc create mode 100644 core/src/test/resources/integration-test-files/unions/unions-top-level.adoc create mode 100644 core/src/test/resources/integration-test-files/unions/unions.adoc create mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_1.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_2.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_3.adoc create mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_no-required-fields.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-interfaces.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-types.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-unions.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-same-type.adoc create mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_1.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_2.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_3.adoc create mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_1.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_2.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_3.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_4.adoc create mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_2.adoc delete mode 100644 core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_3.adoc rename core/src/test/resources/tck-test-files/schema/v2/{aggregations/where-level-aggregations.adoc => aggregations.adoc} (68%) delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/aggregations/top-level-aggregations.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/comments.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/comments/relationship/interface.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/comments/relationship/simple.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/comments/relationship/unions.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/comments/simple.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/directive-preserve.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directive-preserve/custom-directives-preserved.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-base-interface-preserved.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-implemented-interface-relations-preserved-field-not-declared-relationship.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-relations-preserved.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-unions-preserved.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable/on-interface-relationship-field-aggregation-are-not-generated-for-abstract-types-/disable-value-filters.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-relationship-field/default-arguments-should-disable-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-relationship-field/enable-only-value-filters.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-scalar/default-arguments-should-disable-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc rename core/src/test/resources/tck-test-files/schema/v2/directives/{private/private-is-not-inherited.adoc => private.adoc} (50%) delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/private/does-not-add-fields-to-schema.adoc rename core/src/test/resources/tck-test-files/schema/v2/directives/{query/default-arguments-should-disable-aggregation.adoc => query.adoc} (86%) delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/query/should-disable-read-and-aggregate.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/should-disable-nested-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/snapshot-tests/on-interface/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/snapshot-tests/on-union/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-connect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-create-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-delete-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-disconnect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-update-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-both.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-one.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-connect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-create-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-delete-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-disconnect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-update-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-both.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-one.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-connect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-create-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-delete-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-disconnect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-update-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-both.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-one.adoc rename core/src/test/resources/tck-test-files/schema/v2/directives/{relationship/multi-relationship.adoc => relationship.adoc} (58%) delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/directives/relationship/single-relationship.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/interface.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/simple.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/unions.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/simple.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/custom-directives-preserved.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-base-interface-preserved.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-implemented-interface-relations-preserved-field-not-declared-relationship.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-relations-preserved.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-unions-preserved.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/on-interface-relationship-field-aggregation-are-not-generated-for-abstract-types-/disable-value-filters.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-relationship-field/default-arguments-should-disable-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-relationship-field/enable-only-value-filters.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-scalar/default-arguments-should-disable-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc rename core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/{private/private-is-not-inherited.adoc => private.adoc} (50%) delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private/does-not-add-fields-to-schema.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/should-disable-nested-aggregation.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/snapshot-tests/on-interface/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/snapshot-tests/on-union/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-connect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-create-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-delete-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-disconnect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-update-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-both.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-one.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-connect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-create-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-delete-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-disconnect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-update-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-both.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-one.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-connect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-create-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-delete-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-disconnect-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-update-specified.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-both.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-one.adoc rename core/src/test/resources/tck-test-files/schema/v2/experimental-schema/{nested-aggregation-on-interface/should-generate-the-correct-schema.adoc => interfaces/aggregations.adoc} (70%) delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations/interfaces-with-relationships.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations/interfaces.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/bigint-fields-should-be-extended-with-increment/decrement-operators.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/float-fields-should-be-extended-with-add/subtract/multiply/divide-operators.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/operators-should-be-presents-in-nested-updates.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/should-be-supported-in-interfaces.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/should-be-supported-in-relationship-properties.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface/aggregate-false-should-generate-the-correct-schema-without-aggregations.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type-on-union-type.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/subscriptions.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/issues/3816.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/issues/3816/combination-of-nested-operations-in-reported-issue.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/issues/3816/no-nested-operations-in-one-type.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/math.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/math/bigint-fields-should-be-extended-with-increment/decrement-operators.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/math/float-fields-should-be-extended-with-add/subtract/multiply/divide-operators.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/math/int-fields-should-be-extended-with-increment/decrement-operators.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/math/operators-should-be-presents-in-nested-updates.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/math/should-be-supported-in-interfaces.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/math/should-be-supported-in-relationship-properties.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/query-direction.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/query-direction/default_undirected.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/query-direction/directed_only.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/query-direction/undirected_only.adoc rename core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/{aggregations/where-level-aggregations.adoc => aggregations.adoc} (68%) delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations/top-level-aggregations.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/interface.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/simple.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/unions.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/simple.adoc rename core/src/test/resources/tck-test-files/schema/v2/{string-comparators/string-comparator-relationship-and-relationship-properties.adoc => string-comparators.adoc} (56%) delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/string-comparators/if-string-comparators-are-partially-defined-then-only-the-defined-ones-should-be-present.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/subscriptions.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type-but-relationshipproperty-exists.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type-on-union-type.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/subscriptions/subscriptions.adoc create mode 100644 core/src/test/resources/tck-test-files/schema/v2/types/point.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/types/point/cartesianpoint.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/types/point/cartesianpoints.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/types/point/point.adoc delete mode 100644 core/src/test/resources/tck-test-files/schema/v2/types/point/points.adoc diff --git a/core/pom.xml b/core/pom.xml index c64f6ca4..90986318 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -26,6 +26,11 @@ 2.0.0-SNAPSHOT test + + org.threeten + threeten-extra + 1.7.0 + org.neo4j.driver neo4j-java-driver @@ -122,6 +127,13 @@ 2.17.2 test + + org.apache.commons + commons-csv + 1.12.0 + test + + diff --git a/core/src/main/kotlin/org/neo4j/graphql/ExtensionFunctions.kt b/core/src/main/kotlin/org/neo4j/graphql/ExtensionFunctions.kt index d01aa74d..34033603 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/ExtensionFunctions.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/ExtensionFunctions.kt @@ -30,6 +30,8 @@ fun String.toLowerCase(): String = lowercase(Locale.getDefault()) infix fun Condition?.and(rhs: Condition) = this?.and(rhs) ?: rhs infix fun Condition?.or(rhs: Condition) = this?.or(rhs) ?: rhs +infix fun Condition?.xor(rhs: Condition) = this?.xor(rhs) ?: rhs + fun Collection.foldWithAnd(): Condition? = this .filterNotNull() .takeIf { it.isNotEmpty() } @@ -169,3 +171,4 @@ fun Iterable.toDict(): List = this.mapNotNull { Dict.create(it) } fun String.toDeprecatedDirective() = Directive("deprecated", listOf(Argument("reason", StringValue(this)))) +fun Collection.union(): Statement = if (this.size == 1) this.first() else Cypher.union(this) diff --git a/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt b/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt index 8dbff41f..c8c52046 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt @@ -38,61 +38,45 @@ import org.neo4j.graphql.schema.model.outputs.NodeSelection */ class SchemaBuilder @JvmOverloads constructor( val typeDefinitionRegistry: TypeDefinitionRegistry, - val schemaConfig: SchemaConfig = SchemaConfig() + val schemaConfig: SchemaConfig = SchemaConfig(), ) { companion object { - /** - * @param sdl the schema to augment - * @param neo4jAdapter the adapter to run the generated cypher queries - * @param config defines how the schema should get augmented - */ + @JvmStatic @JvmOverloads - fun buildSchema( - sdl: String, - config: SchemaConfig = SchemaConfig(), - neo4jAdapter: Neo4jAdapter = Neo4jAdapter.NO_OP, - addLibraryDirectivesToSchema: Boolean = true, - ): GraphQLSchema { + fun fromSchema(sdl: String, config: SchemaConfig = SchemaConfig()): SchemaBuilder { val schemaParser = SchemaParser() val typeDefinitionRegistry = schemaParser.parse(sdl) - return buildSchema(typeDefinitionRegistry, config, neo4jAdapter, addLibraryDirectivesToSchema) + return SchemaBuilder(typeDefinitionRegistry, config) } /** - * @param typeDefinitionRegistry a registry containing all the types, that should be augmented - * @param config defines how the schema should get augmented + * @param sdl the schema to augment * @param neo4jAdapter the adapter to run the generated cypher queries + * @param config defines how the schema should get augmented */ @JvmStatic @JvmOverloads fun buildSchema( - typeDefinitionRegistry: TypeDefinitionRegistry, + sdl: String, config: SchemaConfig = SchemaConfig(), - neo4jAdapter: Neo4jAdapter, + neo4jAdapter: Neo4jAdapter = Neo4jAdapter.NO_OP, addLibraryDirectivesToSchema: Boolean = true, - ): GraphQLSchema { - - val builder = RuntimeWiring.newRuntimeWiring() - val codeRegistryBuilder = GraphQLCodeRegistry.newCodeRegistry() - val schemaBuilder = SchemaBuilder(typeDefinitionRegistry, config) - schemaBuilder.augmentTypes(addLibraryDirectivesToSchema) - schemaBuilder.registerScalars(builder) - schemaBuilder.registerTypeNameResolver(builder) - schemaBuilder.registerNeo4jAdapter(codeRegistryBuilder, neo4jAdapter) - - return SchemaGenerator().makeExecutableSchema( - typeDefinitionRegistry, - builder.codeRegistry(codeRegistryBuilder).build() - ) - } + ): GraphQLSchema = fromSchema(sdl, config) + .withNeo4jAdapter(neo4jAdapter) + .addLibraryDirectivesToSchema(addLibraryDirectivesToSchema) + .build() } private val handler: List private val neo4jTypeDefinitionRegistry: TypeDefinitionRegistry = getNeo4jEnhancements() private val augmentedFields = mutableListOf() private val ctx = AugmentationContext(schemaConfig, typeDefinitionRegistry) + private var addLibraryDirectivesToSchema: Boolean = false; + private var codeRegistryBuilder: GraphQLCodeRegistry.Builder? = null + private var runtimeWiringBuilder: RuntimeWiring.Builder? = null + private var neo4jAdapter: Neo4jAdapter = Neo4jAdapter.NO_OP init { handler = mutableListOf( @@ -102,6 +86,42 @@ class SchemaBuilder @JvmOverloads constructor( ) } + fun addLibraryDirectivesToSchema(addLibraryDirectivesToSchema: Boolean): SchemaBuilder { + this.addLibraryDirectivesToSchema = addLibraryDirectivesToSchema + return this + } + + fun withCodeRegistryBuilder(codeRegistryBuilder: GraphQLCodeRegistry.Builder): SchemaBuilder { + this.codeRegistryBuilder = codeRegistryBuilder + return this + } + + fun withRuntimeWiringBuilder(runtimeWiring: RuntimeWiring.Builder): SchemaBuilder { + this.runtimeWiringBuilder = runtimeWiring + return this + } + + fun withNeo4jAdapter(neo4jAdapter: Neo4jAdapter): SchemaBuilder { + this.neo4jAdapter = neo4jAdapter + return this + } + + fun build(): GraphQLSchema { + augmentTypes(addLibraryDirectivesToSchema) + val runtimeWiringBuilder = this.runtimeWiringBuilder ?: RuntimeWiring.newRuntimeWiring() + registerScalars(runtimeWiringBuilder) + registerTypeNameResolver(runtimeWiringBuilder) + + val codeRegistryBuilder = this.codeRegistryBuilder ?: GraphQLCodeRegistry.newCodeRegistry() + registerNeo4jAdapter(codeRegistryBuilder, neo4jAdapter) + + return SchemaGenerator().makeExecutableSchema( + typeDefinitionRegistry, + runtimeWiringBuilder.codeRegistry(codeRegistryBuilder).build() + ) + + } + /** * Generated additionally query and mutation fields according to the types present in the [typeDefinitionRegistry]. diff --git a/core/src/main/kotlin/org/neo4j/graphql/scalars/DurationScalar.kt b/core/src/main/kotlin/org/neo4j/graphql/scalars/DurationScalar.kt index 461f4b2a..c8f9474a 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/scalars/DurationScalar.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/scalars/DurationScalar.kt @@ -6,24 +6,17 @@ import graphql.execution.CoercedVariables import graphql.language.* import graphql.schema.* import org.neo4j.graphql.Constants -import java.time.Duration -import java.time.Period -import java.time.format.DateTimeParseException -import java.time.temporal.TemporalAmount +import org.threeten.extra.PeriodDuration import java.util.* object DurationScalar { val INSTANCE: GraphQLScalarType = GraphQLScalarType.newScalar() .name(Constants.DURATION) - .coercing(object : Coercing { + .coercing(object : Coercing { - private fun parse(value: String): TemporalAmount { - try { - return Duration.parse(value) - } catch (e: DateTimeParseException){ - return Period.parse(value) - } + private fun parse(value: String): PeriodDuration { + return PeriodDuration.parse(value) } @Throws(CoercingSerializeException::class) @@ -32,7 +25,7 @@ object DurationScalar { } @Throws(CoercingParseValueException::class) - override fun parseValue(input: Any, graphQLContext: GraphQLContext, locale: Locale): TemporalAmount? { + override fun parseValue(input: Any, graphQLContext: GraphQLContext, locale: Locale): PeriodDuration? { return when (input) { is StringValue -> parse(input.value) is String -> parse(input) @@ -46,7 +39,7 @@ object DurationScalar { variables: CoercedVariables, graphQLContext: GraphQLContext, locale: Locale - ): TemporalAmount? { + ): PeriodDuration? { return parseValue(input, graphQLContext, locale) } }) diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/PageInfoSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/PageInfoSelection.kt index 6676c1de..fc523955 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/PageInfoSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/PageInfoSelection.kt @@ -2,6 +2,7 @@ package org.neo4j.graphql.schema.model.outputs import org.neo4j.graphql.Constants import org.neo4j.graphql.NonNull +import org.neo4j.graphql.asDescription import org.neo4j.graphql.schema.AugmentationBase import org.neo4j.graphql.schema.AugmentationContext import org.neo4j.graphql.utils.IResolveTree @@ -18,7 +19,9 @@ class PageInfoSelection( object Augmentation : AugmentationBase { fun generateNodeSelection(ctx: AugmentationContext) = - ctx.getOrCreateObjectType(TYPE_NAME) { fields, _ -> + ctx.getOrCreateObjectType( + TYPE_NAME, + { description("Pagination information (Relay)".asDescription()) }) { fields, _ -> fields += field(PageInfoSelection::startCursor, Constants.Types.String) fields += field(PageInfoSelection::endCursor, Constants.Types.String) fields += field(PageInfoSelection::hasNextPage, Constants.Types.Boolean.NonNull) diff --git a/core/src/main/kotlin/org/neo4j/graphql/translate/ProjectionTranslator.kt b/core/src/main/kotlin/org/neo4j/graphql/translate/ProjectionTranslator.kt index 91bf4a40..9a0da4fd 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/translate/ProjectionTranslator.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/translate/ProjectionTranslator.kt @@ -16,6 +16,7 @@ import org.neo4j.graphql.translate.projection.createInterfaceProjectionAndParams import org.neo4j.graphql.translate.projection.projectScalarField import org.neo4j.graphql.translate.where.createWhere import org.neo4j.graphql.utils.ResolveTree +import org.neo4j.graphql.utils.SelectionOfType class ProjectionTranslator { @@ -41,19 +42,27 @@ class ProjectionTranslator { } var selectedFields = resolveTree?.fieldsByTypeName?.get(node.name) - ?: return Projection(projection = projections) - selectedFields.values.forEach { field -> - val nodeField = node.getField(field.name) as? ComputedField ?: return@forEach - nodeField.annotations.customResolver?.requires?.run { - selectedFields = selectedFields.merge(this) + for (it in node.interfaces) { + val interfaceSelection = resolveTree?.fieldsByTypeName?.get(it.name) + if (selectedFields == null) { + selectedFields = interfaceSelection + } else if (interfaceSelection != null) { + selectedFields = selectedFields.merge(interfaceSelection) } } + var requiredSelection: SelectionOfType = selectedFields ?: return Projection(projection = projections) + + requiredSelection.values.forEach { field -> + val requirements = (node.getField(field.name) as? ComputedField)?.annotations?.customResolver?.requires + ?: return@forEach + requiredSelection = requiredSelection.merge(requirements) + } val subQueries = mutableListOf() val subQueriesBeforeSort = mutableListOf() - selectedFields.values.forEach { field -> + requiredSelection.values.forEach { field -> val alias = field.aliasOrName val nodeField = node.getField(field.name) ?: return@forEach @@ -72,8 +81,13 @@ class ProjectionTranslator { projections += returnVariable } else if (nodeField.isUnion) { + val unionWhere = arguments.where as? WhereInput.UnionWhereInput - val referenceNodes = requireNotNull(nodeField.union).nodes.values + var referenceNodes = requireNotNull(nodeField.union).nodes.values + if (unionWhere != null) { + referenceNodes = + referenceNodes.filter { !unionWhere.getDataForNode(it)?.predicates.isNullOrEmpty() } + } val aliasVar = queryContext.getNextVariable(alias) val unionSubQueries = referenceNodes.map { refNode -> @@ -114,7 +128,7 @@ class ProjectionTranslator { } subQueries += Cypher.with(varName) - .call(Cypher.union(unionSubQueries)) + .call(unionSubQueries.union()) .with(aliasVar) // TODO remove .applySortingSkipAndLimit(aliasVar, arguments.options, queryContext) .returning(Cypher.collect(aliasVar).`as`(aliasVar)) diff --git a/core/src/main/kotlin/org/neo4j/graphql/translate/connection_clause/CreateConnectionClause.kt b/core/src/main/kotlin/org/neo4j/graphql/translate/connection_clause/CreateConnectionClause.kt index c661ee0e..a3143241 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/translate/connection_clause/CreateConnectionClause.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/translate/connection_clause/CreateConnectionClause.kt @@ -39,7 +39,8 @@ fun createConnectionClause( }, onInterface = { createConnectionClauseForMultipleNodes( - it.implementations.values, arguments, + it.implementations.values, + arguments, resolveTree, field, context, @@ -48,9 +49,15 @@ fun createConnectionClause( returnVariable, ) }, - onUnion = { + onUnion = { union -> + val unionConnectionWhere = arguments.where as? ConnectionWhere.UnionConnectionWhere + var nodes = union.nodes.values + if (unionConnectionWhere != null) { + nodes = nodes.filter { !unionConnectionWhere.getDataForNode(it)?.predicates.isNullOrEmpty() } + } createConnectionClauseForMultipleNodes( - it.nodes.values, arguments, + nodes, + arguments, resolveTree, field, context, @@ -98,7 +105,7 @@ private fun createConnectionClauseForMultipleNodes( var targetEdges = edges return Cypher .with(nodeVariable) - .call(Cypher.union(subQueries)) + .call(subQueries.union()) .with(Cypher.collect(collectUnionVariable).`as`(edges)) .with(edges, Cypher.size(edges).`as`(totalCount)) .let { diff --git a/core/src/main/kotlin/org/neo4j/graphql/translate/where/CreateWhere.kt b/core/src/main/kotlin/org/neo4j/graphql/translate/where/CreateWhere.kt index 571e3d20..7069cbec 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/translate/where/CreateWhere.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/translate/where/CreateWhere.kt @@ -9,6 +9,7 @@ import org.neo4j.graphql.domain.fields.HasCoalesceValue import org.neo4j.graphql.domain.fields.RelationField import org.neo4j.graphql.domain.predicates.ConnectionFieldPredicate import org.neo4j.graphql.domain.predicates.RelationFieldPredicate +import org.neo4j.graphql.domain.predicates.RelationOperator import org.neo4j.graphql.domain.predicates.ScalarFieldPredicate import org.neo4j.graphql.schema.model.inputs.WhereInput import org.neo4j.graphql.schema.model.inputs.connection.ConnectionWhere @@ -71,9 +72,15 @@ fun createWhere( if (field is RelationField) { val relation = field.createDslRelation(propertyContainer, endNode) val cond = op.createRelationCondition(relation, nestedCondition) - allConditions = allConditions and cond.let { + + val condition = cond.let { if (predicate.where == null) it.not() else it } + allConditions = when (op) { + RelationOperator.SOME -> allConditions or condition + RelationOperator.SINGLE -> allConditions xor condition + else -> allConditions and condition + } } else { TODO() } diff --git a/core/src/test/kotlin/org/neo4j/graphql/CypherTests.kt b/core/src/test/kotlin/org/neo4j/graphql/CypherTests.kt index 61aca7cb..e831d4d2 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/CypherTests.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/CypherTests.kt @@ -3,6 +3,9 @@ package org.neo4j.graphql import apoc.date.Date import demo.org.neo4j.graphql.utils.TestUtils.createTestsInPath import org.junit.jupiter.api.* +import org.neo4j.driver.AuthTokens +import org.neo4j.driver.Driver +import org.neo4j.driver.GraphDatabase import org.neo4j.graphql.utils.CypherTestSuite import org.neo4j.harness.Neo4j import org.neo4j.harness.Neo4jBuilders @@ -11,83 +14,89 @@ import java.nio.file.Path @TestInstance(TestInstance.Lifecycle.PER_CLASS) class CypherTests { - private var neo4j: Neo4j? = null + private var server: Neo4j? = null + private var driver: Driver? = null + @BeforeAll fun setup() { if (INTEGRATION_TESTS) { - neo4j = Neo4jBuilders + server = Neo4jBuilders .newInProcessBuilder(Path.of("target/test-db")) .withFunction(Date::class.java) .build() + driver = server?.let { GraphDatabase.driver(it.boltURI(), AuthTokens.none()) } } } @AfterAll fun tearDown() { - neo4j?.close() + driver?.close() + server?.close() } @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `cypher-directive-tests`() = CypherTestSuite("cypher-directive-tests.adoc", neo4j).generateTests() + fun `cypher-directive-tests`() = CypherTestSuite("cypher-directive-tests.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `dynamic-property-tests`() = CypherTestSuite("dynamic-property-tests.adoc", neo4j).generateTests() + fun `dynamic-property-tests`() = CypherTestSuite("dynamic-property-tests.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `filter-tests`() = CypherTestSuite("filter-tests.adoc", neo4j).generateTests() + fun `filter-tests`() = CypherTestSuite("filter-tests.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `relationship-tests`() = CypherTestSuite("relationship-tests.adoc", neo4j).generateTests() + fun `relationship-tests`() = CypherTestSuite("relationship-tests.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `movie-tests`() = CypherTestSuite("movie-tests.adoc", neo4j).generateTests() + fun `movie-tests`() = CypherTestSuite("movie-tests.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `property-tests`() = CypherTestSuite("property-tests.adoc", neo4j).generateTests() + fun `property-tests`() = CypherTestSuite("property-tests.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `translator-tests1`() = CypherTestSuite("translator-tests1.adoc", neo4j).generateTests() + fun `translator-tests1`() = CypherTestSuite("translator-tests1.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `translator-tests2`() = CypherTestSuite("translator-tests2.adoc", neo4j).generateTests() + fun `translator-tests2`() = CypherTestSuite("translator-tests2.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `translator-tests3`() = CypherTestSuite("translator-tests3.adoc", neo4j).generateTests() + fun `translator-tests3`() = CypherTestSuite("translator-tests3.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory fun `translator-tests-custom-scalars`() = - CypherTestSuite("translator-tests-custom-scalars.adoc", neo4j).generateTests() + CypherTestSuite("translator-tests-custom-scalars.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `optimized-query-for-filter`() = CypherTestSuite("optimized-query-for-filter.adoc", neo4j).generateTests() + fun `optimized-query-for-filter`() = CypherTestSuite("optimized-query-for-filter.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `custom-fields`() = CypherTestSuite("custom-fields.adoc", neo4j).generateTests() + fun `custom-fields`() = CypherTestSuite("custom-fields.adoc", driver).generateTests() @Disabled("This test is disabled because it is not yet migrated") @TestFactory - fun `test issues`() = createTestsInPath("issues", { CypherTestSuite(it, neo4j).generateTests() }) + fun `test issues`() = createTestsInPath("issues", { CypherTestSuite(it, driver).generateTests() }) @TestFactory fun `new cypher tck tests v2`() = - createTestsInPath("tck-test-files/cypher/v2", { CypherTestSuite(it, neo4j).generateTests() }) + createTestsInPath("tck-test-files/cypher/v2", { CypherTestSuite(it, driver).generateTests() }) @TestFactory fun `integration-tests`() = - createTestsInPath("integration-test-files", { CypherTestSuite(it, neo4j, createMissingBlocks = false).generateTests() }) + createTestsInPath( + "integration-test-files", + { CypherTestSuite(it, driver, createMissingBlocks = false).generateTests() }) companion object { private val INTEGRATION_TESTS = System.getProperty("neo4j-graphql-java.integration-tests", "false") == "true" diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver.kt new file mode 100644 index 00000000..1d90ae5b --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver.kt @@ -0,0 +1,21 @@ +package org.neo4j.graphql.custom_resolver + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment + +@TestDataFetcher(type = "Author", field = "publicationsWithAuthor") +object ArrayFieldCustomResolver : DataFetcher> { + override fun get(environment: DataFetchingEnvironment): List { + val source = environment.getSource>() + val name = source?.get("name") + val publications = source?.get("publications") as? List<*> + + return publications + ?.filterIsInstance>() + ?.map { publication -> + val title = publication["title"] ?: publication["subject"] + "$title by $name" + } + ?: emptyList() + } +} diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver2.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver2.kt new file mode 100644 index 00000000..9bac8359 --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver2.kt @@ -0,0 +1,22 @@ +package org.neo4j.graphql.custom_resolver + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment + +@TestDataFetcher(type = "Author", field = "publicationsWithAuthor") +object ArrayFieldCustomResolver2 : DataFetcher> { + override fun get(environment: DataFetchingEnvironment): List { + val source = environment.getSource>() + val name = source?.get("name") + val publications = source?.get("publications") as? List<*> + + return publications + ?.filterIsInstance>() + ?.map { publication -> + val title = publication["title"] ?: publication["subject"] + val publicationYear = publication["publicationYear"] + "$title by $name in $publicationYear" + } + ?: emptyList() + } +} diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver.kt new file mode 100644 index 00000000..a65377d5 --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver.kt @@ -0,0 +1,16 @@ +package org.neo4j.graphql.custom_resolver + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment + +@TestDataFetcher(type = "User", field = "fullName") +object ComplexFieldCustomResolver : DataFetcher { + override fun get(environment: DataFetchingEnvironment): String { + val source = environment.getSource>() + val firstName = source?.get("firstName") + val lastName = source?.get("lastName") + val address = source?.get("address") as? Map<*, *> + val city = address?.get("city") + return "$firstName $lastName from $city" + } +} diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver2.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver2.kt new file mode 100644 index 00000000..0d390492 --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver2.kt @@ -0,0 +1,21 @@ +package org.neo4j.graphql.custom_resolver + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment + +@TestDataFetcher(type = "User", field = "fullName") +object ComplexFieldCustomResolver2 : DataFetcher { + override fun get(environment: DataFetchingEnvironment): String { + val source = environment.getSource>() + val firstName = source?.get("firstName") + val lastName = source?.get("lastName") + + val address = source?.get("address") as? Map<*, *> + + val city = address?.get("city") as? Map<*, *> + val name = city?.get("name") + val population = city?.get("population") + + return "$firstName $lastName from $name with population of $population" + } +} diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver3.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver3.kt new file mode 100644 index 00000000..715152c9 --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver3.kt @@ -0,0 +1,24 @@ +package org.neo4j.graphql.custom_resolver + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment + +@TestDataFetcher(type = "User", field = "fullName") +object ComplexFieldCustomResolver3 : DataFetcher { + override fun get(environment: DataFetchingEnvironment): String { + val source = environment.getSource>() + val firstName = source?.get("firstName") + val lastName = source?.get("lastName") + + val address = source?.get("address") as? Map<*, *> + + val city = address?.get("city") as? Map<*, *> + val name = city?.get("name") + val population = city?.get("population") + + val state = city?.get("state") as? Map<*, *> + val someValue = state?.get("someValue") + + return "$firstName $lastName from $name with population of $population with $someValue" + } +} diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/FieldFromInterfaceCustomResolver.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/FieldFromInterfaceCustomResolver.kt new file mode 100644 index 00000000..47463317 --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/FieldFromInterfaceCustomResolver.kt @@ -0,0 +1,34 @@ +package org.neo4j.graphql.custom_resolver + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment + +@TestDataFetcher(type = "User", field = "customResolverField") +object FieldFromInterfaceCustomResolver : DataFetcher { + override fun get(environment: DataFetchingEnvironment): Int { + val source = environment.getSource>() + var count = 0 + + val firstName = source?.get("firstName") as String + val followedAuthors = source["followedAuthors"] as List<*> + count += firstName.length + followedAuthors + .filterIsInstance>() + .forEach { author -> + val name = author["name"] as String + val publications = author["publications"] as List<*> + count += name.length + publications + .filterIsInstance>() + .forEach { publication -> + val publicationName = publication["name"] as? String + val subject = publication["subject"] as? String + val publicationYear = publication["publicationYear"] as Number + publicationName?.let { count += it.length } + subject?.let { count += it.length } + count += publicationYear.toInt() + } + } + return count + } +} diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/FieldFromUnionCustomResolver.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/FieldFromUnionCustomResolver.kt new file mode 100644 index 00000000..e06cc612 --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/FieldFromUnionCustomResolver.kt @@ -0,0 +1,29 @@ +package org.neo4j.graphql.custom_resolver + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment + +@TestDataFetcher(type = "User", field = "customResolverField") +object FieldFromUnionCustomResolver : DataFetcher { + override fun get(environment: DataFetchingEnvironment): Int { + val source = environment.getSource>() + var count = 0 + + val firstName = source?.get("firstName") as String + val followedAuthors = source["followedAuthors"] as List<*> + count += firstName.length + followedAuthors.forEach { author -> + author as Map<*, *> + count += (author["name"] as String).length + val publications = author["publications"] as List<*> + publications.forEach { publication -> + publication as Map<*, *> + val publicationName = publication["name"] as? String + val subject = publication["subject"] as? String + publicationName?.let { count += it.length } + subject?.let { count += it.length } + } + } + return count + } +} diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ScalarFieldCustomResolver.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ScalarFieldCustomResolver.kt new file mode 100644 index 00000000..b61bc1f1 --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/ScalarFieldCustomResolver.kt @@ -0,0 +1,14 @@ +package org.neo4j.graphql.custom_resolver + +import graphql.schema.DataFetcher +import graphql.schema.DataFetchingEnvironment + +@TestDataFetcher(type = "User", field = "fullName") +object ScalarFieldCustomResolver : DataFetcher { + override fun get(environment: DataFetchingEnvironment): String { + val source = environment.getSource>() + val firstName = source?.get("firstName") + val lastName = source?.get("lastName") + return "$firstName $lastName" + } +} diff --git a/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/TestDataFetcher.kt b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/TestDataFetcher.kt new file mode 100644 index 00000000..c75828b1 --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/custom_resolver/TestDataFetcher.kt @@ -0,0 +1,7 @@ +package org.neo4j.graphql.custom_resolver + +@Target(AnnotationTarget.CLASS) +annotation class TestDataFetcher( + val type: String, + val field: String, +) diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt index 43c05417..ee55e85d 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt @@ -1,6 +1,10 @@ package org.neo4j.graphql.utils +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.databind.JsonSerializer import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializerProvider +import com.fasterxml.jackson.databind.module.SimpleModule import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.module.kotlin.registerKotlinModule import com.intellij.rt.execution.junit.FileComparisonFailure @@ -11,6 +15,7 @@ import org.junit.jupiter.api.DynamicNode import org.junit.jupiter.api.DynamicTest import java.io.File import java.io.FileWriter +import java.time.temporal.TemporalAmount import java.util.* import java.util.stream.Stream import kotlin.reflect.KMutableProperty1 @@ -34,7 +39,7 @@ abstract class AsciiDocTestSuite( } - private val srcLocation = File("src/test/resources/", fileName).toURI() + protected val srcLocation = File("src/test/resources/", fileName).toURI() private val document = AsciiDocParser(fileName).parse() @@ -84,6 +89,12 @@ abstract class AsciiDocTestSuite( } + is Table -> { + if (testCase != null){ + setTableData(testCase, node) + } + } + is Block -> { val blockContent = node.content.trim() if (blockContent.startsWith("CAUTION:")) { @@ -117,6 +128,8 @@ abstract class AsciiDocTestSuite( abstract fun createTests(testCase: T, section: Section, ignoreReason: String?): List + open fun setTableData(testCase: T, table: Table) {} + private fun flatten(stream: Stream, name: String): Stream { return stream.flatMap { when (it) { @@ -216,7 +229,14 @@ abstract class AsciiDocTestSuite( val MAPPER = ObjectMapper() .registerKotlinModule() .registerModules(JavaTimeModule()) + .registerModule(SimpleModule().addSerializer(TemporalAmount::class.java, object : JsonSerializer() { + override fun serialize(value: TemporalAmount?, gen: JsonGenerator?, serializers: SerializerProvider?) { + gen?.writeString(value.toString()) + } + })) .disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS) + fun String.parseJsonMap(): Map = this.let { @Suppress("UNCHECKED_CAST") diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt index d31859d2..74c3aa8c 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt @@ -1,13 +1,18 @@ package org.neo4j.graphql.utils +import com.jayway.jsonpath.JsonPath import demo.org.neo4j.graphql.utils.InvalidQueryException import demo.org.neo4j.graphql.utils.asciidoc.ast.CodeBlock import demo.org.neo4j.graphql.utils.asciidoc.ast.Section +import demo.org.neo4j.graphql.utils.asciidoc.ast.Table import graphql.ExceptionWhileDataFetching import graphql.ExecutionInput import graphql.GraphQL import graphql.GraphQLError import graphql.execution.NonNullableFieldWasNullError +import graphql.schema.DataFetcher +import graphql.schema.FieldCoordinates +import graphql.schema.GraphQLCodeRegistry import graphql.schema.GraphQLSchema import org.assertj.core.api.Assertions import org.assertj.core.api.InstanceOfAssertFactories @@ -19,15 +24,17 @@ import org.neo4j.cypherdsl.core.renderer.Dialect import org.neo4j.cypherdsl.core.renderer.Renderer import org.neo4j.cypherdsl.parser.CypherParser import org.neo4j.cypherdsl.parser.Options -import org.neo4j.driver.internal.InternalIsoDuration -import org.neo4j.driver.types.IsoDuration +import org.neo4j.driver.Driver import org.neo4j.graphql.QueryContext import org.neo4j.graphql.SchemaBuilder import org.neo4j.graphql.SchemaConfig +import org.neo4j.graphql.custom_resolver.TestDataFetcher import org.neo4j.graphql.driver.adapter.Neo4jAdapter +import org.neo4j.graphql.driver.adapter.Neo4jDriverAdapter import org.neo4j.graphql.scalars.TemporalScalar -import org.neo4j.harness.Neo4j import org.opentest4j.AssertionFailedError +import org.threeten.extra.PeriodDuration +import java.io.File import java.math.BigInteger import java.time.* import java.time.format.DateTimeFormatter @@ -36,10 +43,10 @@ import java.time.temporal.TemporalAccessor import java.util.* import java.util.concurrent.FutureTask import java.util.function.Consumer -import java.util.regex.Matcher import java.util.regex.Pattern +import kotlin.reflect.full.findAnnotation -class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingBlocks: Boolean = true) : +class CypherTestSuite(fileName: String, val driver: Driver? = null, createMissingBlocks: Boolean = true) : AsciiDocTestSuite( fileName, listOf( @@ -57,11 +64,13 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB var schema: CodeBlock, var schemaConfig: CodeBlock?, var testData: List, + var customResolver: CodeBlock?, var cypher: MutableList = mutableListOf(), var cypherParams: MutableList = mutableListOf(), var graphqlRequest: CodeBlock? = null, var graphqlRequestVariables: CodeBlock? = null, var graphqlResponse: CodeBlock? = null, + var graphqlResponseAssertions: Table? = null, var queryConfig: CodeBlock? = null, ) @@ -71,8 +80,15 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB val schema = findSetupCodeBlocks(section, "graphql", mapOf("schema" to "true")).firstOrNull() ?: return null val schemaConfig = findSetupCodeBlocks(section, "json", mapOf("schema-config" to "true")).firstOrNull() val testData = findSetupCodeBlocks(section, "cypher", mapOf("test-data" to "true")) + val customResolver = findSetupCodeBlocks(section, "kotlin").firstOrNull() - return TestCase(schema, schemaConfig, testData) + return TestCase(schema, schemaConfig, testData, customResolver) + } + + override fun setTableData(testCase: TestCase, table: Table) { + if (table.attributes.containsKey("response")) { + testCase.graphqlResponseAssertions = table + } } override fun createTests(testCase: TestCase, section: Section, ignoreReason: String?): List { @@ -92,15 +108,16 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB tests.add(printGeneratedQuery(result)) tests.add(printReplacedParameter(result)) } - if (neo4j != null) { + if (driver != null) { val testData = testCase.testData.firstOrNull() + val responseAssertions = testCase.graphqlResponseAssertions var response = testCase.graphqlResponse - if (response == null) { + if (responseAssertions == null && response == null) { response = createCodeBlock(testCase.graphqlRequest!!, "json", "GraphQL-Response", mapOf("response" to "true")) testCase.graphqlResponse = response } - if (testData != null && response != null) { + if (testData != null && response != null || responseAssertions != null) { tests.add(integrationTest(section.title, testCase)) } } @@ -139,13 +156,44 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB private fun createSchema( schemaBlock: CodeBlock, schemaConfigBlock: CodeBlock?, + customResolver: CodeBlock?, neo4jAdapter: Neo4jAdapter = Neo4jAdapter.NO_OP ): GraphQLSchema { val schemaString = schemaBlock.content val schemaConfig = schemaConfigBlock?.content ?.let { return@let MAPPER.readValue(it, SchemaConfig::class.java) } ?: SchemaConfig() - return SchemaBuilder.buildSchema(schemaString, schemaConfig, neo4jAdapter) + val codeRegistryBuilder = GraphQLCodeRegistry.newCodeRegistry() + + customResolver?.let { registerTestResolver(it, codeRegistryBuilder) } + + return SchemaBuilder.fromSchema(schemaString, schemaConfig) + .withNeo4jAdapter(neo4jAdapter) + .withCodeRegistryBuilder(codeRegistryBuilder) + .build() + } + + private fun registerTestResolver( + customResolver: CodeBlock, + codeRegistryBuilder: GraphQLCodeRegistry.Builder + ) { + val path = customResolver.content.removePrefix("include::").replace("[]", "") + if (path == customResolver.content) { + error("Custom resolver must be an include statement") + } + val resolvedFile = srcLocation.resolve(path) + val className = File(resolvedFile) + .toRelativeString(File("src/test/kotlin").absoluteFile) + .replace(".kt", "") + .replace("/", ".") + + val clazz = Class.forName(className).kotlin + clazz.findAnnotation()?.let { annot -> + codeRegistryBuilder.dataFetcher( + FieldCoordinates.coordinates(annot.type, annot.field), + clazz.objectInstance as DataFetcher<*> + ) + } } private fun createTransformationTask(testCase: TestCase): () -> List { @@ -153,15 +201,23 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB val cypherResults = mutableListOf() - val schema = createSchema(testCase.schema, testCase.schemaConfig, object : Neo4jAdapter { + val schema = + createSchema( + testCase.schema, + testCase.schemaConfig, + testCase.customResolver, + object : Neo4jAdapter { - override fun getDialect(): Neo4jAdapter.Dialect = Neo4jAdapter.Dialect.NEO4J_5 + override fun getDialect(): Neo4jAdapter.Dialect = Neo4jAdapter.Dialect.NEO4J_5 - override fun executeQuery(cypher: String, params: Map): List> { - cypherResults.add(CypherResult(cypher, params)) - return emptyList() - } - }) + override fun executeQuery( + cypher: String, + params: Map + ): List> { + cypherResults.add(CypherResult(cypher, params)) + return emptyList() + } + }) val request = testCase.graphqlRequest!!.content @@ -169,7 +225,12 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB ?: emptyMap() val queryContext = testCase.queryConfig?.content - ?.let { config -> return@let MAPPER.readValue(config, QueryContext::class.java) } + ?.let { config -> + return@let MAPPER.readValue( + config, + QueryContext::class.java + ) + } ?: QueryContext() val gql: GraphQL = GraphQL.newGraphQL(schema).build() @@ -208,7 +269,10 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB var queryWithReplacedParams = it.query it.params.forEach { (key, value) -> queryWithReplacedParams = - queryWithReplacedParams.replace("$$key", if (value is String) "'$value'" else value.toString()) + queryWithReplacedParams.replace( + "$$key", + if (value is String) "'$value'" else value.toString() + ) } println() println("Generated query with params replaced") @@ -310,27 +374,26 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB testCase: TestCase, ): DynamicNode { val graphqlResponse = testCase.graphqlResponse - ?: error("missing graphql response for $title") - - return DynamicTest.dynamicTest("Integration Test", graphqlResponse.uri) { - val neo4jAdapter = when { - neo4j != null -> { - val database = neo4j.defaultDatabaseService() - database.executeTransactionally("MATCH (n) DETACH DELETE n") - // load the test data + val graphqlResponseAssertions = testCase.graphqlResponseAssertions + + val uri = graphqlResponseAssertions?.uri ?: graphqlResponse?.uri + ?: error("missing graphql response for $title") + + return DynamicTest.dynamicTest("Integration Test", uri) { + val neo4jAdapter = if (driver == null) { + Neo4jAdapter.NO_OP + } else { + driver.session().use { session -> + // clear the database + session.run("MATCH (n) DETACH DELETE n") + + // import test data testCase.testData.firstOrNull()?.content ?.split(";") ?.filter { it.isNotBlank() } - ?.forEach { database.executeTransactionally(it) } - object : Neo4jAdapter { - override fun executeQuery(cypher: String, params: Map): List> { - // execute the query - return database.executeTransactionally(cypher, params) { it.stream().toList() } - } - } + ?.forEach { query -> session.run(query) } } - - else -> Neo4jAdapter.NO_OP + Neo4jDriverAdapter(driver) } val request = testCase.graphqlRequest?.content @@ -340,11 +403,16 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB testCase.graphqlRequestVariables?.content?.parseJsonMap() ?: emptyMap() val queryContext = testCase.queryConfig?.content - ?.let { config -> return@let MAPPER.readValue(config, QueryContext::class.java) } + ?.let { config -> + return@let MAPPER.readValue( + config, + QueryContext::class.java + ) + } ?: QueryContext() - val schema = createSchema(testCase.schema, testCase.schemaConfig, neo4jAdapter) + val schema = createSchema(testCase.schema, testCase.schemaConfig, testCase.customResolver, neo4jAdapter) val graphql = GraphQL.newGraphQL(schema).build() val result = graphql.execute( ExecutionInput.newExecutionInput() @@ -361,23 +429,63 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB Assertions.fail(result.errors.joinToString("\n") { it.message }, exception) } + val values = result?.getData() - if (graphqlResponse.content.isEmpty()) { - val actualCode = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(values) - graphqlResponse.generatedContent = actualCode - } else { - val expected = fixNumbers(graphqlResponse.content.parseJsonMap()) - val actual = fixNumber(values) - if (!Objects.equals(expected, actual)) { + if (graphqlResponseAssertions != null) { + assertWithJsonPath(graphqlResponseAssertions, values) + } else if (graphqlResponse != null) { + + if (graphqlResponse.content.isEmpty()) { val actualCode = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(values) graphqlResponse.generatedContent = actualCode - } - if (graphqlResponse.attributes.containsKey("ignore-order")) { - assertEqualIgnoreOrder(expected, actual) } else { - Assertions.assertThat(actual).isEqualTo(expected) + val expected = fixNumbers(graphqlResponse.content.parseJsonMap()) + val actual = fixNumber(values) + if (!Objects.equals(expected, actual)) { + val actualCode = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(values) + graphqlResponse.generatedContent = actualCode + } + if (graphqlResponse.attributes.containsKey("ignore-order")) { + assertEqualIgnoreOrder(expected, actual) + } else { + Assertions.assertThat(actual).isEqualTo(expected) + } + } + } + } + } + + private fun assertWithJsonPath(table: Table, result: Any?) { + for (record in table.records) { + val jsonPath = record.get("Path") + val condition = record.get("Condition") + val expectedValue = record.get("Expected Value") + + val actualValue = JsonPath.read(result, jsonPath) + + // try to convert the expected value to the type of the current value + val typedExpectedValue = if (expectedValue.isNullOrBlank()) { + null + } else when (actualValue) { + is Int -> expectedValue.toInt() + else -> expectedValue + } + + val assertion = Assertions.assertThat(actualValue).describedAs(jsonPath) + when (condition) { + "==" -> assertion.isEqualTo(typedExpectedValue) + "notEmpty" -> { + if (actualValue is Collection<*>) { + assertion.asInstanceOf(InstanceOfAssertFactories.COLLECTION).isNotEmpty() + } else if (actualValue is String) { + assertion.asInstanceOf(InstanceOfAssertFactories.STRING).isNotEmpty() + } else { + TODO() + } } + + else -> TODO("$condition not implemented") } } } @@ -485,11 +593,19 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB } catch (ignore: DateTimeParseException) { } try { - parseDuration(expected)?.let { expectedDuration -> - parseDuration(actual as String)?.let { actualDuration -> - Assertions.assertThat(actualDuration).isEqualTo(expectedDuration) - return + PeriodDuration.parse(expected)?.let { expectedDuration -> + when (actual) { + is PeriodDuration -> Assertions.assertThat(actual).isEqualTo(expectedDuration) + is Period -> Assertions.assertThat(PeriodDuration.of(actual)) + .isEqualTo(expectedDuration) + + is Duration -> Assertions.assertThat(PeriodDuration.of(actual)) + .isEqualTo(expectedDuration) + + is String -> Assertions.assertThat(actual).isEqualTo(expected) + else -> Assertions.fail("Unexpected type ${actual!!::class.java}") } + return } } catch (ignore: DateTimeParseException) { } @@ -563,18 +679,5 @@ class CypherTestSuite(fileName: String, val neo4j: Neo4j? = null, createMissingB CONVERT_NUMBER && this == toLong().toDouble() -> toLong() else -> this } - - private fun parseDuration(text: String): IsoDuration? { - val matcher: Matcher = DURATION_PATTERN.matcher(text) - if (!matcher.find()) { - return null - } - val periodString = matcher.group(1) - val timeString = matcher.group(2) - val period = if (!periodString.isNullOrBlank()) Period.parse("P$periodString") else Period.ZERO - val duration = if (!timeString.isNullOrBlank()) Duration.parse("PT$timeString") else Duration.ZERO - return InternalIsoDuration(period.toTotalMonths(), period.days.toLong(), duration.seconds, duration.nano) - } - } } diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/AsciiDocParser.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/AsciiDocParser.kt index 800362ec..75d2e5bc 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/AsciiDocParser.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/AsciiDocParser.kt @@ -1,6 +1,7 @@ package demo.org.neo4j.graphql.utils.asciidoc import demo.org.neo4j.graphql.utils.asciidoc.ast.* +import org.apache.commons.csv.CSVFormat import java.io.File import java.net.URI import java.util.regex.Pattern @@ -23,6 +24,7 @@ class AsciiDocParser( var title: String? var insideCodeblock = false + var insideTable = false var offset = 0 val fileContent = StringBuilder() @@ -33,6 +35,7 @@ class AsciiDocParser( var caption: String? = null var currentCodeBlock: CodeBlock? = null + var currentTable: Table? = null var content = StringBuilder() @@ -60,6 +63,23 @@ class AsciiDocParser( caption = line.substring(1).trim() } + line.startsWith("[%header,format=csv") -> { + addBlock(content) + val uri = UriBuilder.fromUri(srcLocation).queryParam("line", lineNr + 1).build() + + val parts = line.substring(19, line.indexOf("]")).trim().split(",") + val attributes = parts.slice(0.. { addBlock(content) val uri = UriBuilder.fromUri(srcLocation).queryParam("line", lineNr + 1).build() @@ -83,6 +103,22 @@ class AsciiDocParser( currentSection.blocks.add(ThematicBreak()) } + line == "|===" -> { + insideTable = !insideTable + if (insideTable) { + currentTable?.start = offset + line.length + 1 + content = StringBuilder() + } else if (currentTable != null) { + currentTable.end = offset + currentTable.records = CSVFormat.Builder.create().setHeader() + .setSkipHeaderRecord(true) + .build() + .parse(content.toString().trim().reader()).use { it.records } + currentTable = null + content = StringBuilder() + } + } + line == "----" -> { insideCodeblock = !insideCodeblock if (insideCodeblock) { diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/ast/Table.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/ast/Table.kt new file mode 100644 index 00000000..b7395a3d --- /dev/null +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/ast/Table.kt @@ -0,0 +1,19 @@ +package demo.org.neo4j.graphql.utils.asciidoc.ast + +import org.apache.commons.csv.CSVRecord +import java.net.URI + +class Table( + val uri: URI, + override val parent: Section, + val attributes: Map +) : StructuralNode(parent) { + + lateinit var records: List + + var caption: String? = null + + var start: Int? = null + var end: Int? = null + +} diff --git a/core/src/test/resources/integration-test-files/aliasing.adoc b/core/src/test/resources/integration-test-files/aliasing.adoc new file mode 100644 index 00000000..5648eaba --- /dev/null +++ b/core/src/test/resources/integration-test-files/aliasing.adoc @@ -0,0 +1,198 @@ +:toc: +:toclevels: 42 + += Aliasing + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID! + budget: Int! + boxOffice: Float! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie) + SET movie += {id: "RandomString1", boxOffice: 465.3, budget: 63} +---- + +== should correctly alias an ID field + +.GraphQL-Query +[source,graphql] +---- +query ($id: ID!) { + movies(where: {id: $id}) { + aliased: id + budget + boxOffice + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id = $param0 +RETURN this { + aliased: this.id, + .budget, + .boxOffice +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "aliased": "RandomString1", + "budget": 63, + "boxOffice": 465.3 + } + ] +} +---- + +''' + +== should correctly alias an Int field + +.GraphQL-Query +[source,graphql] +---- +query ($id: ID!) { + movies(where: {id: $id}) { + id + aliased: budget + boxOffice + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id = $param0 +RETURN this { + .id, + aliased: this.budget, + .boxOffice +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "aliased": 63, + "boxOffice": 465.3 + } + ] +} +---- + +''' + +== should correctly alias an Float field + +.GraphQL-Query +[source,graphql] +---- +query ($id: ID!) { + movies(where: {id: $id}) { + id + budget + aliased: boxOffice + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id = $param0 +RETURN this { + .id, + .budget, + aliased: this.boxOffice +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "budget": 63, + "aliased": 465.3 + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/config-options/query-options.adoc b/core/src/test/resources/integration-test-files/config-options/query-options.adoc new file mode 100644 index 00000000..2e446771 --- /dev/null +++ b/core/src/test/resources/integration-test-files/config-options/query-options.adoc @@ -0,0 +1,86 @@ +:toc: +:toclevels: 42 + += query options + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Movie { + id: ID! + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +== queries should work with runtime set to interpreted + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1"}), (:Movie {id: "RandomString1"}), (:Movie {id: "RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($id: ID) { + movies(where: {id: $id}) { + id + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id = $param0 +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1" + }, + { + "id": "RandomString1" + }, + { + "id": "RandomString1" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/config-options/startup-validation.adoc b/core/src/test/resources/integration-test-files/config-options/startup-validation.adoc new file mode 100644 index 00000000..af65a318 --- /dev/null +++ b/core/src/test/resources/integration-test-files/config-options/startup-validation.adoc @@ -0,0 +1,833 @@ +:toc: +:toclevels: 42 + += Startup Validation + +== should not throw an error for valid type defs when running startup validation + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID! + firstName: String! + lastName: String! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + firstName: String! + id: ID! + lastName: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + firstName: SortDirection + id: SortDirection + lastName: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + firstName: String + firstName_CONTAINS: String + firstName_ENDS_WITH: String + firstName_IN: [String!] + firstName_STARTS_WITH: String + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID!] + id_STARTS_WITH: ID + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + +== should not throw an error for invalid type defs when validate is false + +.Schema +[source,graphql,schema=true] +---- +type Point { + latitude: Float! + longitude: Float! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Point { + latitude: Float! + longitude: Float! +} + +type PointEdge { + cursor: String! + node: Point! +} + +input PointOptions { + limit: Int + offset: Int + """ + Specify one or more PointSort objects to sort Points by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [PointSort!] +} + +""" +Fields to sort Points by. The order in which sorts are applied is not guaranteed when specifying many fields in one PointSort object. +""" +input PointSort { + latitude: SortDirection + longitude: SortDirection +} + +input PointWhere { + AND: [PointWhere!] + NOT: PointWhere + OR: [PointWhere!] + latitude: Float + latitude_GT: Float + latitude_GTE: Float + latitude_IN: [Float!] + latitude_LT: Float + latitude_LTE: Float + longitude: Float + longitude_GT: Float + longitude_GTE: Float + longitude_IN: [Float!] + longitude_LT: Float + longitude_LTE: Float +} + +type PointsConnection { + edges: [PointEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + points(options: PointOptions, where: PointWhere): [Point!]! + pointsConnection(after: String, first: Int, sort: [PointSort], where: PointWhere): PointsConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} +---- + +''' + +== @customResolver + +=== should warn for missing custom resolvers + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID! + firstName: String! + lastName: String! + fullName: String @customResolver(requires: "firstName lastName") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + firstName: String! + fullName: String + id: ID! + lastName: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + firstName: SortDirection + id: SortDirection + lastName: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + firstName: String + firstName_CONTAINS: String + firstName_ENDS_WITH: String + firstName_IN: [String!] + firstName_STARTS_WITH: String + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID!] + id_STARTS_WITH: ID + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + +=== should throw no errors when validate is false, but warn for custom resolvers + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID! + firstName: String! + lastName: String! + fullName: String @customResolver(requires: "firstName lastName") +} + +type Point { + latitude: Float! + longitude: Float! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Point { + latitude: Float! + longitude: Float! +} + +type PointEdge { + cursor: String! + node: Point! +} + +input PointOptions { + limit: Int + offset: Int + """ + Specify one or more PointSort objects to sort Points by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [PointSort!] +} + +""" +Fields to sort Points by. The order in which sorts are applied is not guaranteed when specifying many fields in one PointSort object. +""" +input PointSort { + latitude: SortDirection + longitude: SortDirection +} + +input PointWhere { + AND: [PointWhere!] + NOT: PointWhere + OR: [PointWhere!] + latitude: Float + latitude_GT: Float + latitude_GTE: Float + latitude_IN: [Float!] + latitude_LT: Float + latitude_LTE: Float + longitude: Float + longitude_GT: Float + longitude_GTE: Float + longitude_IN: [Float!] + longitude_LT: Float + longitude_LTE: Float +} + +type PointsConnection { + edges: [PointEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + points(options: PointOptions, where: PointWhere): [Point!]! + pointsConnection(after: String, first: Int, sort: [PointSort], where: PointWhere): PointsConnection! + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + firstName: String! + fullName: String + id: ID! + lastName: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + firstName: SortDirection + id: SortDirection + lastName: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + firstName: String + firstName_CONTAINS: String + firstName_ENDS_WITH: String + firstName_IN: [String!] + firstName_STARTS_WITH: String + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID!] + id_STARTS_WITH: ID + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + +== should not throw an error for duplicate relationship fields validate is false + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID! + firstName: String! + lastName: String! + friend1: User! @relationship(type: "FRIENDS_WITH", direction: IN) + friend2: User! @relationship(type: "FRIENDS_WITH", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + firstName: String! + friend1(directed: Boolean = true, options: UserOptions, where: UserWhere): User! + friend1Connection(after: String, directed: Boolean = true, first: Int, sort: [UserFriend1ConnectionSort!], where: UserFriend1ConnectionWhere): UserFriend1Connection! + friend2(directed: Boolean = true, options: UserOptions, where: UserWhere): User! + friend2Connection(after: String, directed: Boolean = true, first: Int, sort: [UserFriend2ConnectionSort!], where: UserFriend2ConnectionWhere): UserFriend2Connection! + id: ID! + lastName: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserFriend1Connection { + edges: [UserFriend1Relationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input UserFriend1ConnectionSort { + node: UserSort +} + +input UserFriend1ConnectionWhere { + AND: [UserFriend1ConnectionWhere!] + NOT: UserFriend1ConnectionWhere + OR: [UserFriend1ConnectionWhere!] + node: UserWhere +} + +type UserFriend1Relationship { + cursor: String! + node: User! +} + +type UserFriend2Connection { + edges: [UserFriend2Relationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input UserFriend2ConnectionSort { + node: UserSort +} + +input UserFriend2ConnectionWhere { + AND: [UserFriend2ConnectionWhere!] + NOT: UserFriend2ConnectionWhere + OR: [UserFriend2ConnectionWhere!] + node: UserWhere +} + +type UserFriend2Relationship { + cursor: String! + node: User! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + firstName: SortDirection + id: SortDirection + lastName: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + firstName: String + firstName_CONTAINS: String + firstName_ENDS_WITH: String + firstName_IN: [String!] + firstName_STARTS_WITH: String + friend1: UserWhere + friend1Connection: UserFriend1ConnectionWhere + friend1Connection_NOT: UserFriend1ConnectionWhere + friend1_NOT: UserWhere + friend2: UserWhere + friend2Connection: UserFriend2ConnectionWhere + friend2Connection_NOT: UserFriend2ConnectionWhere + friend2_NOT: UserWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID!] + id_STARTS_WITH: ID + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + +== should throw no errors when validate is false + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID! + firstName: String! + lastName: String! + fullName: String @customResolver(requires: "firstName lastName") + friend1: User! @relationship(type: "FRIENDS_WITH", direction: IN) + friend2: User! @relationship(type: "FRIENDS_WITH", direction: IN) +} + +type Point { + latitude: Float! + longitude: Float! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Point { + latitude: Float! + longitude: Float! +} + +type PointEdge { + cursor: String! + node: Point! +} + +input PointOptions { + limit: Int + offset: Int + """ + Specify one or more PointSort objects to sort Points by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [PointSort!] +} + +""" +Fields to sort Points by. The order in which sorts are applied is not guaranteed when specifying many fields in one PointSort object. +""" +input PointSort { + latitude: SortDirection + longitude: SortDirection +} + +input PointWhere { + AND: [PointWhere!] + NOT: PointWhere + OR: [PointWhere!] + latitude: Float + latitude_GT: Float + latitude_GTE: Float + latitude_IN: [Float!] + latitude_LT: Float + latitude_LTE: Float + longitude: Float + longitude_GT: Float + longitude_GTE: Float + longitude_IN: [Float!] + longitude_LT: Float + longitude_LTE: Float +} + +type PointsConnection { + edges: [PointEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + points(options: PointOptions, where: PointWhere): [Point!]! + pointsConnection(after: String, first: Int, sort: [PointSort], where: PointWhere): PointsConnection! + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + firstName: String! + friend1(directed: Boolean = true, options: UserOptions, where: UserWhere): User! + friend1Connection(after: String, directed: Boolean = true, first: Int, sort: [UserFriend1ConnectionSort!], where: UserFriend1ConnectionWhere): UserFriend1Connection! + friend2(directed: Boolean = true, options: UserOptions, where: UserWhere): User! + friend2Connection(after: String, directed: Boolean = true, first: Int, sort: [UserFriend2ConnectionSort!], where: UserFriend2ConnectionWhere): UserFriend2Connection! + fullName: String + id: ID! + lastName: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserFriend1Connection { + edges: [UserFriend1Relationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input UserFriend1ConnectionSort { + node: UserSort +} + +input UserFriend1ConnectionWhere { + AND: [UserFriend1ConnectionWhere!] + NOT: UserFriend1ConnectionWhere + OR: [UserFriend1ConnectionWhere!] + node: UserWhere +} + +type UserFriend1Relationship { + cursor: String! + node: User! +} + +type UserFriend2Connection { + edges: [UserFriend2Relationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input UserFriend2ConnectionSort { + node: UserSort +} + +input UserFriend2ConnectionWhere { + AND: [UserFriend2ConnectionWhere!] + NOT: UserFriend2ConnectionWhere + OR: [UserFriend2ConnectionWhere!] + node: UserWhere +} + +type UserFriend2Relationship { + cursor: String! + node: User! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + firstName: SortDirection + id: SortDirection + lastName: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + firstName: String + firstName_CONTAINS: String + firstName_ENDS_WITH: String + firstName_IN: [String!] + firstName_STARTS_WITH: String + friend1: UserWhere + friend1Connection: UserFriend1ConnectionWhere + friend1Connection_NOT: UserFriend1ConnectionWhere + friend1_NOT: UserWhere + friend2: UserWhere + friend2Connection: UserFriend2ConnectionWhere + friend2Connection_NOT: UserFriend2ConnectionWhere + friend2_NOT: UserWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID!] + id_STARTS_WITH: ID + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/connection-resolvers.adoc b/core/src/test/resources/integration-test-files/connection-resolvers.adoc new file mode 100644 index 00000000..39968d8d --- /dev/null +++ b/core/src/test/resources/integration-test-files/connection-resolvers.adoc @@ -0,0 +1,128 @@ +:toc: +:toclevels: 42 + += Connection Resolvers + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Actor { + id: ID + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} + +type Movie { + id: ID + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} +---- + +== should return a total count of zero and correct pageInfo if no edges + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie { id: "RandomString1" }) +---- + +.GraphQL-Query +[source,graphql] +---- +query GetMovie($movieId: ID) { + movies(where: {id: $movieId}) { + id + actorsConnection { + totalCount + pageInfo { + startCursor + endCursor + hasNextPage + hasPreviousPage + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "movieId": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + .id, + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "actorsConnection": { + "totalCount": 0, + "pageInfo": { + "startCursor": null, + "endCursor": null, + "hasNextPage": false, + "hasPreviousPage": false + } + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/connections/alias.adoc b/core/src/test/resources/integration-test-files/connections/alias.adoc new file mode 100644 index 00000000..4c5cd9f8 --- /dev/null +++ b/core/src/test/resources/integration-test-files/connections/alias.adoc @@ -0,0 +1,1651 @@ +:toc: +:toclevels: 42 + += Connections Alias + +== should alias top level connection field and return correct totalCount + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actors: actorsConnection { + totalCount + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsEdges + } + RETURN { + edges: actorsEdges, + totalCount: totalCount + } AS actors +} +RETURN this { + actors: actors +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actors": { + "totalCount": 3 + } + } + ] +} +---- + +''' + +== should alias totalCount + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection { + count: totalCount + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "count": 3 + } + } + ] +} +---- + +''' + +== should alias pageInfo top level key + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection { + pi: pageInfo { + hasNextPage + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "pi": { + "hasNextPage": false + } + } + } + ] +} +---- + +''' + +== should alias startCursor + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection { + pageInfo { + sc: startCursor + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "pageInfo": { + "sc": "YXJyYXljb25uZWN0aW9uOjA=" + } + } + } + ] +} +---- + +''' + +== should alias endCursor + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection { + pageInfo { + ec: endCursor + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "pageInfo": { + "ec": "YXJyYXljb25uZWN0aW9uOjI=" + } + } + } + ] +} +---- + +''' + +== should alias hasPreviousPage + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) + CREATE (m)<-[:ACTED_IN]-(:Actor) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection { + pageInfo { + hPP: hasPreviousPage + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "pageInfo": { + "hPP": false + } + } + } + ] +} +---- + +''' + +== should alias hasNextPage + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "A"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "B"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "C"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection(first: 1) { + pageInfo { + hNP: hasNextPage + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": 1 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "pageInfo": { + "hNP": true + } + } + } + ] +} +---- + +''' + +== should alias the top level edges key + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "A"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "B"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "C"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection(first: 1) { + e: edges { + cursor + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": 1 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "e": [ + { + "cursor": "YXJyYXljb25uZWN0aW9uOjA=" + } + ] + } + } + ] +} +---- + +''' + +== should alias cursor + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "A"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "B"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "C"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection(first: 1) { + edges { + c: cursor + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": 1 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 + RETURN collect( { + node: { + __id: elementId(actor0), + __typename: 'Actor' + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "edges": [ + { + "c": "YXJyYXljb25uZWN0aW9uOjA=" + } + ] + } + } + ] +} +---- + +''' + +== should alias the top level node key + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "A"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "B"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "C"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection(first: 1) { + edges { + n: node { + name + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": 1 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 + RETURN collect( { + n: { + __typename: 'Actor', + name: actor0.name + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response Assertions +[%header,format=csv,response=true] +|=== +Path,Condition,Expected Value +movies.size(),==,1 +movies[0].actorsConnection.edges.size(),==,1 +movies[0].actorsConnection.edges[0].n.name,notEmpty, +|=== + +''' + +== should alias a property on the node + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "A"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "B"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "C"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection(first: 1) { + edges { + node { + n: name + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": 1 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 + RETURN collect( { + node: { + __typename: 'Actor', + n: actor0.name + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response Assertions +[%header,format=csv,response=true] +|=== +Path,Condition,Expected Value +movies.size(),==,1 +movies[0].actorsConnection.edges.size(),==,1 +movies[0].actorsConnection.edges[0].node.n,notEmpty, +|=== + +''' + +== should alias a property on the relationship + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} + +type ActedIn @relationshipProperties { + roles: [String]! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN {roles: ["R1"]}]-(:Actor {name: "A"}) + CREATE (m)<-[:ACTED_IN {roles: ["R2"]}]-(:Actor {name: "B"}) + CREATE (m)<-[:ACTED_IN {roles: ["R3"]}]-(:Actor {name: "B"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + actorsConnection(first: 1) { + edges { + r: properties { + r: roles + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": 1 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 + RETURN collect( { + r: { + __typename: 'ActedIn', + r: actedIn0.roles + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response Assertions +[%header,format=csv,response=true] +|=== +Path,Condition,Expected Value +movies.size(),==,1 +movies[0].actorsConnection.edges.size(),==,1 +movies[0].actorsConnection.edges[0].r.r,notEmpty, +|=== + +''' + +== should alias many keys on a connection + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") +} + +type Actor { + name: String! +} + +type ActedIn @relationshipProperties { + roles: [String]! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN {roles: ["RandomString3"]}]-(:Actor {name: "RandomString2"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + title + connection: actorsConnection { + tC: totalCount + edges { + n: node { + n: name + } + p: properties { + r: roles + } + } + page: pageInfo { + hNP: hasNextPage + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + p: { + __typename: 'ActedIn', + r: actedIn0.roles + }, + n: { + __typename: 'Actor', + n: actor0.name + } + }) AS connectionEdges + } + RETURN { + edges: connectionEdges, + totalCount: totalCount + } AS connection +} +RETURN this { + .title, + connection: connection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "RandomString1", + "connection": { + "tC": 1, + "edges": [ + { + "n": { + "n": "RandomString2" + }, + "p": { + "r": [ + "RandomString3" + ] + } + } + ], + "page": { + "hNP": false + } + } + } + ] +} +---- + +''' + +== should allow multiple aliases on the same connection + +.Schema +[source,graphql,schema=true] +---- +type Post { + title: String! + comments: [Comment!]! @relationship(type: "HAS_COMMENT", direction: OUT) +} + +type Comment { + flag: Boolean! + post: Post! @relationship(type: "HAS_COMMENT", direction: IN) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (post:Post {title: "RandomString1"}) + FOREACH(flag in [true, true, false] | + CREATE (:Comment {flag: flag})<-[:HAS_COMMENT]-(post) + ) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + posts(where: {title: "RandomString1"}) { + flagged: commentsConnection(where: {node: {flag: true}}) { + edges { + node { + flag + } + } + } + unflagged: commentsConnection(where: {node: {flag: false}}) { + edges { + node { + flag + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": true, + "param2": false +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Post) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (this)-[hasComment0:HAS_COMMENT]->(comment0:Comment) + WHERE comment0.flag = $param1 + WITH collect( { + node: comment0, + relationship: hasComment0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS comment0, edge.relationship AS hasComment0 + RETURN collect( { + node: { + __typename: 'Comment', + flag: comment0.flag + } + }) AS flaggedEdges + } + RETURN { + edges: flaggedEdges, + totalCount: totalCount + } AS flagged +} +CALL { + WITH this + MATCH (this)-[hasComment1:HAS_COMMENT]->(comment1:Comment) + WHERE comment1.flag = $param2 + WITH collect( { + node: comment1, + relationship: hasComment1 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS comment1, edge.relationship AS hasComment1 + RETURN collect( { + node: { + __typename: 'Comment', + flag: comment1.flag + } + }) AS unflaggedEdges + } + RETURN { + edges: unflaggedEdges, + totalCount: totalCount + } AS unflagged +} +RETURN this { + flagged: flagged, + unflagged: unflagged +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "posts": [ + { + "flagged": { + "edges": [ + { + "node": { + "flag": true + } + }, + { + "node": { + "flag": true + } + } + ] + }, + "unflagged": { + "edges": [ + { + "node": { + "flag": false + } + } + ] + } + } + ] +} +---- + +''' + +== should allow alias on nested connections + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie {title: "The Matrix"}) + CREATE (actor:Actor {name: "Keanu Reeves"}) + CREATE (actor)-[:ACTED_IN {screenTime: 120}]->(movie) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "The Matrix"}) { + title + actorsConnection(where: {node: {name: "Keanu Reeves"}}) { + edges { + properties { + screenTime + } + node { + name + b: moviesConnection(where: {node: {title: "The Matrix"}}) { + edges { + node { + title + a: actors { + name + } + } + } + } + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Matrix", + "param1": "Keanu Reeves", + "param2": "The Matrix" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WHERE actor0.name = $param1 + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + CALL { + WITH actor0 + MATCH (actor0)-[actedIn1:ACTED_IN]->(movie0:Movie) + WHERE movie0.title = $param2 + WITH collect( { + node: movie0, + relationship: actedIn1 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS movie0, edge.relationship AS actedIn1 + CALL { + WITH movie0 + MATCH (actor1:Actor)-[actedIn2:ACTED_IN]->(movie0) + WITH actor1 { + .name + } AS a + RETURN collect(a) AS a + } + RETURN collect( { + node: { + __typename: 'Movie', + title: movie0.title, + a: a + } + }) AS bEdges + } + RETURN { + edges: bEdges, + totalCount: totalCount + } AS b + } + RETURN collect( { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Actor', + name: actor0.name, + b: b + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + .title, + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "The Matrix", + "actorsConnection": { + "edges": [ + { + "properties": { + "screenTime": 120 + }, + "node": { + "name": "Keanu Reeves", + "b": { + "edges": [ + { + "node": { + "title": "The Matrix", + "a": [ + { + "name": "Keanu Reeves" + } + ] + } + } + ] + } + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/connections/filtering.adoc b/core/src/test/resources/integration-test-files/connections/filtering.adoc new file mode 100644 index 00000000..5ab09cba --- /dev/null +++ b/core/src/test/resources/integration-test-files/connections/filtering.adoc @@ -0,0 +1,112 @@ +:toc: +:toclevels: 42 + += Connections Filtering + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +== allows for NOT boolean operators on connection projection filters + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie {title: "My title"}) + CREATE (actorOne:Actor {name: "Arthur"}) + CREATE (actorTwo:Actor {name: "Zaphod"}) + CREATE (actorOne)-[:ACTED_IN]->(movie)<-[:ACTED_IN]-(actorTwo) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies { + actorsConnection(where: {NOT: {node: {name: "Arthur"}}}) { + edges { + node { + name + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Arthur" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WHERE NOT (actor0.name = $param0) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __typename: 'Actor', + name: actor0.name + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "actorsConnection": { + "edges": [ + { + "node": { + "name": "Zaphod" + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/connections/interfaces.adoc b/core/src/test/resources/integration-test-files/connections/interfaces.adoc new file mode 100644 index 00000000..8c596c80 --- /dev/null +++ b/core/src/test/resources/integration-test-files/connections/interfaces.adoc @@ -0,0 +1,869 @@ +:toc: +:toclevels: 42 + += Connections -> Interfaces + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! +} + +type Movie implements Production { + title: String! + runtime: Int! +} + +type Series implements Production { + title: String! + episodes: Int! +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (actor:Actor {name: "Jason Momoa"}) + CREATE (actor)-[:ACTED_IN {screenTime: 858}]->(:Series {title: "Game of Thrones", episodes: 73}) + CREATE (actor)-[:ACTED_IN {screenTime: 90}]->(:Movie {title: "Dune", runtime: 155}) + CREATE (actor)-[:ACTED_IN {screenTime: 120}]->(:Movie {title: "Aquaman", runtime: 144}) +---- + +== Projecting node and relationship properties with no arguments + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String) { + actors(where: {name: $name}) { + name + actedInConnection { + edges { + properties { + screenTime + } + node { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "Jason Momoa" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Jason Momoa" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Movie', + title: movie0.title, + runtime: movie0.runtime, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn1.screenTime + }, + node: { + __typename: 'Series', + title: series0.title, + episodes: series0.episodes, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + .name, + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "actors" : [ { + "name" : "Jason Momoa", + "actedInConnection" : { + "edges" : [ { + "properties" : { + "screenTime" : 120 + }, + "node" : { + "title" : "Aquaman", + "runtime" : 144 + } + }, { + "properties" : { + "screenTime" : 90 + }, + "node" : { + "title" : "Dune", + "runtime" : 155 + } + }, { + "properties" : { + "screenTime" : 858 + }, + "node" : { + "title" : "Game of Thrones", + "episodes" : 73 + } + } ] + } + } ] +} +---- + +''' + +== Projecting node and relationship properties with shared where argument + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String) { + actors(where: {name: $name}) { + name + actedInConnection(where: {node: {title: "Game of Thrones"}}) { + edges { + properties { + screenTime + } + node { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "Jason Momoa" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Jason Momoa", + "param1": "Game of Thrones", + "param2": "Game of Thrones" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WHERE movie0.title = $param1 + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Movie', + title: movie0.title, + runtime: movie0.runtime, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WHERE series0.title = $param2 + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn1.screenTime + }, + node: { + __typename: 'Series', + title: series0.title, + episodes: series0.episodes, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + .name, + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "Jason Momoa", + "actedInConnection": { + "edges": [ + { + "properties": { + "screenTime": 858 + }, + "node": { + "title": "Game of Thrones", + "episodes": 73 + } + } + ] + } + } + ] +} +---- + +''' + +== Projecting node and relationship properties with sort argument + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String) { + actors(where: {name: $name}) { + name + actedInConnection(sort: [{edge: {screenTime: DESC}}]) { + edges { + properties { + screenTime + } + node { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "Jason Momoa" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Jason Momoa" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Movie', + title: movie0.title, + runtime: movie0.runtime, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn1.screenTime + }, + node: { + __typename: 'Series', + title: series0.title, + episodes: series0.episodes, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge ORDER BY edge.properties.screenTime DESC + RETURN collect(edge) AS sortedEdges0 + } + RETURN { + edges: sortedEdges0, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + .name, + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "Jason Momoa", + "actedInConnection": { + "edges": [ + { + "properties": { + "screenTime": 858 + }, + "node": { + "title": "Game of Thrones", + "episodes": 73 + } + }, + { + "properties": { + "screenTime": 120 + }, + "node": { + "title": "Aquaman", + "runtime": 144 + } + }, + { + "properties": { + "screenTime": 90 + }, + "node": { + "title": "Dune", + "runtime": 155 + } + } + ] + } + } + ] +} +---- + +''' + +== Projecting node and relationship properties with pagination + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String, $after: String) { + actors(where: {name: $name}) { + name + actedInConnection(first: 2, after: $after, sort: {edge: {screenTime: DESC}}) { + pageInfo { + hasNextPage + hasPreviousPage + endCursor + } + edges { + properties { + screenTime + } + node { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "Jason Momoa" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Jason Momoa", + "param1": 2 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Movie', + title: movie0.title, + runtime: movie0.runtime, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn1.screenTime + }, + node: { + __typename: 'Series', + title: series0.title, + episodes: series0.episodes, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge ORDER BY edge.properties.screenTime DESC LIMIT $param1 + RETURN collect(edge) AS sortedEdges0 + } + RETURN { + edges: sortedEdges0, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + .name, + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "Jason Momoa", + "actedInConnection": { + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "endCursor": "YXJyYXljb25uZWN0aW9uOjE=" + }, + "edges": [ + { + "properties": { + "screenTime": 858 + }, + "node": { + "title": "Game of Thrones", + "episodes": 73 + } + }, + { + "properties": { + "screenTime": 120 + }, + "node": { + "title": "Aquaman", + "runtime": 144 + } + } + ] + } + } + ] +} +---- + +''' + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String, $after: String) { + actors(where: {name: $name}) { + name + actedInConnection(first: 2, after: $after, sort: {edge: {screenTime: DESC}}) { + pageInfo { + hasNextPage + hasPreviousPage + endCursor + } + edges { + properties { + screenTime + } + node { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "Jason Momoa", + "after": "YXJyYXljb25uZWN0aW9uOjE=" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "Jason Momoa", + "param1" : 2, + "param2" : 2 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Movie', + title: movie0.title, + runtime: movie0.runtime, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn1.screenTime + }, + node: { + __typename: 'Series', + title: series0.title, + episodes: series0.episodes, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge ORDER BY edge.properties.screenTime DESC SKIP $param1 LIMIT $param2 + RETURN collect(edge) AS sortedEdges0 + } + RETURN { + edges: sortedEdges0, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + .name, + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "Jason Momoa", + "actedInConnection": { + "pageInfo": { + "hasNextPage": false, + "hasPreviousPage": true, + "endCursor": "YXJyYXljb25uZWN0aW9uOjI=" + }, + "edges": [ + { + "properties": { + "screenTime": 90 + }, + "node": { + "title": "Dune", + "runtime": 155 + } + } + ] + } + } + ] +} +---- + +''' + +== With where argument for shared field on node with node in database + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String, $title: String) { + actors(where: {name: $name}) { + name + actedInConnection(where: {node: {title: $title}}) { + edges { + properties { + screenTime + } + node { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "Jason Momoa", + "title": "Dune" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Jason Momoa", + "param1": "Dune", + "param2": "Dune" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WHERE movie0.title = $param1 + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Movie', + title: movie0.title, + runtime: movie0.runtime, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WHERE series0.title = $param2 + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn1.screenTime + }, + node: { + __typename: 'Series', + title: series0.title, + episodes: series0.episodes, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + .name, + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "Jason Momoa", + "actedInConnection": { + "edges": [ + { + "properties": { + "screenTime": 90 + }, + "node": { + "title": "Dune", + "runtime": 155 + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/connections/nested.adoc b/core/src/test/resources/integration-test-files/connections/nested.adoc new file mode 100644 index 00000000..83065cfb --- /dev/null +++ b/core/src/test/resources/integration-test-files/connections/nested.adoc @@ -0,0 +1,353 @@ +:toc: +:toclevels: 42 + += Connections Alias + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} +---- + +== should allow nested connections + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie {title: "Forrest Gump"}) + CREATE (actor:Actor {name: "Tom Hanks"}) + CREATE (actor)-[:ACTED_IN {screenTime: 120}]->(movie) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "Forrest Gump"}) { + title + actorsConnection(where: {node: {name: "Tom Hanks"}}) { + edges { + properties { + screenTime + } + node { + name + moviesConnection { + edges { + node { + title + actors { + name + } + } + } + } + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Forrest Gump", + "param1": "Tom Hanks" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WHERE actor0.name = $param1 + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + CALL { + WITH actor0 + MATCH (actor0)-[actedIn1:ACTED_IN]->(movie0:Movie) + WITH collect( { + node: movie0, + relationship: actedIn1 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS movie0, edge.relationship AS actedIn1 + CALL { + WITH movie0 + MATCH (actor1:Actor)-[actedIn2:ACTED_IN]->(movie0) + WITH actor1 { + .name + } AS actors + RETURN collect(actors) AS actors + } + RETURN collect( { + node: { + __typename: 'Movie', + title: movie0.title, + actors: actors + } + }) AS moviesConnectionEdges + } + RETURN { + edges: moviesConnectionEdges, + totalCount: totalCount + } AS moviesConnection + } + RETURN collect( { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Actor', + name: actor0.name, + moviesConnection: moviesConnection + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + .title, + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "Forrest Gump", + "actorsConnection": { + "edges": [ + { + "properties": { + "screenTime": 120 + }, + "node": { + "name": "Tom Hanks", + "moviesConnection": { + "edges": [ + { + "node": { + "title": "Forrest Gump", + "actors": [ + { + "name": "Tom Hanks" + } + ] + } + } + ] + } + } + } + ] + } + } + ] +} +---- + +''' + +== should allow where clause on nested connections + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie {title: "Forrest Gump"}) + CREATE (actor:Actor {name: "Tom Hanks"}) + CREATE (actor)-[:ACTED_IN {screenTime: 120}]->(movie) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "Forrest Gump"}) { + title + actorsConnection(where: {node: {name: "Tom Hanks"}}) { + edges { + properties { + screenTime + } + node { + name + moviesConnection(where: {node: {title: "Forrest Gump"}}) { + edges { + node { + title + actors { + name + } + } + } + } + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Forrest Gump", + "param1": "Tom Hanks", + "param2": "Forrest Gump" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WHERE actor0.name = $param1 + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + CALL { + WITH actor0 + MATCH (actor0)-[actedIn1:ACTED_IN]->(movie0:Movie) + WHERE movie0.title = $param2 + WITH collect( { + node: movie0, + relationship: actedIn1 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS movie0, edge.relationship AS actedIn1 + CALL { + WITH movie0 + MATCH (actor1:Actor)-[actedIn2:ACTED_IN]->(movie0) + WITH actor1 { + .name + } AS actors + RETURN collect(actors) AS actors + } + RETURN collect( { + node: { + __typename: 'Movie', + title: movie0.title, + actors: actors + } + }) AS moviesConnectionEdges + } + RETURN { + edges: moviesConnectionEdges, + totalCount: totalCount + } AS moviesConnection + } + RETURN collect( { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Actor', + name: actor0.name, + moviesConnection: moviesConnection + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + .title, + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "Forrest Gump", + "actorsConnection": { + "edges": [ + { + "properties": { + "screenTime": 120 + }, + "node": { + "name": "Tom Hanks", + "moviesConnection": { + "edges": [ + { + "node": { + "title": "Forrest Gump", + "actors": [ + { + "name": "Tom Hanks" + } + ] + } + } + ] + } + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/connections/unions.adoc b/core/src/test/resources/integration-test-files/connections/unions.adoc new file mode 100644 index 00000000..40420f35 --- /dev/null +++ b/core/src/test/resources/integration-test-files/connections/unions.adoc @@ -0,0 +1,1320 @@ +:toc: +:toclevels: 42 + += Connections -> Unions + +== Setup + +.Schema +[source,graphql,schema=true] +---- +union Publication = Book | Journal + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT, properties: "Wrote") +} + +type Book { + title: String! + author: [Author!]! @relationship(type: "WROTE", direction: IN, properties: "Wrote") +} + +type Journal { + subject: String! + author: [Author!]! @relationship(type: "WROTE", direction: IN, properties: "Wrote") +} + +type Wrote @relationshipProperties { + words: Int! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (author:Author {name: "Charles Dickens"}) + CREATE (author)-[:WROTE {words: 167543}]->(:Book {title: "Oliver Twist"}) + CREATE (author)-[:WROTE {words: 30953}]->(:Book {title: "A Christmas Carol"}) + CREATE (author)-[:WROTE {words: 3413}]->(:Journal {subject: "Master Humphrey's Clock"}) +---- + +== Projecting node and relationship properties with no arguments + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String) { + authors(where: {name: $authorName}) { + name + publicationsConnection { + edges { + properties { + words + } + node { + ... on Book { + title + } + ... on Journal { + subject + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH { + properties: { + __typename: 'Wrote', + words: wrote1.words + }, + node: { + __typename: 'Journal', + subject: journal0.subject, + __id: elementId(journal0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "edges": [ + { + "properties": { + "words": 30953 + }, + "node": { + "title": "A Christmas Carol" + } + }, + { + "properties": { + "words": 167543 + }, + "node": { + "title": "Oliver Twist" + } + }, + { + "properties": { + "words": 3413 + }, + "node": { + "subject": "Master Humphrey's Clock" + } + } + ] + } + } + ] +} +---- + +''' + +== Projecting node and relationship properties with sort argument + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String) { + authors(where: {name: $authorName}) { + name + publicationsConnection(sort: [{edge: {words: ASC}}]) { + edges { + properties { + words + } + node { + ... on Book { + title + } + ... on Journal { + subject + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH { + properties: { + __typename: 'Wrote', + words: wrote1.words + }, + node: { + __typename: 'Journal', + subject: journal0.subject, + __id: elementId(journal0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge ORDER BY edge.properties.words ASC + RETURN collect(edge) AS sortedEdges0 + } + RETURN { + edges: sortedEdges0, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "edges": [ + { + "properties": { + "words": 3413 + }, + "node": { + "subject": "Master Humphrey's Clock" + } + }, + { + "properties": { + "words": 30953 + }, + "node": { + "title": "A Christmas Carol" + } + }, + { + "properties": { + "words": 167543 + }, + "node": { + "title": "Oliver Twist" + } + } + ] + } + } + ] +} +---- + +''' + +== Projecting node and relationship properties with pagination + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String, $after: String) { + authors(where: {name: $authorName}) { + name + publicationsConnection(first: 2, after: $after, sort: [{edge: {words: ASC}}]) { + pageInfo { + hasNextPage + hasPreviousPage + endCursor + } + edges { + properties { + words + } + node { + ... on Book { + title + } + ... on Journal { + subject + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens", + "param1": 2 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH { + properties: { + __typename: 'Wrote', + words: wrote1.words + }, + node: { + __typename: 'Journal', + subject: journal0.subject, + __id: elementId(journal0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge ORDER BY edge.properties.words ASC LIMIT $param1 + RETURN collect(edge) AS sortedEdges0 + } + RETURN { + edges: sortedEdges0, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "endCursor": "YXJyYXljb25uZWN0aW9uOjE=" + }, + "edges": [ + { + "properties": { + "words": 3413 + }, + "node": { + "subject": "Master Humphrey's Clock" + } + }, + { + "properties": { + "words": 30953 + }, + "node": { + "title": "A Christmas Carol" + } + } + ] + } + } + ] +} +---- + +''' + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String, $after: String) { + authors(where: {name: $authorName}) { + name + publicationsConnection(first: 2, after: $after, sort: [{edge: {words: ASC}}]) { + pageInfo { + hasNextPage + hasPreviousPage + endCursor + } + edges { + properties { + words + } + node { + ... on Book { + title + } + ... on Journal { + subject + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens", + "after": "YXJyYXljb25uZWN0aW9uOjE=" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "Charles Dickens", + "param1" : 2, + "param2" : 2 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH { + properties: { + __typename: 'Wrote', + words: wrote1.words + }, + node: { + __typename: 'Journal', + subject: journal0.subject, + __id: elementId(journal0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge ORDER BY edge.properties.words ASC SKIP $param1 LIMIT $param2 + RETURN collect(edge) AS sortedEdges0 + } + RETURN { + edges: sortedEdges0, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "pageInfo": { + "hasNextPage": false, + "hasPreviousPage": true, + "endCursor": "YXJyYXljb25uZWN0aW9uOjI=" + }, + "edges": [ + { + "properties": { + "words": 167543 + }, + "node": { + "title": "Oliver Twist" + } + } + ] + } + } + ] +} +---- + +''' + +== Projecting node and relationship properties for one union member with no arguments + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String) { + authors(where: {name: $authorName}) { + name + publicationsConnection { + edges { + properties { + words + } + node { + ... on Book { + title + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH { + properties: { + __typename: 'Wrote', + words: wrote1.words + }, + node: { + __typename: 'Journal', + __id: elementId(journal0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "authors" : [ { + "name" : "Charles Dickens", + "publicationsConnection" : { + "edges" : [ { + "properties" : { + "words" : 30953 + }, + "node" : { + "title" : "A Christmas Carol" + } + }, { + "properties" : { + "words" : 167543 + }, + "node" : { + "title" : "Oliver Twist" + } + }, { + "properties" : { + "words" : 3413 + }, + "node" : { } + } ] + } + } ] +} +---- + +''' + +== With where argument on node with node in database + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String, $bookTitle: String) { + authors(where: {name: $authorName}) { + name + publicationsConnection(where: {Book: {node: {title: $bookTitle}}}) { + edges { + properties { + words + } + node { + ... on Book { + title + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens", + "bookTitle": "Oliver Twist" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens", + "param1": "Oliver Twist" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WHERE book0.title = $param1 + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "edges": [ + { + "properties": { + "words": 167543 + }, + "node": { + "title": "Oliver Twist" + } + } + ] + } + } + ] +} +---- + +''' + +== With where argument on all nodes with all in database + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String, $bookTitle: String, $journalSubject: String) { + authors(where: {name: $authorName}) { + name + publicationsConnection( + where: {Book: {node: {title: $bookTitle}}, Journal: {node: {subject: $journalSubject}}} + ) { + totalCount + edges { + properties { + words + } + node { + __typename + ... on Book { + title + } + ... on Journal { + subject + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens", + "bookTitle": "Oliver Twist", + "journalSubject": "Master Humphrey's Clock" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens", + "param1": "Oliver Twist", + "param2": "Master Humphrey's Clock" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WHERE book0.title = $param1 + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WHERE journal0.subject = $param2 + WITH { + properties: { + __typename: 'Wrote', + words: wrote1.words + }, + node: { + __typename: 'Journal', + subject: journal0.subject, + __id: elementId(journal0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "totalCount": 2, + "edges": [ + { + "properties": { + "words": 167543 + }, + "node": { + "__typename": "Book", + "title": "Oliver Twist" + } + }, + { + "properties": { + "words": 3413 + }, + "node": { + "__typename": "Journal", + "subject": "Master Humphrey's Clock" + } + } + ] + } + } + ] +} +---- + +''' + +== With where argument on relationship with relationship in database + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String, $bookWordCount: Int) { + authors(where: {name: $authorName}) { + name + publicationsConnection(where: {Book: {edge: {words: $bookWordCount}}}) { + edges { + properties { + words + } + node { + ... on Book { + title + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens", + "bookWordCount": 167543 +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens", + "param1": 167543 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WHERE wrote0.words = $param1 + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "edges": [ + { + "properties": { + "words": 167543 + }, + "node": { + "title": "Oliver Twist" + } + } + ] + } + } + ] +} +---- + +''' + +== With where argument on all edges with all in database + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String, $bookWordCount: Int, $journalWordCount: Int) { + authors(where: {name: $authorName}) { + name + publicationsConnection( + where: {Book: {edge: {words: $bookWordCount}}, Journal: {edge: {words: $journalWordCount}}} + ) { + totalCount + edges { + properties { + words + } + node { + __typename + ... on Book { + title + } + ... on Journal { + subject + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens", + "bookWordCount": 167543, + "journalWordCount": 3413 +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens", + "param1": 167543, + "param2": 3413 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WHERE wrote0.words = $param1 + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WHERE wrote1.words = $param2 + WITH { + properties: { + __typename: 'Wrote', + words: wrote1.words + }, + node: { + __typename: 'Journal', + subject: journal0.subject, + __id: elementId(journal0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "totalCount": 2, + "edges": [ + { + "properties": { + "words": 167543 + }, + "node": { + "__typename": "Book", + "title": "Oliver Twist" + } + }, + { + "properties": { + "words": 3413 + }, + "node": { + "__typename": "Journal", + "subject": "Master Humphrey's Clock" + } + } + ] + } + } + ] +} +---- + +''' + +== With where argument on relationship and node + +.GraphQL-Query +[source,graphql] +---- +query ($authorName: String, $bookWordCount: Int, $bookTitle: String) { + authors(where: {name: $authorName}) { + name + publicationsConnection( + where: {Book: {edge: {words: $bookWordCount}, node: {title: $bookTitle}}} + ) { + edges { + properties { + words + } + node { + ... on Book { + title + } + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "authorName": "Charles Dickens", + "bookWordCount": 167543, + "bookTitle": "Oliver Twist" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Charles Dickens", + "param1": "Oliver Twist", + "param2": 167543 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WHERE (book0.title = $param1 + AND wrote0.words = $param2) + WITH { + properties: { + __typename: 'Wrote', + words: wrote0.words + }, + node: { + __typename: 'Book', + title: book0.title, + __id: elementId(book0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS publicationsConnection +} +RETURN this { + .name, + publicationsConnection: publicationsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "authors": [ + { + "name": "Charles Dickens", + "publicationsConnection": { + "edges": [ + { + "properties": { + "words": 167543 + }, + "node": { + "title": "Oliver Twist" + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/custom-resolvers.adoc b/core/src/test/resources/integration-test-files/custom-resolvers.adoc new file mode 100644 index 00000000..a5c2ad64 --- /dev/null +++ b/core/src/test/resources/integration-test-files/custom-resolvers.adoc @@ -0,0 +1,171 @@ +:toc: +:toclevels: 42 + += Custom Resolvers + +== should define a custom Query resolver and resolve it + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + custom: String +} + +type Query { + id: ID +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + id +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "id": "RandomString1" +} +---- + +''' + +== should define a custom Mutation resolver and resolve it + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + custom: String +} + +type Mutation { + id: ID +} +---- + +.GraphQL-Query +[source,graphql] +---- +mutation { + id +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "id": "RandomString1" +} +---- + +''' + +== should define a custom Subscription resolver and resolve it + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + custom: String +} + +type Subscription { + id: ID! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query + subscription: Subscription +} + +type Movie { + custom: String + id: ID +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +input MovieOptions { + limit: Int + offset: Int + """ + Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [MovieSort!] +} + +""" +Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object. +""" +input MovieSort { + custom: SortDirection + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + custom: String + custom_CONTAINS: String + custom_ENDS_WITH: String + custom_IN: [String] + custom_STARTS_WITH: String + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type Subscription { + id: ID! +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc b/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc new file mode 100644 index 00000000..aa448c49 --- /dev/null +++ b/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc @@ -0,0 +1,355 @@ +:toc: +:toclevels: 42 + += Custom Scalar Filtering + +== Single Value Custom Scalar + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +scalar CustomScalar + +type Movie { + property: CustomScalar +} +---- + +=== Filter IN CustomScalar - expect return value + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "someValue"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_IN: ["someValue", "foo", "bar"]}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "someValue", + "foo", + "bar" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property IN $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "someValue" + } + ] +} +---- + +''' + +=== Filter IN CustomScalar - expect array of return values + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "someValue"}) + CREATE (:Movie {property: "someOtherValue"}) + CREATE (:Movie {property: "foo"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_IN: ["someValue", "someOtherValue"]}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "someValue", + "someOtherValue" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property IN $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "someValue" + }, + { + "property": "someOtherValue" + } + ] +} +---- + +''' + +=== Filter IN CustomScalar - expect no return values + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "someValue"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_IN: ["someUnknownValue"]}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "someUnknownValue" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property IN $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [] +} +---- + +''' + +== List Custom Scalar Filtering + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +scalar CustomListScalar + +type Movie { + property: [CustomListScalar!] +} +---- + +=== Filter INCLUDES CustomListScalar - expect return value + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: ["val1", "val2", "val3"]}) + CREATE (:Movie {property: ["foo", "bar"]}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_INCLUDES: val1}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "val1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE $param0 IN this.property +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": [ + "val1", + "val2", + "val3" + ] + } + ] +} +---- + +''' + +=== Filter INCLUDES CustomListScalar - expect array of return values + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: ["val1", "val2", "val3"]}) + CREATE (:Movie {property: ["val1"]}) + CREATE (:Movie {property: ["foo", "bar"]}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_INCLUDES: val1}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "val1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE $param0 IN this.property +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": [ + "val1", + "val2", + "val3" + ] + }, + { + "property": [ + "val1" + ] + } + ] +} +---- + +''' + +=== Filter INCLUDES CustomListScalar - expect no return values + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: ["val1", "val2", "val3"]}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_INCLUDES: f}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "f" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE $param0 IN this.property +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/directives/authorization/custom-resolvers.adoc b/core/src/test/resources/integration-test-files/directives/authorization/custom-resolvers.adoc new file mode 100644 index 00000000..cb05343e --- /dev/null +++ b/core/src/test/resources/integration-test-files/directives/authorization/custom-resolvers.adoc @@ -0,0 +1,151 @@ +:toc: +:toclevels: 42 + += auth/custom-resolvers + +== auth-injection + +=== should inject auth in context of custom Query + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID +} + +type Query { + me: User +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + me { + id + } +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "me": { + "id": "RandomString1" + } +} +---- + +''' + +=== should inject auth in context of custom Mutation + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID +} + +type Mutation { + me: User +} +---- + +.GraphQL-Query +[source,graphql] +---- +mutation { + me { + id + } +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "me": { + "id": "RandomString1" + } +} +---- + +''' + +=== should inject auth in context of custom Field resolver + +.Schema +[source,graphql,schema=true] +---- +type User { + customId: ID +} + +type Query { + me: User +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + me { + customId + } +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "me": { + "customId": "RandomString1" + } +} +---- + +''' + +=== should inject auth in context of custom Query when decoded JWT passed in + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID +} + +type Query { + me: User +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + me { + id + } +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "me": { + "id": "RandomString1" + } +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/directives/coalesce.adoc b/core/src/test/resources/integration-test-files/directives/coalesce.adoc new file mode 100644 index 00000000..9600a1d4 --- /dev/null +++ b/core/src/test/resources/integration-test-files/directives/coalesce.adoc @@ -0,0 +1,204 @@ +:toc: +:toclevels: 42 + += @coalesce directive + +== allows querying with null properties without affecting the returned result + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID! + classification: String @coalesce(value: "Unrated") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {classification: "Unrated"}) { + id + classification + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Unrated" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE coalesce(this.classification, 'Unrated') = $param0 +RETURN this { + .id, + .classification +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "classification": null + } + ] +} +---- + +''' + +== with enum values + +.Schema +[source,graphql,schema=true] +---- +enum Status { + ACTIVE + INACTIVE +} + +type Movie { + id: ID + status: Status @coalesce(value: ACTIVE) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {status: ACTIVE}) { + id + status + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "ACTIVE" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE coalesce(this.status, 'ACTIVE') = $param0 +RETURN this { + .id, + .status +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "status": null + } + ] +} +---- + +''' + +== with enum list values + +.Schema +[source,graphql,schema=true] +---- +enum Status { + ACTIVE + INACTIVE +} + +type Movie { + id: ID + statuses: [Status!] @coalesce(value: [ACTIVE, INACTIVE]) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {statuses: [ACTIVE, INACTIVE]}) { + id + statuses + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "ACTIVE", + "INACTIVE" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE coalesce(this.statuses, ['ACTIVE', 'INACTIVE']) = $param0 +RETURN this { + .id, + .statuses +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "statuses": null + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/directives/customResolver.adoc b/core/src/test/resources/integration-test-files/directives/customResolver.adoc new file mode 100644 index 00000000..9134ad2a --- /dev/null +++ b/core/src/test/resources/integration-test-files/directives/customResolver.adoc @@ -0,0 +1,2507 @@ +:toc: +:toclevels: 42 + +== @customResolver directive + +=== Scalar fields + +==== Setup + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID! + firstName: String! + lastName: String! + fullName: String @customResolver(requires: "firstName lastName") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user:User) SET user = {id: "An-ID", firstName: "someFirstName", lastName: "a second name!"} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ScalarFieldCustomResolver.kt[] +---- + +==== removes a field from all but its object type, and resolves with a custom resolver + +.GraphQL-Query +[source,graphql] +---- +query User($userId: ID!) { + users(where: {id: $userId}) { + id + firstName + lastName + fullName + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "userId": "An-ID" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "An-ID" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +WHERE this.id = $param0 +RETURN this { + .id, + .firstName, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "id": "An-ID", + "firstName": "someFirstName", + "lastName": "a second name!", + "fullName": "someFirstName a second name!" + } + ] +} +---- + +''' + +==== resolves field with custom resolver without required fields in selection set + +.GraphQL-Query +[source,graphql] +---- +query User($userId: ID!) { + users(where: {id: $userId}) { + id + fullName + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "userId": "An-ID" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "An-ID" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +WHERE this.id = $param0 +RETURN this { + .id, + .firstName, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "id": "An-ID", + "fullName": "someFirstName a second name!" + } + ] +} +---- + +''' + +==== resolves field with custom resolver with required field(s) aliased in selection set + +.GraphQL-Query +[source,graphql] +---- +query User($userId: ID!) { + users(where: {id: $userId}) { + id + f: firstName + fullName + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "userId": "An-ID" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "An-ID" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +WHERE this.id = $param0 +RETURN this { + .id, + f: this.firstName, + .firstName, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "id": "An-ID", + "f": "someFirstName", + "fullName": "someFirstName a second name!" + } + ] +} +---- + +''' + +=== Custom resolver checks + +==== Check throws error if customResolver is not provided + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID! + firstName: String! + lastName: String! + fullName: String @customResolver(requires: "firstName lastName") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + firstName: String! + fullName: String + id: ID! + lastName: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + firstName: SortDirection + id: SortDirection + lastName: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + firstName: String + firstName_CONTAINS: String + firstName_ENDS_WITH: String + firstName_IN: [String!] + firstName_STARTS_WITH: String + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID!] + id_STARTS_WITH: ID + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + +== Related Fields + +=== should be able to require a field from a related type + +.Schema +[source,graphql,schema=true] +---- +type Address { + street: String! + city: String! +} + +type User { + id: ID! + firstName: String! + lastName: String! + address: Address @relationship(type: "LIVES_AT", direction: OUT) + fullName: String @customResolver(requires: "firstName lastName address { city }") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user:User)-[:LIVES_AT]->(addr:Address) SET user = {id: "1", firstName: "First", lastName: "Last"}, addr = {city: "some city", street: "some street"} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver.kt[] +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + fullName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + WITH address0 { + .city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + .firstName, + .lastName, + address: address +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "fullName": "First Last from some city" + } + ] +} +---- + +''' + +=== should fetch required fields when other fields are also selected + +.Schema +[source,graphql,schema=true] +---- +type Address { + street: String! + city: String! +} + +type User { + id: ID! + firstName: String! + lastName: String! + address: Address @relationship(type: "LIVES_AT", direction: OUT) + fullName: String @customResolver(requires: "firstName lastName address { city }") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user:User)-[:LIVES_AT]->(addr:Address) SET user = {id: "1", firstName: "First", lastName: "Last"}, addr = {city: "some city", street: "some street"} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver.kt[] +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + id + fullName + address { + street + city + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + WITH address0 { + .street, + .city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + .id, + address: address, + .firstName, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "id": "1", + "fullName": "First Last from some city", + "address": { + "street": "some street", + "city": "some city" + } + } + ] +} +---- + +''' + +=== should fetch customResolver fields over multiple users + +.Schema +[source,graphql,schema=true] +---- +type Address { + street: String! + city: String! +} + +type User { + id: ID! + firstName: String! + lastName: String! + address: Address @relationship(type: "LIVES_AT", direction: OUT) + fullName: String @customResolver(requires: "firstName lastName address { city }") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user1:User)-[:LIVES_AT]->(addr1:Address) SET user1 = {id: "1", firstName: "First", lastName: "Last"}, addr1 = {city: "some city", street: "some street"} + CREATE (user2:User)-[:LIVES_AT]->(addr2:Address) SET user2 = {id: "2", firstName: "New First", lastName: "new-last"}, addr2 = {city: "another-city", street: "another-street"} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver.kt[] +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + id + fullName + address { + street + city + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + WITH address0 { + .street, + .city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + .id, + address: address, + .firstName, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "users": [ + { + "id": "1", + "fullName": "First Last from some city", + "address": { + "street": "some street", + "city": "some city" + } + }, + { + "id": "2", + "fullName": "New First new-last from another-city", + "address": { + "street": "another-street", + "city": "another-city" + } + } + ] +} +---- + +''' + +=== should select related fields when not selected last + +.Schema +[source,graphql,schema=true] +---- +type Address { + street: String! + city: String! +} + +type User { + id: ID! + firstName: String! + lastName: String! + address: Address @relationship(type: "LIVES_AT", direction: OUT) + fullName: String @customResolver(requires: "firstName address { city } lastName") +} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver.kt[] +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user1:User)-[:LIVES_AT]->(addr1:Address) SET user1 = {id: "1", firstName: "First", lastName: "Last"}, addr1 = {city: "some city", street: "some street"} + CREATE (user2:User)-[:LIVES_AT]->(addr2:Address) SET user2 = {id: "2", firstName: "New First", lastName: "new-last"}, addr2 = {city: "another-city", street: "another-street"} +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + id + fullName + address { + street + city + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + WITH address0 { + .street, + .city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + .id, + address: address, + .firstName, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "id": "1", + "fullName": "First Last from some city", + "address": { + "street": "some street", + "city": "some city" + } + }, + { + "id": "2", + "fullName": "New First new-last from another-city", + "address": { + "street": "another-street", + "city": "another-city" + } + } + ] +} +---- + +''' + +=== should select fields from double nested related nodes + +.Schema +[source,graphql,schema=true] +---- +type City { + name: String! + population: Int +} + +type Address { + street: String! + city: City! @relationship(type: "IN_CITY", direction: OUT) +} + +type User { + id: ID! + firstName: String! + lastName: String! + address: Address @relationship(type: "LIVES_AT", direction: OUT) + fullName: String @customResolver(requires: "firstName lastName address { city { name population } }") +} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver2.kt[] +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user1:User)-[:LIVES_AT]->(addr1:Address)-[:IN_CITY]->(city1:City) + SET user1 = {id: "1", firstName: "First", lastName: "Last"}, addr1 = {city: "some city", street: "some street"}, city1 = {name: "city1 name!", population: 8947975} + CREATE (user2:User)-[:LIVES_AT]->(addr2:Address)-[:IN_CITY]->(city2:City) + SET user2 = {id: "2", firstName: "New First", lastName: "new-last"}, addr2 = {city: "another-city", street: "another-street"}, city2 = {name: "city2 name?", population: 74} +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + fullName + address { + street + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + CALL { + WITH address0 + MATCH (address0)-[inCity0:IN_CITY]->(city0:City) + WITH city0 { + .name, + .population + } AS city + RETURN head(collect(city)) AS city + } + WITH address0 { + .street, + city: city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + address: address, + .firstName, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "fullName": "First Last from city1 name! with population of 8947975", + "address": { + "street": "some street" + } + }, + { + "fullName": "New First new-last from city2 name? with population of 74", + "address": { + "street": "another-street" + } + } + ] +} +---- + +''' + +=== should select fields from triple nested related nodes + +.Schema +[source,graphql,schema=true] +---- +type State { + someValue: Int! +} + +type City { + name: String! + population: Int + state: State! @relationship(type: "IN_STATE", direction: OUT) +} + +type Address { + street: String! + city: City! @relationship(type: "IN_CITY", direction: OUT) +} + +type User { + id: ID! + firstName: String! + lastName: String! + address: Address @relationship(type: "LIVES_AT", direction: OUT) + fullName: String @customResolver(requires: "firstName lastName address { city { name state { someValue } population } }") +} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver3.kt[] +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user1:User)-[:LIVES_AT]->(addr1:Address)-[:IN_CITY]->(city1:City) + -[:IN_STATE]->(state:State) + SET user1 = {id: "1", firstName: "First", lastName: "Last"}, addr1 = {city: "some city", street: "some street"}, city1 = {name: "city1 name!", population: 8947975}, state = {someValue: 4797} + CREATE (user2:User)-[:LIVES_AT]->(addr2:Address)-[:IN_CITY]->(city2:City) + -[:IN_STATE]->(state) + SET user2 = {id: "2", firstName: "New First", lastName: "new-last"}, addr2 = {city: "another-city", street: "another-street"}, city2 = {name: "city2 name?", population: 74} +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + fullName + address { + street + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + CALL { + WITH address0 + MATCH (address0)-[inCity0:IN_CITY]->(city0:City) + CALL { + WITH city0 + MATCH (city0)-[inState0:IN_STATE]->(state0:State) + WITH state0 { + .someValue + } AS state + RETURN head(collect(state)) AS state + } + WITH city0 { + .name, + state: state, + .population + } AS city + RETURN head(collect(city)) AS city + } + WITH address0 { + .street, + city: city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + address: address, + .firstName, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "fullName": "First Last from city1 name! with population of 8947975 with 4797", + "address": { + "street": "some street" + } + }, + { + "fullName": "New First new-last from city2 name? with population of 74 with 4797", + "address": { + "street": "another-street" + } + } + ] +} +---- + +''' + +=== should be able to require fields from a related union + +.Schema +[source,graphql,schema=true] +---- +union Publication = Book | Journal + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) + publicationsWithAuthor: [String!]! @customResolver(requires: "name publications { ...on Book { title } ... on Journal { subject } }") +} + +type Book { + title: String! + author: Author! @relationship(type: "WROTE", direction: IN) +} + +type Journal { + subject: String! + author: Author! @relationship(type: "WROTE", direction: IN) +} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver.kt[] +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (author1:Author)-[:WROTE]->(book1:Book) SET author1 = {name: "some-author-name"}, book1 = {title: "a book name", publicationYear: 12} + CREATE (author2:Author)-[:WROTE]->(journal1:Journal) SET author2 = {name: "another author name"}, journal1 = {subject: "a subject", publicationYear: 573} + CREATE (author2)-[:WROTE]->(journal2:Journal) SET journal2 = {subject: "a second subject", publicationYear: 9087} + CREATE (author2)-[:WROTE]->(book2:Book) SET book2 = {title: "another-book-name", publicationYear: 1074} + CREATE (author1)-[:WROTE]->(journal1) +---- + +.GraphQL-Query +[source,graphql] +---- +query Author { + authors { + publicationsWithAuthor + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title + } AS book0 + RETURN book0 AS publications0 UNION + WITH * + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject + } AS journal0 + RETURN journal0 AS publications0 + } + WITH publications0 + RETURN collect(publications0) AS publications0 +} +RETURN this { + .name, + publications: publications0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "authors" : [ { + "publicationsWithAuthor" : [ "a book name by some-author-name", "a subject by some-author-name" ] + }, { + "publicationsWithAuthor" : [ "another-book-name by another author name", "a second subject by another author name", "a subject by another author name" ] + } ] +} +---- + +''' + +=== should select @alias fields + +.Schema +[source,graphql,schema=true] +---- +type City { + name: String! + population: Int @alias(property: "cityPopulation") +} + +type Address { + street: String! + city: City! @relationship(type: "IN_CITY", direction: OUT) +} + +type User { + id: ID! + firstName: String! @alias(property: "first") + lastName: String! + address: Address @relationship(type: "LIVES_AT", direction: OUT) + fullName: String @customResolver(requires: "firstName lastName address { city { name population } }") +} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ComplexFieldCustomResolver2.kt[] +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user1:User)-[:LIVES_AT]->(addr1:Address)-[:IN_CITY]->(city1:City) + SET user1 = {id: "1", first: "First", lastName: "Last"}, addr1 = {city: "some city", street: "some street"}, city1 = {name: "city1 name!", cityPopulation: 8947975} + CREATE (user2:User)-[:LIVES_AT]->(addr2:Address)-[:IN_CITY]->(city2:City) + SET user2 = {id: "2", first: "New First", lastName: "new-last"}, addr2 = {city: "another-city", street: "another-street"}, city2 = {name: "city2 name?", cityPopulation: 74} +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + firstName + fullName + address { + street + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + CALL { + WITH address0 + MATCH (address0)-[inCity0:IN_CITY]->(city0:City) + WITH city0 { + .name, + population: city0.cityPopulation + } AS city + RETURN head(collect(city)) AS city + } + WITH address0 { + .street, + city: city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + firstName: this.first, + address: address, + .lastName +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "users" : [ { + "firstName" : "New First", + "fullName" : "New First new-last from city2 name? with population of 74", + "address" : { + "street" : "another-street" + } + }, { + "firstName" : "First", + "fullName" : "First Last from city1 name! with population of 8947975", + "address" : { + "street" : "some street" + } + } ] +} +---- + +''' + +=== should be able to require fields from a related interface + +.Schema +[source,graphql,schema=true] +---- +interface Publication { + publicationYear: Int! +} + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) + publicationsWithAuthor: [String!]! @customResolver(requires: "name publications { publicationYear ...on Book { title } ... on Journal { subject } }") +} + +type Book implements Publication { + title: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} + +type Journal implements Publication { + subject: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/ArrayFieldCustomResolver2.kt[] +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (author1:Author)-[:WROTE]->(book1:Book) SET author1 = {name: "some-author-name"}, book1 = {title: "a book name", publicationYear: 12} + CREATE (author2:Author)-[:WROTE]->(journal1:Journal) SET author2 = {name: "another author name"}, journal1 = {subject: "a subject", publicationYear: 573} + CREATE (author1)-[:WROTE]->(journal1) +---- + +.GraphQL-Query +[source,graphql] +---- +query Author { + authors { + publicationsWithAuthor + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title, + .publicationYear + } AS book0 + RETURN book0 AS publications UNION + WITH * + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject, + .publicationYear + } AS journal0 + RETURN journal0 AS publications + } + WITH publications + RETURN collect(publications) AS publications +} +RETURN this { + .name, + publications: publications +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "authors" : [ { + "publicationsWithAuthor" : [ "a subject by another author name in 573" ] + }, { + "publicationsWithAuthor" : [ "a book name by some-author-name in 12", "a subject by some-author-name in 573" ] + } ] +} +---- + +''' + +=== should be able to require fields from a nested related interface + +.Schema +[source,graphql,schema=true] +---- +interface Publication { + publicationYear: Int! +} + +type User { + id: ID! + firstName: String! + lastName: String! + followedAuthors: [Author!]! @relationship(type: "FOLLOWS", direction: OUT) + customResolverField: Int @customResolver(requires: "followedAuthors { name publications { publicationYear ...on Book { title } ... on Journal { subject } } } firstName") +} + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) +} + +type Book implements Publication { + title: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} + +type Journal implements Publication { + subject: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/FieldFromInterfaceCustomResolver.kt[] +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user1:User)-[:FOLLOWS]->(author1:Author)-[:WROTE]->(book1:Book) + SET user1 = {id: "1", firstName: "First", lastName: "Last"}, author1 = {name: "some-author-name"}, book1 = {title: "a book name", publicationYear: 12} + CREATE (user1)-[:FOLLOWS]->(author2:Author)-[:WROTE]->(journal1:Journal) SET author2 = {name: "another author name"}, journal1 = {subject: "a subject", publicationYear: 573} + CREATE (author1)-[:WROTE]->(journal1) +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + customResolverField + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[follows0:FOLLOWS]->(author0:Author) + CALL { + WITH author0 + CALL { + WITH * + MATCH (author0)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title, + .publicationYear + } AS book0 + RETURN book0 AS publications UNION + WITH * + MATCH (author0)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject, + .publicationYear + } AS journal0 + RETURN journal0 AS publications + } + WITH publications + RETURN collect(publications) AS publications + } + WITH author0 { + .name, + publications: publications + } AS followedAuthors + RETURN collect(followedAuthors) AS followedAuthors +} +RETURN this { + followedAuthors: followedAuthors, + .firstName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "customResolverField": 1216 + } + ] +} +---- + +''' + +=== should be able to require fields from a nested related union + +.Schema +[source,graphql,schema=true] +---- +type User { + id: ID! + firstName: String! + lastName: String! + followedAuthors: [Author!]! @relationship(type: "FOLLOWS", direction: OUT) + customResolverField: Int @customResolver(requires: "followedAuthors { name publications { ...on Book { title } ... on Journal { subject } } } firstName") +} + +union Publication = Book | Journal + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) +} + +type Book { + title: String! + author: Author! @relationship(type: "WROTE", direction: IN) +} + +type Journal { + subject: String! + author: Author! @relationship(type: "WROTE", direction: IN) +} +---- + +.CustomResolver +[source,kotlin] +---- +include::../../../kotlin/org/neo4j/graphql/custom_resolver/FieldFromUnionCustomResolver.kt[] +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (user1:User)-[:FOLLOWS]->(author1:Author)-[:WROTE]->(book1:Book) + SET user1 = {id: "1", firstName: "First", lastName: "Last"}, author1 = {name: "some-author-name"}, book1 = {title: "a book name", publicationYear: 12} + CREATE (user1)-[:FOLLOWS]->(author2:Author)-[:WROTE]->(journal1:Journal) SET author2 = {name: "another author name"}, journal1 = {subject: "a subject", publicationYear: 573} + CREATE (author1)-[:WROTE]->(journal1) +---- + +.GraphQL-Query +[source,graphql] +---- +query User { + users { + customResolverField + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[follows0:FOLLOWS]->(author0:Author) + CALL { + WITH author0 + CALL { + WITH * + MATCH (author0)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title + } AS book0 + RETURN book0 AS publications0 UNION + WITH * + MATCH (author0)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject + } AS journal0 + RETURN journal0 AS publications0 + } + WITH publications0 + RETURN collect(publications0) AS publications0 + } + WITH author0 { + .name, + publications: publications0 + } AS followedAuthors + RETURN collect(followedAuthors) AS followedAuthors +} +RETURN this { + followedAuthors: followedAuthors, + .firstName +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "customResolverField": 58 + } + ] +} +---- + +''' + +=== should not throw an error if there is another @customResolver field on the same type that is not required + +.Schema +[source,graphql,schema=true] +---- +interface Publication { + publicationYear: Int! +} + +type User { + id: ID! + firstName: String! + lastName: String! @customResolver + followedAuthors: [Author!]! @relationship(type: "FOLLOWS", direction: OUT) + customResolverField: Int @customResolver(requires: "followedAuthors { name publications { publicationYear ...on Book { title } ... on Journal { subject } } } firstName") +} + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) +} + +type Book implements Publication { + title: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} + +type Journal implements Publication { + subject: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Author { + name: String! + publications(directed: Boolean = true, options: PublicationOptions, where: PublicationWhere): [Publication!]! + publicationsConnection(after: String, directed: Boolean = true, first: Int, sort: [AuthorPublicationsConnectionSort!], where: AuthorPublicationsConnectionWhere): AuthorPublicationsConnection! +} + +type AuthorEdge { + cursor: String! + node: Author! +} + +input AuthorOptions { + limit: Int + offset: Int + """ + Specify one or more AuthorSort objects to sort Authors by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [AuthorSort!] +} + +type AuthorPublicationsConnection { + edges: [AuthorPublicationsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input AuthorPublicationsConnectionSort { + node: PublicationSort +} + +input AuthorPublicationsConnectionWhere { + AND: [AuthorPublicationsConnectionWhere!] + NOT: AuthorPublicationsConnectionWhere + OR: [AuthorPublicationsConnectionWhere!] + node: PublicationWhere +} + +type AuthorPublicationsRelationship { + cursor: String! + node: Publication! +} + +""" +Fields to sort Authors by. The order in which sorts are applied is not guaranteed when specifying many fields in one AuthorSort object. +""" +input AuthorSort { + name: SortDirection +} + +input AuthorWhere { + AND: [AuthorWhere!] + NOT: AuthorWhere + OR: [AuthorWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String + """ + Return Authors where all of the related AuthorPublicationsConnections match this filter + """ + publicationsConnection_ALL: AuthorPublicationsConnectionWhere + """ + Return Authors where none of the related AuthorPublicationsConnections match this filter + """ + publicationsConnection_NONE: AuthorPublicationsConnectionWhere + """ + Return Authors where one of the related AuthorPublicationsConnections match this filter + """ + publicationsConnection_SINGLE: AuthorPublicationsConnectionWhere + """ + Return Authors where some of the related AuthorPublicationsConnections match this filter + """ + publicationsConnection_SOME: AuthorPublicationsConnectionWhere + """Return Authors where all of the related Publications match this filter""" + publications_ALL: PublicationWhere + """ + Return Authors where none of the related Publications match this filter + """ + publications_NONE: PublicationWhere + """Return Authors where one of the related Publications match this filter""" + publications_SINGLE: PublicationWhere + """ + Return Authors where some of the related Publications match this filter + """ + publications_SOME: PublicationWhere +} + +type AuthorsConnection { + edges: [AuthorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Book implements Publication { + author(directed: Boolean = true, options: AuthorOptions, where: AuthorWhere): [Author!]! + authorConnection(after: String, directed: Boolean = true, first: Int, sort: [BookAuthorConnectionSort!], where: BookAuthorConnectionWhere): BookAuthorConnection! + publicationYear: Int! + title: String! +} + +type BookAuthorConnection { + edges: [BookAuthorRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input BookAuthorConnectionSort { + node: AuthorSort +} + +input BookAuthorConnectionWhere { + AND: [BookAuthorConnectionWhere!] + NOT: BookAuthorConnectionWhere + OR: [BookAuthorConnectionWhere!] + node: AuthorWhere +} + +type BookAuthorRelationship { + cursor: String! + node: Author! +} + +type BookEdge { + cursor: String! + node: Book! +} + +input BookOptions { + limit: Int + offset: Int + """ + Specify one or more BookSort objects to sort Books by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [BookSort!] +} + +""" +Fields to sort Books by. The order in which sorts are applied is not guaranteed when specifying many fields in one BookSort object. +""" +input BookSort { + publicationYear: SortDirection + title: SortDirection +} + +input BookWhere { + AND: [BookWhere!] + NOT: BookWhere + OR: [BookWhere!] + """ + Return Books where all of the related BookAuthorConnections match this filter + """ + authorConnection_ALL: BookAuthorConnectionWhere + """ + Return Books where none of the related BookAuthorConnections match this filter + """ + authorConnection_NONE: BookAuthorConnectionWhere + """ + Return Books where one of the related BookAuthorConnections match this filter + """ + authorConnection_SINGLE: BookAuthorConnectionWhere + """ + Return Books where some of the related BookAuthorConnections match this filter + """ + authorConnection_SOME: BookAuthorConnectionWhere + """Return Books where all of the related Authors match this filter""" + author_ALL: AuthorWhere + """Return Books where none of the related Authors match this filter""" + author_NONE: AuthorWhere + """Return Books where one of the related Authors match this filter""" + author_SINGLE: AuthorWhere + """Return Books where some of the related Authors match this filter""" + author_SOME: AuthorWhere + publicationYear: Int + publicationYear_GT: Int + publicationYear_GTE: Int + publicationYear_IN: [Int!] + publicationYear_LT: Int + publicationYear_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +type BooksConnection { + edges: [BookEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Journal implements Publication { + author(directed: Boolean = true, options: AuthorOptions, where: AuthorWhere): [Author!]! + authorConnection(after: String, directed: Boolean = true, first: Int, sort: [JournalAuthorConnectionSort!], where: JournalAuthorConnectionWhere): JournalAuthorConnection! + publicationYear: Int! + subject: String! +} + +type JournalAuthorConnection { + edges: [JournalAuthorRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input JournalAuthorConnectionSort { + node: AuthorSort +} + +input JournalAuthorConnectionWhere { + AND: [JournalAuthorConnectionWhere!] + NOT: JournalAuthorConnectionWhere + OR: [JournalAuthorConnectionWhere!] + node: AuthorWhere +} + +type JournalAuthorRelationship { + cursor: String! + node: Author! +} + +type JournalEdge { + cursor: String! + node: Journal! +} + +input JournalOptions { + limit: Int + offset: Int + """ + Specify one or more JournalSort objects to sort Journals by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [JournalSort!] +} + +""" +Fields to sort Journals by. The order in which sorts are applied is not guaranteed when specifying many fields in one JournalSort object. +""" +input JournalSort { + publicationYear: SortDirection + subject: SortDirection +} + +input JournalWhere { + AND: [JournalWhere!] + NOT: JournalWhere + OR: [JournalWhere!] + """ + Return Journals where all of the related JournalAuthorConnections match this filter + """ + authorConnection_ALL: JournalAuthorConnectionWhere + """ + Return Journals where none of the related JournalAuthorConnections match this filter + """ + authorConnection_NONE: JournalAuthorConnectionWhere + """ + Return Journals where one of the related JournalAuthorConnections match this filter + """ + authorConnection_SINGLE: JournalAuthorConnectionWhere + """ + Return Journals where some of the related JournalAuthorConnections match this filter + """ + authorConnection_SOME: JournalAuthorConnectionWhere + """Return Journals where all of the related Authors match this filter""" + author_ALL: AuthorWhere + """Return Journals where none of the related Authors match this filter""" + author_NONE: AuthorWhere + """Return Journals where one of the related Authors match this filter""" + author_SINGLE: AuthorWhere + """Return Journals where some of the related Authors match this filter""" + author_SOME: AuthorWhere + publicationYear: Int + publicationYear_GT: Int + publicationYear_GTE: Int + publicationYear_IN: [Int!] + publicationYear_LT: Int + publicationYear_LTE: Int + subject: String + subject_CONTAINS: String + subject_ENDS_WITH: String + subject_IN: [String!] + subject_STARTS_WITH: String +} + +type JournalsConnection { + edges: [JournalEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +interface Publication { + publicationYear: Int! +} + +type PublicationEdge { + cursor: String! + node: Publication! +} + +enum PublicationImplementation { + Book + Journal +} + +input PublicationOptions { + limit: Int + offset: Int + """ + Specify one or more PublicationSort objects to sort Publications by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [PublicationSort] +} + +""" +Fields to sort Publications by. The order in which sorts are applied is not guaranteed when specifying many fields in one PublicationSort object. +""" +input PublicationSort { + publicationYear: SortDirection +} + +input PublicationWhere { + AND: [PublicationWhere!] + NOT: PublicationWhere + OR: [PublicationWhere!] + publicationYear: Int + publicationYear_GT: Int + publicationYear_GTE: Int + publicationYear_IN: [Int!] + publicationYear_LT: Int + publicationYear_LTE: Int + typename_IN: [PublicationImplementation!] +} + +type PublicationsConnection { + edges: [PublicationEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + authors(options: AuthorOptions, where: AuthorWhere): [Author!]! + authorsConnection(after: String, first: Int, sort: [AuthorSort], where: AuthorWhere): AuthorsConnection! + books(options: BookOptions, where: BookWhere): [Book!]! + booksConnection(after: String, first: Int, sort: [BookSort], where: BookWhere): BooksConnection! + journals(options: JournalOptions, where: JournalWhere): [Journal!]! + journalsConnection(after: String, first: Int, sort: [JournalSort], where: JournalWhere): JournalsConnection! + publications(options: PublicationOptions, where: PublicationWhere): [Publication!]! + publicationsConnection(after: String, first: Int, sort: [PublicationSort], where: PublicationWhere): PublicationsConnection! + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + customResolverField: Int + firstName: String! + followedAuthors(directed: Boolean = true, options: AuthorOptions, where: AuthorWhere): [Author!]! + followedAuthorsConnection(after: String, directed: Boolean = true, first: Int, sort: [UserFollowedAuthorsConnectionSort!], where: UserFollowedAuthorsConnectionWhere): UserFollowedAuthorsConnection! + id: ID! + lastName: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserFollowedAuthorsConnection { + edges: [UserFollowedAuthorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input UserFollowedAuthorsConnectionSort { + node: AuthorSort +} + +input UserFollowedAuthorsConnectionWhere { + AND: [UserFollowedAuthorsConnectionWhere!] + NOT: UserFollowedAuthorsConnectionWhere + OR: [UserFollowedAuthorsConnectionWhere!] + node: AuthorWhere +} + +type UserFollowedAuthorsRelationship { + cursor: String! + node: Author! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + firstName: SortDirection + id: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + firstName: String + firstName_CONTAINS: String + firstName_ENDS_WITH: String + firstName_IN: [String!] + firstName_STARTS_WITH: String + """ + Return Users where all of the related UserFollowedAuthorsConnections match this filter + """ + followedAuthorsConnection_ALL: UserFollowedAuthorsConnectionWhere + """ + Return Users where none of the related UserFollowedAuthorsConnections match this filter + """ + followedAuthorsConnection_NONE: UserFollowedAuthorsConnectionWhere + """ + Return Users where one of the related UserFollowedAuthorsConnections match this filter + """ + followedAuthorsConnection_SINGLE: UserFollowedAuthorsConnectionWhere + """ + Return Users where some of the related UserFollowedAuthorsConnections match this filter + """ + followedAuthorsConnection_SOME: UserFollowedAuthorsConnectionWhere + """Return Users where all of the related Authors match this filter""" + followedAuthors_ALL: AuthorWhere + """Return Users where none of the related Authors match this filter""" + followedAuthors_NONE: AuthorWhere + """Return Users where one of the related Authors match this filter""" + followedAuthors_SINGLE: AuthorWhere + """Return Users where some of the related Authors match this filter""" + followedAuthors_SOME: AuthorWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID!] + id_STARTS_WITH: ID +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + +=== should not throw an error if there is another @customResolver field on a different implementation of the same interface when using ...on + +.Schema +[source,graphql,schema=true] +---- +interface Publication { + publicationYear: Int! +} + +type User { + id: ID! + firstName: String! + lastName: String! + followedAuthors: [Author!]! @relationship(type: "FOLLOWS", direction: OUT) + customResolverField: Int @customResolver(requires: "followedAuthors { name publications { ...on Book { title publicationYear } ... on Journal { subject } } } firstName") +} + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) +} + +type Book implements Publication { + title: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} + +type Journal implements Publication { + subject: String! + publicationYear: Int! @customResolver + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Author { + name: String! + publications(directed: Boolean = true, options: PublicationOptions, where: PublicationWhere): [Publication!]! + publicationsConnection(after: String, directed: Boolean = true, first: Int, sort: [AuthorPublicationsConnectionSort!], where: AuthorPublicationsConnectionWhere): AuthorPublicationsConnection! +} + +type AuthorEdge { + cursor: String! + node: Author! +} + +input AuthorOptions { + limit: Int + offset: Int + """ + Specify one or more AuthorSort objects to sort Authors by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [AuthorSort!] +} + +type AuthorPublicationsConnection { + edges: [AuthorPublicationsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input AuthorPublicationsConnectionSort { + node: PublicationSort +} + +input AuthorPublicationsConnectionWhere { + AND: [AuthorPublicationsConnectionWhere!] + NOT: AuthorPublicationsConnectionWhere + OR: [AuthorPublicationsConnectionWhere!] + node: PublicationWhere +} + +type AuthorPublicationsRelationship { + cursor: String! + node: Publication! +} + +""" +Fields to sort Authors by. The order in which sorts are applied is not guaranteed when specifying many fields in one AuthorSort object. +""" +input AuthorSort { + name: SortDirection +} + +input AuthorWhere { + AND: [AuthorWhere!] + NOT: AuthorWhere + OR: [AuthorWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String + """ + Return Authors where all of the related AuthorPublicationsConnections match this filter + """ + publicationsConnection_ALL: AuthorPublicationsConnectionWhere + """ + Return Authors where none of the related AuthorPublicationsConnections match this filter + """ + publicationsConnection_NONE: AuthorPublicationsConnectionWhere + """ + Return Authors where one of the related AuthorPublicationsConnections match this filter + """ + publicationsConnection_SINGLE: AuthorPublicationsConnectionWhere + """ + Return Authors where some of the related AuthorPublicationsConnections match this filter + """ + publicationsConnection_SOME: AuthorPublicationsConnectionWhere + """Return Authors where all of the related Publications match this filter""" + publications_ALL: PublicationWhere + """ + Return Authors where none of the related Publications match this filter + """ + publications_NONE: PublicationWhere + """Return Authors where one of the related Publications match this filter""" + publications_SINGLE: PublicationWhere + """ + Return Authors where some of the related Publications match this filter + """ + publications_SOME: PublicationWhere +} + +type AuthorsConnection { + edges: [AuthorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Book implements Publication { + author(directed: Boolean = true, options: AuthorOptions, where: AuthorWhere): [Author!]! + authorConnection(after: String, directed: Boolean = true, first: Int, sort: [BookAuthorConnectionSort!], where: BookAuthorConnectionWhere): BookAuthorConnection! + publicationYear: Int! + title: String! +} + +type BookAuthorConnection { + edges: [BookAuthorRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input BookAuthorConnectionSort { + node: AuthorSort +} + +input BookAuthorConnectionWhere { + AND: [BookAuthorConnectionWhere!] + NOT: BookAuthorConnectionWhere + OR: [BookAuthorConnectionWhere!] + node: AuthorWhere +} + +type BookAuthorRelationship { + cursor: String! + node: Author! +} + +type BookEdge { + cursor: String! + node: Book! +} + +input BookOptions { + limit: Int + offset: Int + """ + Specify one or more BookSort objects to sort Books by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [BookSort!] +} + +""" +Fields to sort Books by. The order in which sorts are applied is not guaranteed when specifying many fields in one BookSort object. +""" +input BookSort { + publicationYear: SortDirection + title: SortDirection +} + +input BookWhere { + AND: [BookWhere!] + NOT: BookWhere + OR: [BookWhere!] + """ + Return Books where all of the related BookAuthorConnections match this filter + """ + authorConnection_ALL: BookAuthorConnectionWhere + """ + Return Books where none of the related BookAuthorConnections match this filter + """ + authorConnection_NONE: BookAuthorConnectionWhere + """ + Return Books where one of the related BookAuthorConnections match this filter + """ + authorConnection_SINGLE: BookAuthorConnectionWhere + """ + Return Books where some of the related BookAuthorConnections match this filter + """ + authorConnection_SOME: BookAuthorConnectionWhere + """Return Books where all of the related Authors match this filter""" + author_ALL: AuthorWhere + """Return Books where none of the related Authors match this filter""" + author_NONE: AuthorWhere + """Return Books where one of the related Authors match this filter""" + author_SINGLE: AuthorWhere + """Return Books where some of the related Authors match this filter""" + author_SOME: AuthorWhere + publicationYear: Int + publicationYear_GT: Int + publicationYear_GTE: Int + publicationYear_IN: [Int!] + publicationYear_LT: Int + publicationYear_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +type BooksConnection { + edges: [BookEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Journal implements Publication { + author(directed: Boolean = true, options: AuthorOptions, where: AuthorWhere): [Author!]! + authorConnection(after: String, directed: Boolean = true, first: Int, sort: [JournalAuthorConnectionSort!], where: JournalAuthorConnectionWhere): JournalAuthorConnection! + publicationYear: Int! + subject: String! +} + +type JournalAuthorConnection { + edges: [JournalAuthorRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input JournalAuthorConnectionSort { + node: AuthorSort +} + +input JournalAuthorConnectionWhere { + AND: [JournalAuthorConnectionWhere!] + NOT: JournalAuthorConnectionWhere + OR: [JournalAuthorConnectionWhere!] + node: AuthorWhere +} + +type JournalAuthorRelationship { + cursor: String! + node: Author! +} + +type JournalEdge { + cursor: String! + node: Journal! +} + +input JournalOptions { + limit: Int + offset: Int + """ + Specify one or more JournalSort objects to sort Journals by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [JournalSort!] +} + +""" +Fields to sort Journals by. The order in which sorts are applied is not guaranteed when specifying many fields in one JournalSort object. +""" +input JournalSort { + subject: SortDirection +} + +input JournalWhere { + AND: [JournalWhere!] + NOT: JournalWhere + OR: [JournalWhere!] + """ + Return Journals where all of the related JournalAuthorConnections match this filter + """ + authorConnection_ALL: JournalAuthorConnectionWhere + """ + Return Journals where none of the related JournalAuthorConnections match this filter + """ + authorConnection_NONE: JournalAuthorConnectionWhere + """ + Return Journals where one of the related JournalAuthorConnections match this filter + """ + authorConnection_SINGLE: JournalAuthorConnectionWhere + """ + Return Journals where some of the related JournalAuthorConnections match this filter + """ + authorConnection_SOME: JournalAuthorConnectionWhere + """Return Journals where all of the related Authors match this filter""" + author_ALL: AuthorWhere + """Return Journals where none of the related Authors match this filter""" + author_NONE: AuthorWhere + """Return Journals where one of the related Authors match this filter""" + author_SINGLE: AuthorWhere + """Return Journals where some of the related Authors match this filter""" + author_SOME: AuthorWhere + subject: String + subject_CONTAINS: String + subject_ENDS_WITH: String + subject_IN: [String!] + subject_STARTS_WITH: String +} + +type JournalsConnection { + edges: [JournalEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +interface Publication { + publicationYear: Int! +} + +type PublicationEdge { + cursor: String! + node: Publication! +} + +enum PublicationImplementation { + Book + Journal +} + +input PublicationOptions { + limit: Int + offset: Int + """ + Specify one or more PublicationSort objects to sort Publications by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [PublicationSort] +} + +""" +Fields to sort Publications by. The order in which sorts are applied is not guaranteed when specifying many fields in one PublicationSort object. +""" +input PublicationSort { + publicationYear: SortDirection +} + +input PublicationWhere { + AND: [PublicationWhere!] + NOT: PublicationWhere + OR: [PublicationWhere!] + publicationYear: Int + publicationYear_GT: Int + publicationYear_GTE: Int + publicationYear_IN: [Int!] + publicationYear_LT: Int + publicationYear_LTE: Int + typename_IN: [PublicationImplementation!] +} + +type PublicationsConnection { + edges: [PublicationEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + authors(options: AuthorOptions, where: AuthorWhere): [Author!]! + authorsConnection(after: String, first: Int, sort: [AuthorSort], where: AuthorWhere): AuthorsConnection! + books(options: BookOptions, where: BookWhere): [Book!]! + booksConnection(after: String, first: Int, sort: [BookSort], where: BookWhere): BooksConnection! + journals(options: JournalOptions, where: JournalWhere): [Journal!]! + journalsConnection(after: String, first: Int, sort: [JournalSort], where: JournalWhere): JournalsConnection! + publications(options: PublicationOptions, where: PublicationWhere): [Publication!]! + publicationsConnection(after: String, first: Int, sort: [PublicationSort], where: PublicationWhere): PublicationsConnection! + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + customResolverField: Int + firstName: String! + followedAuthors(directed: Boolean = true, options: AuthorOptions, where: AuthorWhere): [Author!]! + followedAuthorsConnection(after: String, directed: Boolean = true, first: Int, sort: [UserFollowedAuthorsConnectionSort!], where: UserFollowedAuthorsConnectionWhere): UserFollowedAuthorsConnection! + id: ID! + lastName: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserFollowedAuthorsConnection { + edges: [UserFollowedAuthorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input UserFollowedAuthorsConnectionSort { + node: AuthorSort +} + +input UserFollowedAuthorsConnectionWhere { + AND: [UserFollowedAuthorsConnectionWhere!] + NOT: UserFollowedAuthorsConnectionWhere + OR: [UserFollowedAuthorsConnectionWhere!] + node: AuthorWhere +} + +type UserFollowedAuthorsRelationship { + cursor: String! + node: Author! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + firstName: SortDirection + id: SortDirection + lastName: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + firstName: String + firstName_CONTAINS: String + firstName_ENDS_WITH: String + firstName_IN: [String!] + firstName_STARTS_WITH: String + """ + Return Users where all of the related UserFollowedAuthorsConnections match this filter + """ + followedAuthorsConnection_ALL: UserFollowedAuthorsConnectionWhere + """ + Return Users where none of the related UserFollowedAuthorsConnections match this filter + """ + followedAuthorsConnection_NONE: UserFollowedAuthorsConnectionWhere + """ + Return Users where one of the related UserFollowedAuthorsConnections match this filter + """ + followedAuthorsConnection_SINGLE: UserFollowedAuthorsConnectionWhere + """ + Return Users where some of the related UserFollowedAuthorsConnections match this filter + """ + followedAuthorsConnection_SOME: UserFollowedAuthorsConnectionWhere + """Return Users where all of the related Authors match this filter""" + followedAuthors_ALL: AuthorWhere + """Return Users where none of the related Authors match this filter""" + followedAuthors_NONE: AuthorWhere + """Return Users where one of the related Authors match this filter""" + followedAuthors_SINGLE: AuthorWhere + """Return Users where some of the related Authors match this filter""" + followedAuthors_SOME: AuthorWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID!] + id_STARTS_WITH: ID + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/directives/default.adoc b/core/src/test/resources/integration-test-files/directives/default.adoc new file mode 100644 index 00000000..587720be --- /dev/null +++ b/core/src/test/resources/integration-test-files/directives/default.adoc @@ -0,0 +1,200 @@ +:toc: +:toclevels: 42 + += @default directive + +== with primitive fields + +=== on primitive field should not throw an error + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + location: String! @default(value: "somewhere") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + location: String! + name: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + location: SortDirection + name: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + location: String + location_CONTAINS: String + location_ENDS_WITH: String + location_IN: [String!] + location_STARTS_WITH: String + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + +== with enum fields + +=== on enum field should not throw an error + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + location: Location! @default(value: HERE) +} + +enum Location { + HERE + THERE + EVERYWHERE +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +enum Location { + EVERYWHERE + HERE + THERE +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} + +type User { + location: Location! + name: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +input UserOptions { + limit: Int + offset: Int + """ + Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [UserSort!] +} + +""" +Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. +""" +input UserSort { + location: SortDirection + name: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + location: Location + location_IN: [Location!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/directives/node/label.adoc b/core/src/test/resources/integration-test-files/directives/node/label.adoc new file mode 100644 index 00000000..819f9700 --- /dev/null +++ b/core/src/test/resources/integration-test-files/directives/node/label.adoc @@ -0,0 +1,62 @@ +:toc: +:toclevels: 42 + += Node directive labels + +== Setup + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Film {title: "The Matrix",year:1999}) +---- + +== custom labels + +.Schema +[source,graphql,schema=true] +---- +type Movie @node(labels: ["Film"]) { + id: ID + title: String +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Film) +RETURN this { + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "The Matrix" + } + ] +} +---- + +''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/int-fields-should-be-extended-with-increment/decrement-operators.adoc b/core/src/test/resources/integration-test-files/errors.adoc similarity index 55% rename from core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/int-fields-should-be-extended-with-increment/decrement-operators.adoc rename to core/src/test/resources/integration-test-files/errors.adoc index 34385306..efd3a74e 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/int-fields-should-be-extended-with-increment/decrement-operators.adoc +++ b/core/src/test/resources/integration-test-files/errors.adoc @@ -1,19 +1,18 @@ :toc: +:toclevels: 42 -= Algebraic -> Int fields should be extended with Increment/Decrement operators += Errors -== Source schema +== An error should be thrown if no driver is supplied +.Schema [source,graphql,schema=true] ---- type Movie { id: ID - viewers: Int! } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -23,7 +22,6 @@ schema { type Movie { id: ID - viewers: Int! } type MovieEdge { @@ -31,13 +29,40 @@ type MovieEdge { node: Movie! } +input MovieOptions { + limit: Int + offset: Int + """ + Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [MovieSort!] +} + +""" +Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object. +""" +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + type MoviesConnection { edges: [MovieEdge!]! pageInfo: PageInfo! totalCount: Int! } -"Pagination information (Relay)" +"""Pagination information (Relay)""" type PageInfo { endCursor: String hasNextPage: Boolean! @@ -50,44 +75,14 @@ type Query { moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! } -"An enum for sorting in either ascending or descending order." +"""An enum for sorting in either ascending or descending order.""" enum SortDirection { - "Sort by field values in ascending order." + """Sort by field values in ascending order.""" ASC - "Sort by field values in descending order." + """Sort by field values in descending order.""" DESC } - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: Int - viewers_GT: Int - viewers_GTE: Int - viewers_IN: [Int!] - viewers_LT: Int - viewers_LTE: Int -} - ---- ''' + diff --git a/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc b/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc new file mode 100644 index 00000000..30fe96d7 --- /dev/null +++ b/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc @@ -0,0 +1,1490 @@ +:toc: +:toclevels: 42 + += Advanced Filtering + +== ID Filtering + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + property: ID +} +---- + +=== should find Movies IN strings + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies( + where: {property_IN: ["RandomString1", "RandomString2", "RandomString3"]} + ) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property IN $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1" + } + ] +} +---- + +''' + +=== should find Movies REGEX + +.Configuration +[source,json,schema-config=true] +---- +{ + "features": { + "filters": { + "ID": { + "MATCHES": true + } + } + } +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_MATCHES: "(?i)RandomString1.*"}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "(?i)RandomString1.*" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property =~ $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1RandomString1" + } + ] +} +---- + +''' + +=== should find Movies CONTAINS string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1RandomString1"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_CONTAINS: "RandomString1"}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property CONTAINS $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1RandomString1" + }, + { + "property": "RandomString1RandomString1" + }, + { + "property": "RandomString1RandomString1" + } + ] +} +---- + +''' + +=== should find Movies STARTS_WITH string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1RandomString1"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_STARTS_WITH: "RandomString1"}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property STARTS WITH $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1RandomString1" + }, + { + "property": "RandomString1RandomString1" + }, + { + "property": "RandomString1RandomString1" + } + ] +} +---- + +''' + +=== should find Movies ENDS_WITH string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1"}) + CREATE (:Movie {property: "RandomString2"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_ENDS_WITH: "RandomString1"}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property ENDS WITH $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1" + }, + { + "property": "RandomString1RandomString1" + } + ] +} +---- + +''' + +== String Filtering + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + property: String +} +---- + +=== should find Movies IN strings + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies( + where: {property_IN: ["RandomString1", "RandomString2", "RandomString3"]} + ) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property IN $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1" + } + ] +} +---- + +''' + +=== should find Movies REGEX + +.Configuration +[source,json,schema-config=true] +---- +{ + "features": { + "filters": { + "String": { + "MATCHES": true + } + } + } +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_MATCHES: "(?i)RandomString1.*"}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "(?i)RandomString1.*" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property =~ $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1RandomString1" + } + ] +} +---- + +''' + +=== should find Movies CONTAINS string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1RandomString1"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_CONTAINS: "RandomString1"}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property CONTAINS $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1RandomString1" + }, + { + "property": "RandomString1RandomString1" + }, + { + "property": "RandomString1RandomString1" + } + ] +} +---- + +''' + +=== should find Movies STARTS_WITH string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1RandomString1"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_STARTS_WITH: "RandomString1"}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property STARTS WITH $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": "RandomString1RandomString1" + }, + { + "property": "RandomString1RandomString1" + }, + { + "property": "RandomString1RandomString1" + } + ] +} +---- + +''' + +=== should find Movies ENDS_WITH string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: "RandomString1"}) + CREATE (:Movie {property: "RandomString2"}) + CREATE (:Movie {property: "RandomString1RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_ENDS_WITH: "RandomString1"}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property ENDS WITH $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "movies": [ + { + "property": "RandomString1" + }, + { + "property": "RandomString1RandomString1" + } + ] +} +---- + +''' + +== String Filtering + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String +} +---- + +.Configuration +[source,json,schema-config=true] +---- +{ + "features": { + "filters": { + "String": { + "LT": true, + "GT": true, + "LTE": true, + "GTE": true + } + } + } +} +---- + +=== should find Movies GT string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {title: "The Animatrix"}) + CREATE (:Movie {title: "The Matrix"}) + CREATE (:Movie {title: "The Matrix Reloaded"}) + CREATE (:Movie {title: "The Matrix Revolutions"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title_GT: "The Matrix"}) { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Matrix" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title > $param0 +RETURN this { + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "movies": [ + { + "title": "The Matrix Reloaded" + }, + { + "title": "The Matrix Revolutions" + } + ] +} +---- + +''' + +=== should find Movies LT string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {title: "The Matrix"}) + CREATE (:Movie {title: "The Matrix Reloaded"}) + CREATE (:Movie {title: "The Matrix Revolutions"}) + CREATE (:Movie {title: "The Matrix Resurrections"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title_LT: "The Matrix Revolutions"}) { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Matrix Revolutions" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title < $param0 +RETURN this { + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "The Matrix" + }, + { + "title": "The Matrix Reloaded" + }, + { + "title": "The Matrix Resurrections" + } + ] +} +---- + +''' + +=== should find Movies GTE string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {title: "The Animatrix"}) + CREATE (:Movie {title: "The Matrix"}) + CREATE (:Movie {title: "The Matrix Reloaded"}) + CREATE (:Movie {title: "The Matrix Revolutions"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title_GTE: "The Matrix"}) { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Matrix" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title >= $param0 +RETURN this { + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "The Matrix" + }, + { + "title": "The Matrix Reloaded" + }, + { + "title": "The Matrix Revolutions" + } + ] +} +---- + +''' + +=== should find Movies LTE string + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {title: "The Matrix"}) + CREATE (:Movie {title: "The Matrix Reloaded"}) + CREATE (:Movie {title: "The Matrix Revolutions"}) + CREATE (:Movie {title: "The Matrix Resurrections"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title_LTE: "The Matrix Revolutions"}) { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Matrix Revolutions" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title <= $param0 +RETURN this { + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "The Matrix" + }, + { + "title": "The Matrix Reloaded" + }, + { + "title": "The Matrix Revolutions" + }, + { + "title": "The Matrix Resurrections" + } + ] +} +---- + +''' + +== Int Filtering + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + property: Int +} +---- + +=== should find Movies IN numbers + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 3931}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_IN: [3931, 3813, 1484]}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + 3931, + 3813, + 1484 + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property IN $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": 3931 + } + ] +} +---- + +''' + +=== should find Movies LT number + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 1962}) + CREATE (:Movie {property: -1}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_LT: 0}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 0 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property < $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": -1 + } + ] +} +---- + +''' + +=== should find Movies LTE number + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 73}) + CREATE (:Movie {property: -1}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_LTE: 73}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 73 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property <= $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "movies": [ + { + "property": -1 + }, + { + "property": 73 + } + ] +} +---- + +''' + +=== should find Movies GT number + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 3996}) + CREATE (:Movie {property: 3997}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_GT: 3996}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 3996 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property > $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": 3997 + } + ] +} +---- + +''' + +=== should find Movies GTE number + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 926}) + CREATE (:Movie {property: 927}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_GTE: 926}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 926 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property >= $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": 926 + }, + { + "property": 927 + } + ] +} +---- + +''' + +== Float Filtering + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + property: Float +} +---- + +=== should find Movies IN numbers + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 3370.5}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_IN: [3370.5, 6229.5, 4440.5]}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + 3370.5, + 6229.5, + 4440.5 + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property IN $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": 3370.5 + } + ] +} +---- + +''' + +=== should find Movies LT number + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 3609.5}) + CREATE (:Movie {property: -1}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_LT: 0}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 0 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property < $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": -1 + } + ] +} +---- + +''' + +=== should find Movies LTE number + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 5016.5}) + CREATE (:Movie {property: -1}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_LTE: 5016.5}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 5016.5 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property <= $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": 5016.5 + }, + { + "property": -1 + } + ] +} +---- + +''' + +=== should find Movies GT number + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 6420.5}) + CREATE (:Movie {property: 6421.5}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_GT: 6420.5}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 6420.5 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property > $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": 6421.5 + } + ] +} +---- + +''' + +=== should find Movies GTE number + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: 4565.5}) + CREATE (:Movie {property: 4566.5}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property_GTE: 4565.5}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 4565.5 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property >= $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": 4565.5 + }, + { + "property": 4566.5 + } + ] +} +---- + +''' + +== Boolean Filtering + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + property: Boolean +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {property: false}) +---- + +=== should find Movies equality equality + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {property: false}) { + property + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": false +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.property = $param0 +RETURN this { + .property +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "property": false + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/filtering/filter-interface-relationship.adoc b/core/src/test/resources/integration-test-files/filtering/filter-interface-relationship.adoc new file mode 100644 index 00000000..f39d9f5d --- /dev/null +++ b/core/src/test/resources/integration-test-files/filtering/filter-interface-relationship.adoc @@ -0,0 +1,613 @@ +:toc: +:toclevels: 42 + += interface relationships + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! +} + +type Movie implements Production { + title: String! + runtime: Int! +} + +type Series implements Production { + title: String! + episodes: Int! +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + name: String! + currentlyActingIn: Production @relationship(type: "CURRENTLY_ACTING_IN", direction: OUT) + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +== should read and return interface relationship fields with interface relationship filter SOME + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (a)-[:ACTED_IN { screenTime: 9448 }]->(:Movie { title: "RandomString3", runtime:96406 }) + CREATE (a)-[:ACTED_IN { screenTime: 3167 }]->(:Series { title: "RandomString5", episodes: 56834 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 9448 }]->(:Movie { title: "RandomString4", runtime:96406 }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_SOME: {title: $title}}) { + name + actedIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString4" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString4", + "param1": "RandomString4" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 + } + OR EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title = $param1 + }) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString2", + "actedIn": [ + { + "title": "RandomString4", + "runtime": 96406 + } + ] + } + ] +} +---- + +''' + +== should read and return interface relationship fields with interface relationship filter ALL (both implementations in the input and DB) + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:47026 }) + CREATE (a)-[:ACTED_IN { screenTime: 85740 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 96705 }]->(:Series { title: "RandomString4", episodes: 3093 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 85740 }]->(m) + CREATE (a2)-[:ACTED_IN { screenTime: 96705 }]->(:Series { title: "RandomString3", episodes: 3093 }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_ALL: {title: $title}}) { + name + actedIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString3" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString3", + "param1": "RandomString3" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE NOT (this0.title = $param0) + }) + AND EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title = $param1 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE NOT (this1.title = $param1) + })) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString2", + "actedIn": [ + { + "title": "RandomString3", + "runtime": 47026 + }, + { + "title": "RandomString3", + "episodes": 3093 + } + ] + } + ] +} +---- + +''' + +== should read and return interface relationship fields with interface relationship filter ALL (both implementations in the input and one out of two in DB) + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:46474 }) + CREATE (a)-[:ACTED_IN { screenTime: 95753 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 76273 }]->(:Series { title: "RandomString4", episodes: 8658 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 95753 }]->(m) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_ALL: {title: $title}}) { + name + actedIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString3" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString3", + "param1": "RandomString3" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE NOT (this0.title = $param0) + }) + AND EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title = $param1 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE NOT (this1.title = $param1) + })) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [] +} +---- + +''' + +== should read and return interface relationship fields with interface relationship filter SINGLE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:51686 }) + CREATE (a)-[:ACTED_IN { screenTime: 60481 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 75798 }]->(:Series { title: "RandomString5", episodes: 18888 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 60481 }]->(:Movie { title: "RandomString4", runtime:51686 }) + CREATE (a2)-[:ACTED_IN { screenTime: 60481 }]->(m) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_SINGLE: {title: $title}}) { + name + actedIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString4" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString4", + "param1": "RandomString4" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (single(ignore IN [(this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 | 1] + WHERE true) + XOR single(ignore IN [(this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title = $param1 | 1] + WHERE true)) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "actors": [ + { + "name": "RandomString2", + "actedIn": [ + { + "title": "RandomString3", + "runtime": 51686 + }, + { + "title": "RandomString4", + "runtime": 51686 + } + ] + } + ] +} +---- + +''' + +== should read and return interface relationship fields with interface relationship filter NONE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:13985 }) + CREATE (a)-[:ACTED_IN { screenTime: 20492 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 70112 }]->(:Series { title: "RandomString5", episodes: 4471 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 20492 }]->(:Movie { title: "RandomString4", runtime:13985 }) + CREATE (a2)-[:ACTED_IN { screenTime: 20492 }]->(m) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_NONE: {title: $title}}) { + name + actedIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString4" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString4", + "param1": "RandomString4" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 + }) + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title = $param1 + })) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString1", + "actedIn": [ + { + "title": "RandomString3", + "runtime": 13985 + }, + { + "title": "RandomString5", + "episodes": 4471 + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc b/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc new file mode 100644 index 00000000..036fc4a5 --- /dev/null +++ b/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc @@ -0,0 +1,732 @@ +:toc: +:toclevels: 42 + += union relationships + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + runtime: Int! +} + +type Series { + title: String! + episodes: Int! +} + +union Production = Movie | Series + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + name: String! + currentlyActingIn: Production @relationship(type: "CURRENTLY_ACTING_IN", direction: OUT) + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +== should read and return union relationship fields with union relationship filter SOME + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (a)-[:ACTED_IN { screenTime: 83582 }]->(:Movie { title: "RandomString3", runtime:18723 }) + CREATE (a)-[:ACTED_IN { screenTime: 8697 }]->(:Series { title: "RandomString5", episodes: 50148 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 83582 }]->(:Movie { title: "RandomString4", runtime:18723 }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_SOME: {Movie: {title: $title}}}) { + name + actedIn { + ... on Movie { + title + runtime + } + ... on Series { + title + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString4" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString4" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 +} +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn0 UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn0 + } + WITH actedIn0 + RETURN collect(actedIn0) AS actedIn0 +} +RETURN this { + .name, + actedIn: actedIn0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString2", + "actedIn": [ + { + "title": "RandomString4", + "runtime": 18723 + } + ] + } + ] +} +---- + +''' + +== should read and return union relationship fields with union relationship filter ALL (one out of two implementations in the input and DB) + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:61632 }) + CREATE (a)-[:ACTED_IN { screenTime: 69036 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 51960 }]->(:Series { title: "RandomString4", episodes: 61753 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 69036 }]->(m) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_ALL: {Movie: {title: $title}}}) { + name + actedIn { + ... on Movie { + title + runtime + } + ... on Series { + title + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString3" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString3" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE NOT (this0.title = $param0) + })) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn0 UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn0 + } + WITH actedIn0 + RETURN collect(actedIn0) AS actedIn0 +} +RETURN this { + .name, + actedIn: actedIn0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString1", + "actedIn": [ + { + "title": "RandomString3", + "runtime": 61632 + }, + { + "title": "RandomString4", + "episodes": 61753 + } + ] + }, + { + "name": "RandomString2", + "actedIn": [ + { + "title": "RandomString3", + "runtime": 61632 + } + ] + } + ] +} +---- + +''' + +== should read and return union relationship fields with union relationship filter ALL (both implementations in the input and DB) + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:25423 }) + CREATE (a)-[:ACTED_IN { screenTime: 26354 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 74985 }]->(:Series { title: "RandomString4", episodes: 36248 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 26354 }]->(m) + CREATE (a2)-[:ACTED_IN { screenTime: 74985 }]->(:Series { title: "RandomString3", episodes: 36248 }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_ALL: {Movie: {title: $title}, Series: {title: $title}}}) { + name + actedIn { + ... on Movie { + title + runtime + } + ... on Series { + title + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString3" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString3", + "param1": "RandomString3" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE NOT (this0.title = $param0) + }) + AND EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title = $param1 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE NOT (this1.title = $param1) + })) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn0 UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn0 + } + WITH actedIn0 + RETURN collect(actedIn0) AS actedIn0 +} +RETURN this { + .name, + actedIn: actedIn0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString2", + "actedIn": [ + { + "title": "RandomString3", + "runtime": 25423 + }, + { + "title": "RandomString3", + "episodes": 36248 + } + ] + } + ] +} +---- + +''' + +== should read and return union relationship fields with union relationship filter ALL (both implementations in the input and one out of two in DB) + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:24426 }) + CREATE (a)-[:ACTED_IN { screenTime: 65872 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 26046 }]->(:Series { title: "RandomString4", episodes: 84714 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 65872 }]->(m) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_ALL: {Movie: {title: $title}, Series: {title: $title}}}) { + name + actedIn { + ... on Movie { + title + runtime + } + ... on Series { + title + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString3" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString3", + "param1": "RandomString3" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE NOT (this0.title = $param0) + }) + AND EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title = $param1 + } + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE NOT (this1.title = $param1) + })) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn0 UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn0 + } + WITH actedIn0 + RETURN collect(actedIn0) AS actedIn0 +} +RETURN this { + .name, + actedIn: actedIn0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [] +} +---- + +''' + +== should read and return interface relationship fields with interface relationship filter SINGLE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:55815 }) + CREATE (a)-[:ACTED_IN { screenTime: 86611 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 64097 }]->(:Series { title: "RandomString5", episodes: 61405 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 86611 }]->(:Movie { title: "RandomString4", runtime:55815 }) + CREATE (a2)-[:ACTED_IN { screenTime: 86611 }]->(m) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_SINGLE: {Movie: {title: $title}}}) { + name + actedIn { + ... on Movie { + title + runtime + } + ... on Series { + title + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString4" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString4" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE single(ignore IN [(this)-[:ACTED_IN]->(this0:Movie) +WHERE this0.title = $param0 | 1] +WHERE true) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn0 UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn0 + } + WITH actedIn0 + RETURN collect(actedIn0) AS actedIn0 +} +RETURN this { + .name, + actedIn: actedIn0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "actors": [ + { + "name": "RandomString2", + "actedIn": [ + { + "title": "RandomString4", + "runtime": 55815 + }, + { + "title": "RandomString3", + "runtime": 55815 + } + ] + } + ] +} +---- + +''' + +== should read and return interface relationship fields with interface relationship filter NONE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (m:Movie { title: "RandomString3", runtime:9931 }) + CREATE (a)-[:ACTED_IN { screenTime: 29383 }]->(m) + CREATE (a)-[:ACTED_IN { screenTime: 72093 }]->(:Series { title: "RandomString5", episodes: 15912 }) + CREATE (a2:Actor { name: "RandomString2" }) + CREATE (a2)-[:ACTED_IN { screenTime: 29383 }]->(:Movie { title: "RandomString4", runtime:9931 }) + CREATE (a2)-[:ACTED_IN { screenTime: 29383 }]->(m) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($title: String) { + actors(where: {actedIn_NONE: {Movie: {title: $title}, Series: {title: $title}}}) { + name + actedIn { + ... on Movie { + title + runtime + } + ... on Series { + title + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "RandomString4" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString4", + "param1": "RandomString4" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title = $param0 + }) + AND NOT (EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title = $param1 + })) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn0 UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn0 + } + WITH actedIn0 + RETURN collect(actedIn0) AS actedIn0 +} +RETURN this { + .name, + actedIn: actedIn0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString1", + "actedIn": [ + { + "title": "RandomString3", + "runtime": 9931 + }, + { + "title": "RandomString5", + "episodes": 15912 + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/filtering/operations.adoc b/core/src/test/resources/integration-test-files/filtering/operations.adoc new file mode 100644 index 00000000..03e6545c --- /dev/null +++ b/core/src/test/resources/integration-test-files/filtering/operations.adoc @@ -0,0 +1,89 @@ +:toc: +:toclevels: 42 + += Filtering Operations + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String! + age: Int! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Movie { + title: String! + released: Int! + actors: [Person!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {title: "The Matrix", released: 1999}) + CREATE (:Movie {title: "The Italian Job", released: 1969}) + CREATE (:Movie {title: "The Italian Job", released: 2003}) + CREATE (:Movie {title: "The Lion King", released: 1994}) +---- + +== Combine AND and OR operations + +.GraphQL-Query +[source,graphql] +---- +{ + movies( + where: {OR: [{title: "The Italian Job", released: 2003}, {title: "The Lion King"}]} + ) { + title + released + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Italian Job", + "param1": 2003, + "param2": "The Lion King" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE ((this.title = $param0 + AND this.released = $param1) + OR this.title = $param2) +RETURN this { + .title, + .released +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "The Italian Job", + "released": 2003 + }, + { + "title": "The Lion King", + "released": 1994 + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/filtering/single-relationship.adoc b/core/src/test/resources/integration-test-files/filtering/single-relationship.adoc new file mode 100644 index 00000000..c172b5cf --- /dev/null +++ b/core/src/test/resources/integration-test-files/filtering/single-relationship.adoc @@ -0,0 +1,154 @@ +:toc: +:toclevels: 42 + += Single relationship (1-*) filtering + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String! + actedIn: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) + directedMovies: [Movie!]! @relationship(type: "DIRECTED", direction: OUT) + producedMovies: [Movie!]! @relationship(type: "PRODUCED", direction: OUT) +} + +type Movie { + title: String! + actors: [Person!]! @relationship(type: "ACTED_IN", direction: OUT) + director: Person! @relationship(type: "DIRECTED", direction: IN) + producer: Person @relationship(type: "PRODUCED", direction: IN) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {title: "The Matrix", released: 1999}) + CREATE (:Movie {title: "The Italian Job", released: 1969}) + CREATE (:Movie {title: "The Italian Job", released: 2003}) + CREATE (:Movie {title: "The Lion King", released: 1994}) +---- + +== Filter on required and optional relationships + +.Test Data +[source,cypher,test-data=true] +---- +CREATE(jw:Person {name: "Jon Wu"}) + CREATE(:Movie {title: "Hard Target"})<-[:DIRECTED]-(jw) + CREATE(cb:Movie {title: "Chi bi"})<-[:DIRECTED]-(jw) + CREATE(cb)<-[:PRODUCED]-(jw) + CREATE(m:Movie {title: "Avatar"})<-[:DIRECTED]-(:Person {name: "Richie McFamous"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies( + where: {OR: [{director: {name: "Jon Wu"}}, {producer: {name: "Jon Wu"}}]} + ) { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Jon Wu", + "param1": "Jon Wu" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (EXISTS { + MATCH (this0:Person)-[:DIRECTED]->(this) + WHERE this0.name = $param0 + } + OR EXISTS { + MATCH (this1:Person)-[:PRODUCED]->(this) + WHERE this1.name = $param1 + }) +RETURN this { + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "Hard Target" + }, + { + "title": "Chi bi" + } + ] +} +---- + +''' + +== Filter on optional relationships without results + +.Test Data +[source,cypher,test-data=true] +---- +CREATE(jw:Person {name: "Jon Wu"}) + CREATE(:Movie {title: "Hard Target"})<-[:DIRECTED]-(jw) + CREATE(cb:Movie {title: "Chi bi"})<-[:DIRECTED]-(jw) + CREATE(cb)<-[:PRODUCED]-(jw) + CREATE(m:Movie {title: "Avatar"})<-[:DIRECTED]-(:Person {name: "Richie McFamous"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {producer: {name: "Uw Noj"}}) { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Uw Noj" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE EXISTS { + MATCH (this0:Person)-[:PRODUCED]->(this) + WHERE this0.name = $param0 +} +RETURN this { + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/filtering/typename-in.adoc b/core/src/test/resources/integration-test-files/filtering/typename-in.adoc new file mode 100644 index 00000000..e6edfc0e --- /dev/null +++ b/core/src/test/resources/integration-test-files/filtering/typename-in.adoc @@ -0,0 +1,234 @@ +:toc: +:toclevels: 42 + += typename_IN + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! + cost: Float! +} + +type Movie implements Production { + title: String! + cost: Float! + runtime: Int! +} + +type Series implements Production { + title: String! + cost: Float! + episodes: Int! +} + +type Cartoon implements Production { + title: String! + cost: Float! + cartoonist: String! +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE(a:Actor { name: "Keanu" }) + CREATE(a)-[:ACTED_IN]->(m:Movie { title: "The Matrix" }) + CREATE(a)-[:ACTED_IN]->(s:Series { title: "The Matrix animated series" }) + CREATE(a)-[:ACTED_IN]->(c:Cartoon { title: "Matrix the cartoon" }) +---- + +== top-level + +.GraphQL-Query +[source,graphql] +---- +{ + productions( + where: {OR: [{AND: [{title: "The Matrix"}, {typename_IN: [Movie]}]}, {typename_IN: [Series]}]} + ) { + __typename + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Matrix", + "param1": "The Matrix", + "param2": "The Matrix" +} +---- + +.Expected Cypher output +[source,cypher] +---- +CALL { + MATCH (cartoon0:Cartoon) + WHERE ((cartoon0.title = $param0 + AND cartoon0:Movie) + OR cartoon0:Series) + WITH cartoon0 { + __typename: 'Cartoon', + __id: elementId(cartoon0), + .title + } AS cartoon0 + RETURN cartoon0 AS this UNION + MATCH (movie0:Movie) + WHERE ((movie0.title = $param1 + AND movie0:Movie) + OR movie0:Series) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS this UNION + MATCH (series0:Series) + WHERE ((series0.title = $param2 + AND series0:Movie) + OR series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title + } AS series0 + RETURN series0 AS this +} +WITH this +RETURN this AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "productions": [ + { + "__typename": "Movie", + "title": "The Matrix" + }, + { + "__typename": "Series", + "title": "The Matrix animated series" + } + ] +} +---- + +''' + +== nested + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedIn( + where: {OR: [{AND: [{title: "The Matrix"}, {typename_IN: [Movie]}]}, {typename_IN: [Series]}]} + ) { + __typename + title + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Matrix", + "param1": "The Matrix", + "param2": "The Matrix" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(cartoon0:Cartoon) + WHERE ((cartoon0.title = $param0 + AND cartoon0:Movie) + OR cartoon0:Series) + WITH cartoon0 { + __typename: 'Cartoon', + __id: elementId(cartoon0), + .title + } AS cartoon0 + RETURN cartoon0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) + WHERE ((movie0.title = $param1 + AND movie0:Movie) + OR movie0:Series) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) + WHERE ((series0.title = $param2 + AND series0:Movie) + OR series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "actedIn": [ + { + "__typename": "Movie", + "title": "The Matrix" + }, + { + "__typename": "Series", + "title": "The Matrix animated series" + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/find.adoc b/core/src/test/resources/integration-test-files/find.adoc new file mode 100644 index 00000000..9e10c7eb --- /dev/null +++ b/core/src/test/resources/integration-test-files/find.adoc @@ -0,0 +1,597 @@ +:toc: +:toclevels: 42 + += find + +== should find Movie by id + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Movie { + id: ID! + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1"}), (:Movie {id: "RandomString1"}), (:Movie {id: "RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($id: ID) { + movies(where: {id: $id}) { + id + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id = $param0 +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1" + }, + { + "id": "RandomString1" + }, + { + "id": "RandomString1" + } + ] +} +---- + +''' + +== should find Move by id and limit + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Movie { + id: ID! + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1"}), (:Movie {id: "RandomString1"}), (:Movie {id: "RandomString1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($id: ID) { + movies(where: {id: $id}, options: {limit: 2}) { + id + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": 2 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id = $param0 +WITH * LIMIT $param1 +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1" + }, + { + "id": "RandomString1" + } + ] +} +---- + +''' + +== should find Movie IN ids + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Movie { + id: ID! + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1"}), (:Movie {id: "RandomString2"}), (:Movie {id: "RandomString3"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($ids: [ID!]) { + movies(where: {id_IN: $ids}) { + id + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "ids": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id IN $param0 +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "movies": [ + { + "id": "RandomString2" + }, + { + "id": "RandomString3" + }, + { + "id": "RandomString1" + } + ] +} +---- + +''' + +== should find Movie IN ids with one other param + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Movie { + id: ID! + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:User {id: "RandomString1", title: "RandomString4"}), (:User {id: "RandomString2", title: "RandomString4"}), (:User {id: "RandomString3", title: "RandomString4"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($ids: [ID!], $title: String) { + movies(where: {id_IN: $ids, title: $title}) { + id + title + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "ids": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "title": "RandomString4" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "param1": "RandomString4" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.title = $param1) +RETURN this { + .id, + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [] +} +---- + +''' + +== should find Movie IN id and many Movie.actor IN id + +.Schema +[source,graphql,schema=true] +---- +type Actor { + id: ID! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Movie { + id: ID! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1"})-[:ACTED_IN]->(:Actor {id: "RandomString4"}), + (:Movie {id: "RandomString2"})-[:ACTED_IN]->(:Actor {id: "RandomString5"}), + (:Movie {id: "RandomString3"})-[:ACTED_IN]->(:Actor {id: "RandomString6"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($movieIds: [ID!], $actorIds: [ID!]) { + movies(where: {id_IN: $movieIds}) { + id + actors(where: {id_IN: $actorIds}) { + id + movies { + id + actors { + id + } + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "movieIds": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "actorIds": [ + "RandomString4", + "RandomString5", + "RandomString6" + ] +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "param1": [ + "RandomString4", + "RandomString5", + "RandomString6" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id IN $param0 +CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(actor0:Actor) + WHERE actor0.id IN $param1 + CALL { + WITH actor0 + MATCH (movie0:Movie)-[actedIn1:ACTED_IN]->(actor0) + CALL { + WITH movie0 + MATCH (movie0)-[actedIn2:ACTED_IN]->(actor1:Actor) + WITH actor1 { + .id + } AS actors + RETURN collect(actors) AS actors + } + WITH movie0 { + .id, + actors: actors + } AS movies + RETURN collect(movies) AS movies + } + WITH actor0 { + .id, + movies: movies + } AS actors + RETURN collect(actors) AS actors +} +RETURN this { + .id, + actors: actors +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "movies": [ + { + "id": "RandomString3", + "actors": [ + { + "id": "RandomString6", + "movies": [ + { + "id": "RandomString3", + "actors": [ + { + "id": "RandomString6" + } + ] + } + ] + } + ] + }, + { + "id": "RandomString1", + "actors": [ + { + "id": "RandomString4", + "movies": [ + { + "id": "RandomString1", + "actors": [ + { + "id": "RandomString4" + } + ] + } + ] + } + ] + }, + { + "id": "RandomString2", + "actors": [ + { + "id": "RandomString5", + "movies": [ + { + "id": "RandomString2", + "actors": [ + { + "id": "RandomString5" + } + ] + } + ] + } + ] + } + ] +} +---- + +''' + +== should use OR and find Movie by id or title + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Movie { + id: ID! + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT) + mainActor: Actor! @relationship(type: "MAIN_ACTOR", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {id: "RandomString1", title: "RandomString2"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($movieWhere: MovieWhere) { + movies(where: $movieWhere) { + id + title + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "movieWhere": { + "OR": [ + { + "title": "RandomString2", + "id": "RandomString1" + } + ] + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": "RandomString2" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id = $param0 + AND this.title = $param1) +RETURN this { + .id, + .title +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "title": "RandomString2" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_1.adoc b/core/src/test/resources/integration-test-files/home/andreas/projects/neo4j-graphql/packages/graphql/tests/integration/undirected-relationships.test.ts.adoc similarity index 58% rename from core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_1.adoc rename to core/src/test/resources/integration-test-files/home/andreas/projects/neo4j-graphql/packages/graphql/tests/integration/undirected-relationships.test.ts.adoc index bf2d715d..98fca6b2 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_1.adoc +++ b/core/src/test/resources/integration-test-files/home/andreas/projects/neo4j-graphql/packages/graphql/tests/integration/undirected-relationships.test.ts.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Undirected relationships += undirected relationships -== Source schema +== query for an undirected relationship +.Schema [source,graphql,schema=true] ---- type User { @@ -12,18 +14,24 @@ type User { } ---- -== query with directed and undirected relationships +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:User {name: "Arthur"}) + CREATE (b:User {name: "Ford"}) + CREATE (a)-[:FRIENDS_WITH]->(b) +---- .GraphQL-Query [source,graphql] ---- { - users { + users(where: {name: "Ford"}) { name friends: friends(directed: false) { name } - directedFriends: friends { + directedFriends: friends(directed: true) { name } } @@ -33,13 +41,16 @@ type User { .Expected Cypher params [source,json] ---- -{ } +{ + "param0": "Ford" +} ---- .Expected Cypher output [source,cypher] ---- MATCH (this:User) +WHERE this.name = $param0 CALL { WITH this MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) @@ -63,5 +74,23 @@ RETURN this { } AS this ---- +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "name": "Ford", + "friends": [ + { + "name": "Arthur" + } + ], + "directedFriends": [] + } + ] +} +---- + ''' diff --git a/core/src/test/resources/integration-test-files/interfaces/relationships/read.adoc b/core/src/test/resources/integration-test-files/interfaces/relationships/read.adoc new file mode 100644 index 00000000..32ba0111 --- /dev/null +++ b/core/src/test/resources/integration-test-files/interfaces/relationships/read.adoc @@ -0,0 +1,464 @@ +:toc: +:toclevels: 42 + += interface relationships + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! +} + +type Movie implements Production { + title: String! + runtime: Int! +} + +type Series implements Production { + title: String! + episodes: Int! +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + name: String! + currentlyActingIn: Production @relationship(type: "CURRENTLY_ACTING_IN", direction: OUT) + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +== should read and return interface relationship fields + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (a)-[:ACTED_IN { screenTime: 47337 }]->(:Movie { title: "RandomString2", runtime:88052 }) + CREATE (a)-[:ACTED_IN { screenTime: 99847 }]->(:Series { title: "RandomString3", episodes: 45953 }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String) { + actors(where: {name: $name}) { + name + actedIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString1", + "actedIn": [ + { + "title": "RandomString2", + "runtime": 88052 + }, + { + "title": "RandomString3", + "episodes": 45953 + } + ] + } + ] +} +---- + +''' + +== should read and return sorted interface relationship fields + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (:Movie { title: "A", runtime:23408 })<-[:ACTED_IN { screenTime: 40446 }]-(a)-[:ACTED_IN { screenTime: 89440 }]->(:Movie { title: "B", runtime: 76130 }) + CREATE (:Series { title: "C", episodes: 64675 })<-[:ACTED_IN { screenTime: 83928 }]-(a)-[:ACTED_IN { screenTime: 83728 }]->(:Series { title: "D", episodes: 8135 }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String) { + actors(where: {name: $name}) { + name + actedIn(options: {sort: [{title: DESC}]}) { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn ORDER BY actedIn.title DESC + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString1", + "actedIn": [ + { + "title": "D", + "episodes": 8135 + }, + { + "title": "C", + "episodes": 64675 + }, + { + "title": "B", + "runtime": 76130 + }, + { + "title": "A", + "runtime": 23408 + } + ] + } + ] +} +---- + +''' + +== should read and return non-array interface relationship fields + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (a)-[:ACTED_IN { screenTime: 50667 }]->(:Movie { title: "RandomString2", runtime:85953 }) + CREATE (a)-[:ACTED_IN { screenTime: 1726 }]->(:Series { title: "RandomString3", episodes: 85490 }) + CREATE (a)-[:CURRENTLY_ACTING_IN]->(:Movie { title: "RandomString4", runtime: 6106 }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String) { + actors(where: {name: $name}) { + name + currentlyActingIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[currentlyActingIn0:CURRENTLY_ACTING_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS currentlyActingIn UNION + WITH * + MATCH (this)-[currentlyActingIn1:CURRENTLY_ACTING_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS currentlyActingIn + } + WITH currentlyActingIn + RETURN head(collect(currentlyActingIn)) AS currentlyActingIn +} +RETURN this { + .name, + currentlyActingIn: currentlyActingIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString1", + "currentlyActingIn": { + "title": "RandomString4", + "runtime": 6106 + } + } + ] +} +---- + +''' + +== should read and return interface relationship fields with shared where + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "RandomString1" }) + CREATE (a)-[:ACTED_IN { screenTime: 28270 }]->(:Movie { title: "Apple", runtime:76300 }) + CREATE (a)-[:ACTED_IN { screenTime: 28270 }]->(:Movie { title: "RandomString2", runtime:76300 }) + CREATE (a)-[:ACTED_IN { screenTime: 70458 }]->(:Series { title: "Apple", episodes: 52388 }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors($name: String, $title: String) { + actors(where: {name: $name}) { + name + actedIn(where: {title: $title}) { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "name": "RandomString1", + "title": "Apple" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": "Apple", + "param2": "Apple" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.name = $param0 +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WHERE movie0.title = $param1 + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WHERE series0.title = $param2 + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "RandomString1", + "actedIn": [ + { + "title": "Apple", + "runtime": 76300 + }, + { + "title": "Apple", + "episodes": 52388 + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/1683.adoc b/core/src/test/resources/integration-test-files/issues/1683.adoc new file mode 100644 index 00000000..84610710 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/1683.adoc @@ -0,0 +1,103 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/1683 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type System { + code: String! + updatesData: [GovernedData!]! @relationship(type: "UPDATED_BY", direction: IN) +} + +type GovernedData { + code: String! + updatedBy: [System!]! @relationship(type: "UPDATED_BY", direction: OUT) +} +---- + +== should return top level entity, even if no connections exist + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (s:System { code: "arthur" }); +---- + +.GraphQL-Query +[source,graphql] +---- +{ + systems { + code + updatesDataConnection { + edges { + node { + code + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:System) +CALL { + WITH this + MATCH (governedData0:GovernedData)-[updatedBy0:UPDATED_BY]->(this) + WITH collect( { + node: governedData0, + relationship: updatedBy0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS governedData0, edge.relationship AS updatedBy0 + RETURN collect( { + node: { + __typename: 'GovernedData', + code: governedData0.code + } + }) AS updatesDataConnectionEdges + } + RETURN { + edges: updatesDataConnectionEdges, + totalCount: totalCount + } AS updatesDataConnection +} +RETURN this { + .code, + updatesDataConnection: updatesDataConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "systems": [ + { + "code": "arthur", + "updatesDataConnection": { + "edges": [] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/1686.adoc b/core/src/test/resources/integration-test-files/issues/1686.adoc new file mode 100644 index 00000000..b455f1d1 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/1686.adoc @@ -0,0 +1,78 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/1686 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Production { + id: ID + title: String +} + +type Movie implements Production { + id: ID + title: String + genres: [Genre!]! @relationship(type: "HAS_GENRE", direction: OUT) +} + +type Genre { + name: String + movies: [Production!]! @relationship(type: "HAS_GENRE", direction: IN) +} +---- + +== should be possible to count all the movies connections + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (c:Movie { id: "1", title: "Matrix" })-[:HAS_GENRE]->(:Genre { id: "10", name: "Sci-fi" }) + CREATE (c)-[:HAS_GENRE]->(g2:Genre { id: "11", name: "Action" }) + CREATE (h:Movie { id: "2", title: "The Hobbit" })-[:HAS_GENRE]->(g3:Genre { id: "12", name: "Fantasy" }) +---- + +.GraphQL-Query +[source,graphql] +---- +query MoviesConnection { + moviesConnection { + totalCount + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WITH collect( { + node: this +}) AS edges +WITH edges, size(edges) AS totalCount +RETURN { + totalCount: totalCount +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "moviesConnection": { + "totalCount": 2 + } +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/1687.adoc b/core/src/test/resources/integration-test-files/issues/1687.adoc new file mode 100644 index 00000000..eae8ee8b --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/1687.adoc @@ -0,0 +1,86 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/1687 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Production { + id: ID + title: String +} + +type Movie implements Production { + id: ID + title: String + genres: [Genre!]! @relationship(type: "HAS_GENRE", direction: OUT) +} + +type Genre { + name: String + movies: [Production!]! @relationship(type: "HAS_GENRE", direction: IN) +} +---- + +== should be able to return all the genres related the Matrix movie using connection fields + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (c:Movie { id: "1", title: "Matrix" })-[:HAS_GENRE]->(:Genre { id: "10", name: "Sci-fi" }) + CREATE (c)-[:HAS_GENRE]->(g2:Genre { id: "11", name: "Action" }) + CREATE (h:Movie { id: "2", title: "The Hobbit" })-[:HAS_GENRE]->(g3:Genre { id: "12", name: "Fantasy" }) +---- + +.GraphQL-Query +[source,graphql] +---- +query Genres { + genres(where: {moviesConnection_SOME: {node: {title: "Matrix"}}}) { + name + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Matrix" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Genre) +WHERE EXISTS { + MATCH (this0)-[edge:HAS_GENRE]->(this) + WHERE (this0.title = $param0 + AND this0:Movie) +} +RETURN this { + .name +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "genres": [ + { + "name": "Sci-fi" + }, + { + "name": "Action" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/1779.adoc b/core/src/test/resources/integration-test-files/issues/1779.adoc new file mode 100644 index 00000000..885422b0 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/1779.adoc @@ -0,0 +1,115 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/1779 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String + age: Int + attends: [School!]! @relationship(type: "ATTENDS", direction: OUT) +} + +type School { + name: String + students: [Person!]! @relationship(type: "ATTENDS", direction: IN) +} +---- + +== Does not throw error 'The EXISTS subclause is not valid inside a WITH or RETURN clause. ' + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (personA:Person { name: "A", age: 24 })-[:ATTENDS]->(schoolOld:School { name: "Old" }) + CREATE (personB:Person { name: "B", age: 26 })-[:ATTENDS]->(schoolOld) + CREATE (personC:Person { name: "C", age: 23 })-[:ATTENDS]->(schoolYoung:School { name: "Young" }) + CREATE (personD:Person { name: "D", age: 25 })-[:ATTENDS]->(schoolYoung) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + people { + name + attends(where: {students_ALL: {age_GT: 23}}) { + name + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 23 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Person) +CALL { + WITH this + MATCH (this)-[attends0:ATTENDS]->(school0:School) + WHERE (EXISTS { + MATCH (school00:Person)-[:ATTENDS]->(school0) + WHERE school00.age > $param0 + } + AND NOT (EXISTS { + MATCH (school00:Person)-[:ATTENDS]->(school0) + WHERE NOT (school00.age > $param0) + })) + WITH school0 { + .name + } AS attends + RETURN collect(attends) AS attends +} +RETURN this { + .name, + attends: attends +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "people": [ + { + "name": "A", + "attends": [ + { + "name": "Old" + } + ] + }, + { + "name": "C", + "attends": [] + }, + { + "name": "D", + "attends": [] + }, + { + "name": "B", + "attends": [ + { + "name": "Old" + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/207.adoc b/core/src/test/resources/integration-test-files/issues/207.adoc new file mode 100644 index 00000000..72d17ace --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/207.adoc @@ -0,0 +1,60 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/207 + +== __resolveType resolvers are correctly evaluated + +.Schema +[source,graphql,schema=true] +---- +union Result = Book | Author + +type Book { + title: String +} + +type Author { + name: String +} + +type Query { + search: [Result] +} +---- + +.GraphQL-Query +[source,graphql] +---- +query GetSearchResults { + search { + __typename + ... on Book { + title + } + ... on Author { + name + } + } +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "search": [ + { + "__typename": "Book", + "title": "GraphQL Unions for Dummies" + }, + { + "__typename": "Author", + "name": "Darrell" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/2262.adoc b/core/src/test/resources/integration-test-files/issues/2262.adoc new file mode 100644 index 00000000..f743c842 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/2262.adoc @@ -0,0 +1,149 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/2262 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Component { + uuid: String + upstreamProcess: Process @relationship(type: "OUTPUT", direction: IN) + downstreamProcesses: [Process!]! @relationship(type: "INPUT", direction: OUT) +} + +type Process { + uuid: String + componentOutputs: [Component!]! @relationship(type: "OUTPUT", direction: OUT) + componentInputs: [Component!]! @relationship(type: "INPUT", direction: IN) +} +---- + +== nested update with create while using subscriptions should generate valid Cypher + +.Test Data +[source,cypher,test-data=true] +---- +CREATE(:Component {uuid: "c1"})<-[:OUTPUT]-(:Process {uuid: "p1"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ComponentsProcesses { + components(where: {uuid: "c1"}) { + uuid + upstreamProcessConnection { + edges { + node { + uuid + componentInputsConnection(sort: [{node: {uuid: DESC}}]) { + edges { + node { + uuid + } + } + } + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "c1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Component) +WHERE this.uuid = $param0 +CALL { + WITH this + MATCH (process0:Process)-[output0:OUTPUT]->(this) + WITH collect( { + node: process0, + relationship: output0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS process0, edge.relationship AS output0 + CALL { + WITH process0 + MATCH (component0:Component)-[input0:INPUT]->(process0) + WITH collect( { + node: component0, + relationship: input0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS component0, edge.relationship AS input0 ORDER BY component0.uuid DESC + RETURN collect( { + node: { + __typename: 'Component', + uuid: component0.uuid + } + }) AS componentInputsConnectionEdges + } + RETURN { + edges: componentInputsConnectionEdges, + totalCount: totalCount + } AS componentInputsConnection + } + RETURN collect( { + node: { + __typename: 'Process', + uuid: process0.uuid, + componentInputsConnection: componentInputsConnection + } + }) AS upstreamProcessConnectionEdges + } + RETURN { + edges: upstreamProcessConnectionEdges, + totalCount: totalCount + } AS upstreamProcessConnection +} +RETURN this { + .uuid, + upstreamProcessConnection: upstreamProcessConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "components": [ + { + "uuid": "c1", + "upstreamProcessConnection": { + "edges": [ + { + "node": { + "uuid": "p1", + "componentInputsConnection": { + "edges": [] + } + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/2820.adoc b/core/src/test/resources/integration-test-files/issues/2820.adoc new file mode 100644 index 00000000..615a17bc --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/2820.adoc @@ -0,0 +1,943 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/2820 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! +} + +type Movie implements Production { + title: String! +} + +type Series implements Production { + title: String! +} + +union ProductionUnion = Movie | Series + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT) + actedInUnion: [ProductionUnion!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "Actor" }) + CREATE (a)-[:ACTED_IN]->(:Movie { title: "House" }) + CREATE (a)-[:ACTED_IN]->(:Series { title: "House" }) + CREATE (a)-[:ACTED_IN]->(:Movie { title: "Friends" }) + CREATE (a)-[:ACTED_IN]->(:Series { title: "Friends" }) +---- + +== interface count and amount should be correct + +=== should return total count 4 + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInConnection { + totalCount + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + node: { + __id: elementId(movie0), + __typename: 'Movie' + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + node: { + __id: elementId(series0), + __typename: 'Series' + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "actedInConnection": { + "totalCount": 4 + } + } + ] +} +---- + +''' + +=== should return interface members in Connection + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInConnection { + totalCount + edges { + node { + __typename + title + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + node: { + __typename: 'Movie', + title: movie0.title, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + node: { + __typename: 'Series', + title: series0.title, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "actors": [ + { + "actedInConnection": { + "totalCount": 4, + "edges": [ + { + "node": { + "__typename": "Movie", + "title": "House" + } + }, + { + "node": { + "__typename": "Movie", + "title": "Friends" + } + }, + { + "node": { + "__typename": "Series", + "title": "House" + } + }, + { + "node": { + "__typename": "Series", + "title": "Friends" + } + } + ] + } + } + ] +} +---- + +''' + +=== should return interface members in Connection without querying title + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInConnection { + totalCount + edges { + node { + __typename + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + node: { + __typename: 'Movie', + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + node: { + __typename: 'Series', + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "actedInConnection": { + "totalCount": 4, + "edges": [ + { + "node": { + "__typename": "Movie" + } + }, + { + "node": { + "__typename": "Movie" + } + }, + { + "node": { + "__typename": "Series" + } + }, + { + "node": { + "__typename": "Series" + } + } + ] + } + } + ] +} +---- + +''' + +=== should return interface members in normal field + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedIn { + __typename + title + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "actors": [ + { + "actedIn": [ + { + "__typename": "Movie", + "title": "House" + }, + { + "__typename": "Movie", + "title": "Friends" + }, + { + "__typename": "Series", + "title": "House" + }, + { + "__typename": "Series", + "title": "Friends" + } + ] + } + ] +} +---- + +''' + +=== should return interface members in normal field without querying title + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedIn { + __typename + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0) + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0) + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "actedIn": [ + { + "__typename": "Movie" + }, + { + "__typename": "Movie" + }, + { + "__typename": "Series" + }, + { + "__typename": "Series" + } + ] + } + ] +} +---- + +''' + +== union count and amount should be correct + +=== should return total count 4 + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInUnionConnection { + totalCount + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + node: { + __id: elementId(movie0), + __typename: 'Movie' + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + node: { + __id: elementId(series0), + __typename: 'Series' + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInUnionConnection +} +RETURN this { + actedInUnionConnection: actedInUnionConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "actedInUnionConnection": { + "totalCount": 4 + } + } + ] +} +---- + +''' + +=== should return interface members in Connection + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInUnionConnection { + totalCount + edges { + node { + __typename + ... on Movie { + title + } + ... on Series { + title + } + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + node: { + __typename: 'Movie', + title: movie0.title, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + node: { + __typename: 'Series', + title: series0.title, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInUnionConnection +} +RETURN this { + actedInUnionConnection: actedInUnionConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "actors": [ + { + "actedInUnionConnection": { + "totalCount": 4, + "edges": [ + { + "node": { + "__typename": "Movie", + "title": "House" + } + }, + { + "node": { + "__typename": "Movie", + "title": "Friends" + } + }, + { + "node": { + "__typename": "Series", + "title": "Friends" + } + }, + { + "node": { + "__typename": "Series", + "title": "House" + } + } + ] + } + } + ] +} +---- + +''' + +=== should return interface members in Connection without querying title + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInUnionConnection { + totalCount + edges { + node { + __typename + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + node: { + __typename: 'Movie', + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + node: { + __typename: 'Series', + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInUnionConnection +} +RETURN this { + actedInUnionConnection: actedInUnionConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "actedInUnionConnection": { + "totalCount": 4, + "edges": [ + { + "node": { + "__typename": "Movie" + } + }, + { + "node": { + "__typename": "Movie" + } + }, + { + "node": { + "__typename": "Series" + } + }, + { + "node": { + "__typename": "Series" + } + } + ] + } + } + ] +} +---- + +''' + +=== should return interface members in normal field + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInUnion { + __typename + ... on Movie { + title + } + ... on Series { + title + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS actedInUnion0 UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title + } AS series0 + RETURN series0 AS actedInUnion0 + } + WITH actedInUnion0 + RETURN collect(actedInUnion0) AS actedInUnion0 +} +RETURN this { + actedInUnion: actedInUnion0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "actors": [ + { + "actedInUnion": [ + { + "__typename": "Movie", + "title": "House" + }, + { + "__typename": "Movie", + "title": "Friends" + }, + { + "__typename": "Series", + "title": "House" + }, + { + "__typename": "Series", + "title": "Friends" + } + ] + } + ] +} +---- + +''' + +=== should return interface members in normal field without querying title + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInUnion { + __typename + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0) + } AS movie0 + RETURN movie0 AS actedInUnion0 UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0) + } AS series0 + RETURN series0 AS actedInUnion0 + } + WITH actedInUnion0 + RETURN collect(actedInUnion0) AS actedInUnion0 +} +RETURN this { + actedInUnion: actedInUnion0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "actedInUnion": [ + { + "__typename": "Movie" + }, + { + "__typename": "Movie" + }, + { + "__typename": "Series" + }, + { + "__typename": "Series" + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/2847.adoc b/core/src/test/resources/integration-test-files/issues/2847.adoc new file mode 100644 index 00000000..8c781662 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/2847.adoc @@ -0,0 +1,92 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/2847 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Product { + name: String! +} + +type Movie implements Product { + name: String! +} + +type Actor { + name: String! + product: Product @relationship(type: "HAS_PRODUCT", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (c:Actor) + SET c.name = "Keanu" +---- + +== should returns actors even without any related product + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + name + product { + name + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[hasProduct0:HAS_PRODUCT]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .name + } AS movie0 + RETURN movie0 AS product + } + WITH product + RETURN head(collect(product)) AS product +} +RETURN this { + .name, + product: product +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "Keanu", + "product": null + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/3009.adoc b/core/src/test/resources/integration-test-files/issues/3009.adoc new file mode 100644 index 00000000..d43ab326 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/3009.adoc @@ -0,0 +1,73 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/3009 + +== custom resolvers should correctly format dates + +.Schema +[source,graphql,schema=true] +---- +type User { + joinedAt: Date! +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + users { + joinedAt + } +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "joinedAt": "2020-01-01" + } + ] +} +---- + +''' + +== custom resolvers should correctly format dateTimes + +.Schema +[source,graphql,schema=true] +---- +type User { + joinedAt: DateTime! +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + users { + joinedAt + } +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "joinedAt": "2020-01-01T00:00:00.000Z" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/3394.adoc b/core/src/test/resources/integration-test-files/issues/3394.adoc new file mode 100644 index 00000000..3cc6838b --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/3394.adoc @@ -0,0 +1,351 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/3394 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Employee { + products: [Product!]! @relationship(type: "CAN_ACCESS", direction: OUT) +} + +type Product { + id: String! @alias(property: "fg_item_id") + description: String! + partNumber: ID! @alias(property: "fg_item") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (e:Employee {fg_item_id: "p1", description: "a p1", fg_item: "part1"}) + CREATE (p1:Product {fg_item_id: "p1", description: "a p1", fg_item: "part1"}) + CREATE (p2:Product {fg_item_id: "p2", description: "a p2", fg_item: "part2"}) + + CREATE (e)-[:CAN_ACCESS]->(p1) + CREATE (e)-[:CAN_ACCESS]->(p2) +---- + +== should sort elements by aliased field + +.GraphQL-Query +[source,graphql] +---- +query listProducts { + products(options: {sort: {partNumber: DESC}}) { + id + partNumber + description + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Product) +WITH * ORDER BY this.fg_item DESC +RETURN this { + id: this.fg_item_id, + partNumber: this.fg_item, + .description +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "products": [ + { + "id": "p2", + "partNumber": "part2", + "description": "a p2" + }, + { + "id": "p1", + "partNumber": "part1", + "description": "a p1" + } + ] +} +---- + +''' + +== should sort elements by aliased field in relationship + +.GraphQL-Query +[source,graphql] +---- +query listProducts { + employees { + products(options: {sort: {partNumber: DESC}}) { + id + partNumber + description + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Employee) +CALL { + WITH this + MATCH (this)-[canAccess0:CAN_ACCESS]->(product0:Product) + WITH product0 { + id: product0.fg_item_id, + partNumber: product0.fg_item, + .description + } AS products ORDER BY products.partNumber DESC + RETURN collect(products) AS products +} +RETURN this { + products: products +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "employees": [ + { + "products": [ + { + "id": "p2", + "partNumber": "part2", + "description": "a p2" + }, + { + "id": "p1", + "partNumber": "part1", + "description": "a p1" + } + ] + } + ] +} +---- + +''' + +== Connection sort + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Employee { + products: [Product!]! @relationship(type: "CAN_ACCESS", direction: OUT) +} + +type Product { + id: String! @alias(property: "fg_item_id") + description: String! + partNumber: ID! @alias(property: "fg_item") +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (e:Employee {fg_item_id: "p1", description: "a p1", fg_item: "part1"}) + CREATE (p1:Product {fg_item_id: "p1", description: "a p1", fg_item: "part1"}) + CREATE (p2:Product {fg_item_id: "p2", description: "a p2", fg_item: "part2"}) + + CREATE (e)-[:CAN_ACCESS]->(p1) + CREATE (e)-[:CAN_ACCESS]->(p2) +---- + +=== should sort elements by aliased field in connection + +.GraphQL-Query +[source,graphql] +---- +query listProducts { + productsConnection(sort: {partNumber: DESC}) { + edges { + node { + id + partNumber + description + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Product) +WITH collect( { + node: this +}) AS edges +WITH edges, size(edges) AS totalCount +CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS this + WITH * ORDER BY this.fg_item DESC + RETURN collect( { + node: { + __typename: 'Product', + id: this.fg_item_id, + partNumber: this.fg_item, + description: this.description + } + }) AS edges0 +} +RETURN { + edges: edges0, + totalCount: totalCount +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "productsConnection": { + "edges": [ + { + "node": { + "id": "p2", + "partNumber": "part2", + "description": "a p2" + } + }, + { + "node": { + "id": "p1", + "partNumber": "part1", + "description": "a p1" + } + } + ] + } +} +---- + +''' + +=== should sort elements by aliased field in nested connection + +.GraphQL-Query +[source,graphql] +---- +query listProducts { + employees { + productsConnection(sort: {node: {partNumber: DESC}}) { + edges { + node { + id + partNumber + description + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Employee) +CALL { + WITH this + MATCH (this)-[canAccess0:CAN_ACCESS]->(product0:Product) + WITH collect( { + node: product0, + relationship: canAccess0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS product0, edge.relationship AS canAccess0 ORDER BY product0.fg_item DESC + RETURN collect( { + node: { + __typename: 'Product', + id: product0.fg_item_id, + partNumber: product0.fg_item, + description: product0.description + } + }) AS productsConnectionEdges + } + RETURN { + edges: productsConnectionEdges, + totalCount: totalCount + } AS productsConnection +} +RETURN this { + productsConnection: productsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "employees": [ + { + "productsConnection": { + "edges": [ + { + "node": { + "id": "p2", + "partNumber": "part2", + "description": "a p2" + } + }, + { + "node": { + "id": "p1", + "partNumber": "part1", + "description": "a p1" + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/360.adoc b/core/src/test/resources/integration-test-files/issues/360.adoc new file mode 100644 index 00000000..8d30f926 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/360.adoc @@ -0,0 +1,204 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/360 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Event { + id: ID! + name: String + start: DateTime + end: DateTime + activity: String +} +---- + +== should return all nodes when AND is used and members are optional + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Event {id: "A", name: "name1", start: datetime(), end: datetime()}) + CREATE (:Event {id: "B", name: "name2", start: datetime(), end: datetime()}) + CREATE (:Event {id: "C", name: "name3", start: datetime(), end: datetime()}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($rangeStart: DateTime, $rangeEnd: DateTime, $activity: String) { + events( + where: {AND: [{start_GTE: $rangeStart}, {start_LTE: $rangeEnd}, {activity: $activity}]} + ) { + id + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Event) +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "events": [ + { + "id": "A" + }, + { + "id": "B" + }, + { + "id": "C" + } + ] +} +---- + +''' + +== should return all nodes when OR is used and members are optional + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Event {id: "A", name: "name1", start: datetime(), end: datetime()}) + CREATE (:Event {id: "B", name: "name2", start: datetime(), end: datetime()}) + CREATE (:Event {id: "C", name: "name3", start: datetime(), end: datetime()}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($rangeStart: DateTime, $rangeEnd: DateTime, $activity: String) { + events( + where: {OR: [{start_GTE: $rangeStart}, {start_LTE: $rangeEnd}, {activity: $activity}]} + ) { + id + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Event) +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "events": [ + { + "id": "A" + }, + { + "id": "B" + }, + { + "id": "C" + } + ] +} +---- + +''' + +== should recreate given test in issue and return correct results + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Event {id: "A", name: "name1", start: datetime("2024-12-01T15:47:19.274Z"), end: datetime("2024-12-01T15:47:19.274Z")}) + CREATE (:Event {id: "B", name: "name2", start: datetime("2024-12-01T15:47:19.274Z"), end: datetime("2024-12-01T15:47:19.274Z")}) + CREATE (:Event {id: "C", name: "name3", start: datetime(), end: datetime()}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($rangeStart: DateTime, $rangeEnd: DateTime, $activity: String) { + events( + where: {OR: [{start_GTE: $rangeStart}, {start_LTE: $rangeEnd}, {activity: $activity}]} + ) { + id + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "rangeStart": "2024-12-01T15:47:19.274Z", + "rangeEnd": "2024-12-01T15:47:19.274Z" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "2024-12-01T15:47:19.274Z", + "param1" : "2024-12-01T15:47:19.274Z" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Event) +WHERE (this.start >= $param0 + OR this.start <= $param1) +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "events": [ + { + "id": "A" + }, + { + "id": "B" + }, + { + "id": "C" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/4007.adoc b/core/src/test/resources/integration-test-files/issues/4007.adoc new file mode 100644 index 00000000..71353d13 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/4007.adoc @@ -0,0 +1,120 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/4007 + +== should return name from aliased selection + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "A"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "B"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "C"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + m: movies(where: {title: "RandomString1"}) { + t: actorsConnection { + e: edges { + no: node { + ne: name + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + no: { + __typename: 'Actor', + ne: actor0.name + } + }) AS tEdges + } + RETURN { + edges: tEdges, + totalCount: totalCount + } AS t +} +RETURN this { + t: t +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "m": [ + { + "t": { + "e": [ + { + "no": { + "ne": "A" + } + }, + { + "no": { + "ne": "B" + } + }, + { + "no": { + "ne": "C" + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/4015.adoc b/core/src/test/resources/integration-test-files/issues/4015.adoc new file mode 100644 index 00000000..a13f6385 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/4015.adoc @@ -0,0 +1,134 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/4007 + +== should return all the selected node fields + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! + surname: String + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "name1", surname: "surname1"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "name2", surname: "surname2"}) + CREATE (m)<-[:ACTED_IN]-(:Actor {name: "name3", surname: "surname3"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies { + actorsConnection { + edges { + node { + surname + } + no: node { + name + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __typename: 'Actor', + surname: actor0.surname + }, + no: { + __typename: 'Actor', + name: actor0.name + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "movies": [ + { + "actorsConnection": { + "edges": [ + { + "node": { + "surname": "surname1" + }, + "no": { + "name": "name1" + } + }, + { + "node": { + "surname": "surname3" + }, + "no": { + "name": "name3" + } + }, + { + "node": { + "surname": "surname2" + }, + "no": { + "name": "name2" + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/402.adoc b/core/src/test/resources/integration-test-files/issues/402.adoc new file mode 100644 index 00000000..56b8fc2f --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/402.adoc @@ -0,0 +1,83 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/402 + +== should recreate test and return correct data + +.Schema +[source,graphql,schema=true] +---- +type Event { + id: ID! + area: Area! @relationship(type: "HAPPENS_IN", direction: OUT) +} + +type Area { + id: ID! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Event {id: "RandomString1"})-[:HAPPENS_IN]->(:Area {id: "RandomString2"}) +---- + +.GraphQL-Query +[source,graphql] +---- +query ($area: [ID!]) { + events(where: {id: "RandomString1", area: {id_IN: $area}}) { + id + area { + id + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Event) +WHERE this.id = $param0 +CALL { + WITH this + MATCH (this)-[happensIn0:HAPPENS_IN]->(area0:Area) + WITH area0 { + .id + } AS area + RETURN head(collect(area)) AS area +} +RETURN this { + .id, + area: area +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "events": [ + { + "id": "RandomString1", + "area": { + "id": "RandomString2" + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/4196.adoc b/core/src/test/resources/integration-test-files/issues/4196.adoc new file mode 100644 index 00000000..174abbe7 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/4196.adoc @@ -0,0 +1,125 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/4196 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Foo { + name: String + bars: [Bar!]! @relationship(type: "relatesTo", direction: OUT) +} + +type Bar { + name: String + foobars: [FooBar!]! @relationship(type: "relatesTo", direction: OUT) +} + +type FooBar { + name: String + bars: [FooBar!]! @relationship(type: "relatesTo", direction: IN) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +MERGE (:Foo {name: "A"})-[:relatesTo]->(b1:Bar {name: "bar1"}) + MERGE (:Foo {name: "B"}) + MERGE (:Foo {name: "C"})-[:relatesTo]->(b3:Bar {name: "bar3"}) + MERGE (b1)-[:relatesTo]->(:FooBar {name: "a"}) + MERGE (b3)-[:relatesTo]->(:FooBar {name: "b"}) +---- + +== querying multiple nested nodes should be sorted correctly + +.GraphQL-Query +[source,graphql] +---- +{ + foos(options: {sort: {name: ASC}}) { + name + bars { + foobars { + name + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Foo) +WITH * ORDER BY this.name ASC +CALL { + WITH this + MATCH (this)-[relatesto0:relatesTo]->(bar0:Bar) + CALL { + WITH bar0 + MATCH (bar0)-[relatesto1:relatesTo]->(fooBar0:FooBar) + WITH fooBar0 { + .name + } AS foobars + RETURN collect(foobars) AS foobars + } + WITH bar0 { + foobars: foobars + } AS bars + RETURN collect(bars) AS bars +} +RETURN this { + .name, + bars: bars +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "foos": [ + { + "name": "A", + "bars": [ + { + "foobars": [ + { + "name": "a" + } + ] + } + ] + }, + { + "name": "B", + "bars": [] + }, + { + "name": "C", + "bars": [ + { + "foobars": [ + { + "name": "b" + } + ] + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/4287.adoc b/core/src/test/resources/integration-test-files/issues/4287.adoc new file mode 100644 index 00000000..1a8bdc56 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/4287.adoc @@ -0,0 +1,149 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/4287 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + actedIn: [Production!]! @relationship(type: "ACTED_IN", properties: "actedIn", direction: OUT) +} + +type actedIn @relationshipProperties { + role: String +} + +interface Production { + title: String +} + +type Movie implements Production { + title: String + runtime: Int +} + +type Series implements Production { + title: String + episodes: Int +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (a:Actor { name: "Someone" }) + CREATE (a)-[:ACTED_IN]->(:Movie {title: "something"}) + CREATE (a)-[:ACTED_IN]->(:Series {title: "whatever"}) + CREATE (a)-[:ACTED_IN]->(:Movie {title: "whatever 2"}) + CREATE (a)-[:ACTED_IN]->(:Series {title: "something 2"}) +---- + +== filter by logical operator on interface connection + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedInConnection( + where: {OR: [{node: {title: "something"}}, {node: {title: "whatever"}}]} + ) { + edges { + node { + __typename + title + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "something", + "param1": "whatever", + "param2": "something", + "param3": "whatever" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WHERE (movie0.title = $param0 + OR movie0.title = $param1) + WITH { + node: { + __typename: 'Movie', + title: movie0.title, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WHERE (series0.title = $param2 + OR series0.title = $param3) + WITH { + node: { + __typename: 'Series', + title: series0.title, + __id: elementId(series0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection +} +RETURN this { + actedInConnection: actedInConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "actedInConnection": { + "edges": [ + { + "node": { + "__typename": "Movie", + "title": "something" + } + }, + { + "node": { + "__typename": "Series", + "title": "whatever" + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/433.adoc b/core/src/test/resources/integration-test-files/issues/433.adoc new file mode 100644 index 00000000..e494fa0c --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/433.adoc @@ -0,0 +1,109 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/433 + +== should recreate issue and return correct data + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Person { + name: String +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Movie {title: "RandomString1"})<-[:ACTED_IN]-(:Person {name: "RandomString2"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + title + actorsConnection(where: {}) { + edges { + node { + name + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (person0:Person)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: person0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS person0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __typename: 'Person', + name: person0.name + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + .title, + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "title": "RandomString1", + "actorsConnection": { + "edges": [ + { + "node": { + "name": "RandomString2" + } + } + ] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/4450.adoc b/core/src/test/resources/integration-test-files/issues/4450.adoc new file mode 100644 index 00000000..8021b321 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/4450.adoc @@ -0,0 +1,91 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/4450 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + scene: [Scene!]! @relationship(type: "IN_SCENE", properties: "ActorScene", direction: OUT) +} + +type Scene { + number: Int + actors: [Actor!]! @relationship(type: "IN_SCENE", properties: "ActorScene", direction: IN) + location: Location! @relationship(type: "AT_LOCATION", direction: OUT) +} + +type Location { + city: String + scenes: [Scene!]! @relationship(type: "AT_LOCATION", direction: IN) +} + +type ActorScene @relationshipProperties { + cut: Boolean +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Actor {name: "actor-1"})-[:IN_SCENE {cut: true}]->(:Scene {number: 1})-[:AT_LOCATION]->(:Location {city: "test"}) +---- + +== filtering through a connection to a many-to-1 relationship should work + +.GraphQL-Query +[source,graphql] +---- +{ + actors( + where: {sceneConnection_SOME: {edge: {cut: true}, node: {location: {city: "test"}}}} + ) { + name + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "test", + "param1": true +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE EXISTS { + MATCH (this)-[edge:IN_SCENE]->(this0:Scene) + WHERE (EXISTS { + MATCH (this0)-[:AT_LOCATION]->(this00:Location) + WHERE this00.city = $param0 + } + AND edge.cut = $param1) +} +RETURN this { + .name +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "name": "actor-1" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/4532.adoc b/core/src/test/resources/integration-test-files/issues/4532.adoc new file mode 100644 index 00000000..674e608a --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/4532.adoc @@ -0,0 +1,322 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/4532 + +== order-by relationship property + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Inventory { + id: ID + children: [Scenario!]! @relationship(type: "HasChildren", properties: "InventoryChildRelation", direction: OUT) +} + +type Scenario { + id: ID +} + +type InventoryChildRelation @relationshipProperties { + order: Int +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE(i:Inventory {id: "i1"}) + CREATE(i)-[:HasChildren { order: 3 }]->(c1:Scenario { id: "c3"}) + CREATE(i)-[:HasChildren { order: 1 }]->(c2:Scenario { id: "c1"}) + CREATE(i)-[:HasChildren { order: 2 }]->(c3:Scenario { id: "c2"}) + + CREATE(:Inventory {id: "i2"}) +---- + +=== should return all elements when ordering by nested connection + +.GraphQL-Query +[source,graphql] +---- +{ + inventories { + id + childrenConnection(sort: {edge: {order: ASC}}) { + edges { + properties { + order + } + node { + id + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Inventory) +CALL { + WITH this + MATCH (this)-[haschildren0:HasChildren]->(scenario0:Scenario) + WITH collect( { + node: scenario0, + relationship: haschildren0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS scenario0, edge.relationship AS haschildren0 ORDER BY haschildren0.order ASC + RETURN collect( { + properties: { + __typename: 'InventoryChildRelation', + order: haschildren0.order + }, + node: { + __typename: 'Scenario', + id: scenario0.id + } + }) AS childrenConnectionEdges + } + RETURN { + edges: childrenConnectionEdges, + totalCount: totalCount + } AS childrenConnection +} +RETURN this { + .id, + childrenConnection: childrenConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "inventories": [ + { + "id": "i2", + "childrenConnection": { + "edges": [] + } + }, + { + "id": "i1", + "childrenConnection": { + "edges": [ + { + "properties": { + "order": 1 + }, + "node": { + "id": "c1" + } + }, + { + "properties": { + "order": 2 + }, + "node": { + "id": "c2" + } + }, + { + "properties": { + "order": 3 + }, + "node": { + "id": "c3" + } + } + ] + } + } + ] +} +---- + +''' + +== order-by relationship property on interface node target + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Inventory { + id: ID + children: [Scenario!]! @relationship(type: "HasChildren", properties: "InventoryChildRelation", direction: OUT) +} + +interface Scenario { + id: ID +} + +type Image implements Scenario { + id: ID +} + +type Video implements Scenario { + id: ID +} + +type InventoryChildRelation @relationshipProperties { + order: Int +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE(i:Inventory {id: "i1"}) + CREATE(i)-[:HasChildren { order: 3 }]->(c1:Image { id: "c3"}) + CREATE(i)-[:HasChildren { order: 1 }]->(c2:Video { id: "c1"}) + CREATE(i)-[:HasChildren { order: 2 }]->(c3:Video { id: "c2"}) + + CREATE(:Inventory {id: "i2"}) +---- + +=== should return all elements when ordering by nested connection on an interface target + +.GraphQL-Query +[source,graphql] +---- +{ + inventories { + id + childrenConnection(sort: {edge: {order: ASC}}) { + edges { + properties { + order + } + node { + id + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Inventory) +CALL { + WITH this + CALL { + WITH this + MATCH (this)-[haschildren0:HasChildren]->(image0:Image) + WITH { + properties: { + __typename: 'InventoryChildRelation', + order: haschildren0.order + }, + node: { + __typename: 'Image', + id: image0.id, + __id: elementId(image0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[haschildren1:HasChildren]->(video0:Video) + WITH { + properties: { + __typename: 'InventoryChildRelation', + order: haschildren1.order + }, + node: { + __typename: 'Video', + id: video0.id, + __id: elementId(video0) + } + } AS edge + RETURN edge + } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge ORDER BY edge.properties.order ASC + RETURN collect(edge) AS sortedEdges0 + } + RETURN { + edges: sortedEdges0, + totalCount: totalCount + } AS childrenConnection +} +RETURN this { + .id, + childrenConnection: childrenConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "inventories": [ + { + "id": "i1", + "childrenConnection": { + "edges": [ + { + "properties": { + "order": 1 + }, + "node": { + "id": "c1" + } + }, + { + "properties": { + "order": 2 + }, + "node": { + "id": "c2" + } + }, + { + "properties": { + "order": 3 + }, + "node": { + "id": "c3" + } + } + ] + } + }, + { + "id": "i2", + "childrenConnection": { + "edges": [] + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/4667.adoc b/core/src/test/resources/integration-test-files/issues/4667.adoc new file mode 100644 index 00000000..1af646f0 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/4667.adoc @@ -0,0 +1,85 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/4667 + +== Setup + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:MyThing {id: "A"})-[:THE_STUFF]->(b1:MyStuff {id: "C"}) + CREATE (:MyThing {id: "B"}) +---- + +== when passed null as an argument of a relationship filter should check that a relationship does not exist + +.Schema +[source,graphql,schema=true] +---- +type MyThing { + id: ID! @id + stuff: MyStuff @relationship(type: "THE_STUFF", direction: OUT) +} + +type MyStuff { + id: ID! @id + thing: MyThing @relationship(type: "THE_STUFF", direction: IN) +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + myThings(where: {stuff: null}) { + id + stuff { + id + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:MyThing) +WHERE NOT (EXISTS { + MATCH (this)-[:THE_STUFF]->(this0:MyStuff) +}) +CALL { + WITH this + MATCH (this)-[theStuff0:THE_STUFF]->(myStuff0:MyStuff) + WITH myStuff0 { + .id + } AS stuff + RETURN head(collect(stuff)) AS stuff +} +RETURN this { + .id, + stuff: stuff +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "myThings": [ + { + "id": "B", + "stuff": null + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/5142.adoc b/core/src/test/resources/integration-test-files/issues/5142.adoc new file mode 100644 index 00000000..f4de7c90 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/5142.adoc @@ -0,0 +1,35 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/5142 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Query { + test(fields: [[String!]]!): String! +} +---- + +== should allow for a matrix input + +.GraphQL-Query +[source,graphql] +---- +{ + test(fields: [["first"], ["second"]]) +} +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "test": "Hello World first,second" +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc b/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc new file mode 100644 index 00000000..261adcdb --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc @@ -0,0 +1,398 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/5223, Cartesian + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Location @node { + id: ID! + pointCoordinates: CartesianPoint! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Location { id: "1", pointCoordinates: point({x: -14221.955504767046, y: 6711533.711877272})}) + CREATE (:Location { id: "2", pointCoordinates: point({x: 1391088.9885668862, y: 5146427.7652232265})}) + CREATE (:Location { id: "3", pointCoordinates: point({x: 261848.15527273554, y: 6250566.54904563, z: 21})}) +---- + +== should not fail when srid is queried + +.GraphQL-Query +[source,graphql] +---- +{ + locations { + id + pointCoordinates { + x + y + z + crs + srid + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Location) +RETURN this { + .id, + pointCoordinates: CASE WHEN this.pointCoordinates IS NOT NULL THEN { + x: this.pointCoordinates.x, + y: this.pointCoordinates.y, + z: CASE WHEN this.pointCoordinates.srid = 9157 THEN this.pointCoordinates.z ELSE NULL END, + crs: this.pointCoordinates.crs, + srid: this.pointCoordinates.srid + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "locations": [ + { + "id": "1", + "pointCoordinates": { + "x": -14221.955504767046, + "y": 6711533.711877272, + "z": null, + "crs": "cartesian", + "srid": 7203 + } + }, + { + "id": "2", + "pointCoordinates": { + "x": 1391088.9885668862, + "y": 5146427.7652232265, + "z": null, + "crs": "cartesian", + "srid": 7203 + } + }, + { + "id": "3", + "pointCoordinates": { + "x": 261848.15527273554, + "y": 6250566.54904563, + "z": 21, + "crs": "cartesian-3d", + "srid": 9157 + } + } + ] +} +---- + +''' + +== should not fail when srid is queried, Connection + +.GraphQL-Query +[source,graphql] +---- +{ + locationsConnection { + edges { + node { + id + pointCoordinates { + x + y + z + crs + srid + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Location) +WITH collect( { + node: this +}) AS edges +WITH edges, size(edges) AS totalCount +CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS this + RETURN collect( { + node: { + __typename: 'Location', + id: this.id, + pointCoordinates: CASE WHEN this.pointCoordinates IS NOT NULL THEN { + x: this.pointCoordinates.x, + y: this.pointCoordinates.y, + z: CASE WHEN this.pointCoordinates.srid = 9157 THEN this.pointCoordinates.z ELSE NULL END, + crs: this.pointCoordinates.crs, + srid: this.pointCoordinates.srid + } ELSE NULL END + } + }) AS edges0 +} +RETURN { + edges: edges0, + totalCount: totalCount +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "locationsConnection": { + "edges": [ + { + "node": { + "id": "1", + "pointCoordinates": { + "x": -14221.955504767046, + "y": 6711533.711877272, + "z": null, + "crs": "cartesian", + "srid": 7203 + } + } + }, + { + "node": { + "id": "2", + "pointCoordinates": { + "x": 1391088.9885668862, + "y": 5146427.7652232265, + "z": null, + "crs": "cartesian", + "srid": 7203 + } + } + }, + { + "node": { + "id": "3", + "pointCoordinates": { + "x": 261848.15527273554, + "y": 6250566.54904563, + "z": 21, + "crs": "cartesian-3d", + "srid": 9157 + } + } + } + ] + } +} +---- + +''' + +== should not fail when srid is not queried + +.GraphQL-Query +[source,graphql] +---- +{ + locations { + id + pointCoordinates { + x + y + z + crs + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Location) +RETURN this { + .id, + pointCoordinates: CASE WHEN this.pointCoordinates IS NOT NULL THEN { + x: this.pointCoordinates.x, + y: this.pointCoordinates.y, + z: CASE WHEN this.pointCoordinates.srid = 9157 THEN this.pointCoordinates.z ELSE NULL END, + crs: this.pointCoordinates.crs + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "locations": [ + { + "id": "1", + "pointCoordinates": { + "x": -14221.955504767046, + "y": 6711533.711877272, + "z": null, + "crs": "cartesian" + } + }, + { + "id": "2", + "pointCoordinates": { + "x": 1391088.9885668862, + "y": 5146427.7652232265, + "z": null, + "crs": "cartesian" + } + }, + { + "id": "3", + "pointCoordinates": { + "x": 261848.15527273554, + "y": 6250566.54904563, + "z": 21, + "crs": "cartesian-3d" + } + } + ] +} +---- + +''' + +== should not fail when srid is not queried, Connection + +.GraphQL-Query +[source,graphql] +---- +{ + locationsConnection { + edges { + node { + id + pointCoordinates { + x + y + z + crs + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Location) +WITH collect( { + node: this +}) AS edges +WITH edges, size(edges) AS totalCount +CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS this + RETURN collect( { + node: { + __typename: 'Location', + id: this.id, + pointCoordinates: CASE WHEN this.pointCoordinates IS NOT NULL THEN { + x: this.pointCoordinates.x, + y: this.pointCoordinates.y, + z: CASE WHEN this.pointCoordinates.srid = 9157 THEN this.pointCoordinates.z ELSE NULL END, + crs: this.pointCoordinates.crs + } ELSE NULL END + } + }) AS edges0 +} +RETURN { + edges: edges0, + totalCount: totalCount +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "locationsConnection": { + "edges": [ + { + "node": { + "id": "1", + "pointCoordinates": { + "x": -14221.955504767046, + "y": 6711533.711877272, + "z": null, + "crs": "cartesian" + } + } + }, + { + "node": { + "id": "2", + "pointCoordinates": { + "x": 1391088.9885668862, + "y": 5146427.7652232265, + "z": null, + "crs": "cartesian" + } + } + }, + { + "node": { + "id": "3", + "pointCoordinates": { + "x": 261848.15527273554, + "y": 6250566.54904563, + "z": 21, + "crs": "cartesian-3d" + } + } + } + ] + } +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/5223-point.adoc b/core/src/test/resources/integration-test-files/issues/5223-point.adoc new file mode 100644 index 00000000..0a27d4e9 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/5223-point.adoc @@ -0,0 +1,394 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/5223, Point + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Location @node { + id: ID! + pointCoordinates: Point! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Location { id: "1", pointCoordinates: point({longitude: -0.127758, latitude: 51.507351})}) + CREATE (:Location { id: "2", pointCoordinates: point({longitude: 12.496365, latitude: 41.902782})}) + CREATE (:Location { id: "3", pointCoordinates: point({longitude: 2.352222, latitude: 48.856613, height: 21})}) +---- + +== should not fail when srid is queried + +.GraphQL-Query +[source,graphql] +---- +{ + locations { + id + pointCoordinates { + latitude + longitude + height + crs + srid + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Location) +RETURN this { + .id, + pointCoordinates: CASE WHEN this.pointCoordinates IS NOT NULL THEN { + latitude: this.pointCoordinates.latitude, + longitude: this.pointCoordinates.longitude, + height: CASE WHEN this.pointCoordinates.srid = 4979 THEN this.pointCoordinates.height ELSE NULL END, + crs: this.pointCoordinates.crs, + srid: this.pointCoordinates.srid + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "locations": [ + { + "id": "1", + "pointCoordinates": { + "latitude": 51.507351, + "longitude": -0.127758, + "height": null, + "crs": "wgs-84", + "srid": 4326 + } + }, + { + "id": "2", + "pointCoordinates": { + "latitude": 41.902782, + "longitude": 12.496365, + "height": null, + "crs": "wgs-84", + "srid": 4326 + } + }, + { + "id": "3", + "pointCoordinates": { + "latitude": 48.856613, + "longitude": 2.352222, + "height": 21, + "crs": "wgs-84-3d", + "srid": 4979 + } + } + ] +} +---- + +''' + +== should not fail when srid is queried, Connection + +.GraphQL-Query +[source,graphql] +---- +{ + locationsConnection { + edges { + node { + id + pointCoordinates { + latitude + longitude + height + crs + srid + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Location) +WITH collect( { + node: this +}) AS edges +WITH edges, size(edges) AS totalCount +CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS this + RETURN collect( { + node: { + __typename: 'Location', + id: this.id, + pointCoordinates: CASE WHEN this.pointCoordinates IS NOT NULL THEN { + latitude: this.pointCoordinates.latitude, + longitude: this.pointCoordinates.longitude, + height: CASE WHEN this.pointCoordinates.srid = 4979 THEN this.pointCoordinates.height ELSE NULL END, + crs: this.pointCoordinates.crs, + srid: this.pointCoordinates.srid + } ELSE NULL END + } + }) AS edges0 +} +RETURN { + edges: edges0, + totalCount: totalCount +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "locationsConnection": { + "edges": [ + { + "node": { + "id": "1", + "pointCoordinates": { + "latitude": 51.507351, + "longitude": -0.127758, + "height": null, + "crs": "wgs-84", + "srid": 4326 + } + } + }, + { + "node": { + "id": "2", + "pointCoordinates": { + "latitude": 41.902782, + "longitude": 12.496365, + "height": null, + "crs": "wgs-84", + "srid": 4326 + } + } + }, + { + "node": { + "id": "3", + "pointCoordinates": { + "latitude": 48.856613, + "longitude": 2.352222, + "height": 21, + "crs": "wgs-84-3d", + "srid": 4979 + } + } + } + ] + } +} +---- + +''' + +== should not fail when srid is not queried + +.GraphQL-Query +[source,graphql] +---- +{ + locations { + id + pointCoordinates { + latitude + longitude + height + crs + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Location) +RETURN this { + .id, + pointCoordinates: CASE WHEN this.pointCoordinates IS NOT NULL THEN { + latitude: this.pointCoordinates.latitude, + longitude: this.pointCoordinates.longitude, + height: CASE WHEN this.pointCoordinates.srid = 4979 THEN this.pointCoordinates.height ELSE NULL END, + crs: this.pointCoordinates.crs + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "locations": [ + { + "id": "1", + "pointCoordinates": { + "latitude": 51.507351, + "longitude": -0.127758, + "height": null, + "crs": "wgs-84" + } + }, + { + "id": "2", + "pointCoordinates": { + "latitude": 41.902782, + "longitude": 12.496365, + "height": null, + "crs": "wgs-84" + } + }, + { + "id": "3", + "pointCoordinates": { + "latitude": 48.856613, + "longitude": 2.352222, + "height": 21, + "crs": "wgs-84-3d" + } + } + ] +} +---- + +''' + +== should not fail when srid is not queried, Connection + +.GraphQL-Query +[source,graphql] +---- +{ + locationsConnection { + edges { + node { + id + pointCoordinates { + latitude + longitude + height + crs + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Location) +WITH collect( { + node: this +}) AS edges +WITH edges, size(edges) AS totalCount +CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS this + RETURN collect( { + node: { + __typename: 'Location', + id: this.id, + pointCoordinates: CASE WHEN this.pointCoordinates IS NOT NULL THEN { + latitude: this.pointCoordinates.latitude, + longitude: this.pointCoordinates.longitude, + height: CASE WHEN this.pointCoordinates.srid = 4979 THEN this.pointCoordinates.height ELSE NULL END, + crs: this.pointCoordinates.crs + } ELSE NULL END + } + }) AS edges0 +} +RETURN { + edges: edges0, + totalCount: totalCount +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "locationsConnection" : { + "edges" : [ { + "node" : { + "id" : "1", + "pointCoordinates" : { + "latitude" : 51.507351, + "longitude" : -0.127758, + "height" : null, + "crs" : "wgs-84" + } + } + }, { + "node" : { + "id" : "2", + "pointCoordinates" : { + "latitude" : 41.902782, + "longitude" : 12.496365, + "height" : null, + "crs" : "wgs-84" + } + } + }, { + "node" : { + "id" : "3", + "pointCoordinates" : { + "latitude" : 48.856613, + "longitude" : 2.352222, + "height" : 21.0, + "crs" : "wgs-84-3d" + } + } + } ] + } +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/560.adoc b/core/src/test/resources/integration-test-files/issues/560.adoc new file mode 100644 index 00000000..90c7ce8a --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/560.adoc @@ -0,0 +1,147 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/560 + +== should not throw when Point is null + +.Schema +[source,graphql,schema=true] +---- +type Log { + id: ID! + location: Point +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (j:Log { id: "RandomString1" }) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + logs { + id + location { + longitude + latitude + height + crs + srid + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Log) +RETURN this { + .id, + location: CASE WHEN this.location IS NOT NULL THEN { + longitude: this.location.longitude, + latitude: this.location.latitude, + height: CASE WHEN this.location.srid = 4979 THEN this.location.height ELSE NULL END, + crs: this.location.crs, + srid: this.location.srid + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "logs": [ + { + "id": "RandomString1", + "location": null + } + ] +} +---- + +''' + +== should not throw when CartesianPoint is null + +.Schema +[source,graphql,schema=true] +---- +type Log { + id: ID! + location: CartesianPoint +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (j:Log { id: "RandomString1" }) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + logs { + id + location { + x + y + z + crs + srid + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Log) +RETURN this { + .id, + location: CASE WHEN this.location IS NOT NULL THEN { + x: this.location.x, + y: this.location.y, + z: CASE WHEN this.location.srid = 9157 THEN this.location.z ELSE NULL END, + crs: this.location.crs, + srid: this.location.srid + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "logs": [ + { + "id": "RandomString1", + "location": null + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/583.adoc b/core/src/test/resources/integration-test-files/issues/583.adoc new file mode 100644 index 00000000..0d5e009c --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/583.adoc @@ -0,0 +1,161 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/583 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Show { + title: String +} + +interface Awardable { + awardsGiven: Int! +} + +type Actor implements Awardable { + id: ID! + name: String + awardsGiven: Int! + actedIn: [Show!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Movie implements Show & Awardable { + title: String + awardsGiven: Int! +} + +type Series implements Show & Awardable { + title: String + awardsGiven: Int! +} + +type ShortFilm implements Show { + title: String +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (actor:Actor:Test) + SET actor = {id: "RandomString1", name: "aaa", awardsGiven: 0} + CREATE (actor)-[:ACTED_IN]->(series:Series:Test) + SET series = {title: "stranger who", awardsGiven: 2} + CREATE (actor)-[:ACTED_IN]->(movie:Movie:Test) + SET movie = {title: "doctor things", awardsGiven: 42} + CREATE (actor)-[:ACTED_IN]->(shortFilm:ShortFilm:Test) + SET shortFilm = {title: "all too well"} +---- + +== should project all interfaces of node + +.GraphQL-Query +[source,graphql] +---- +query ($actorId: ID!) { + actors(where: {id: $actorId}) { + id + name + actedIn { + title + ... on Awardable { + awardsGiven + } + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "actorId": "RandomString1" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE this.id = $param0 +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .awardsGiven + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .awardsGiven + } AS series0 + RETURN series0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(shortFilm0:ShortFilm) + WITH shortFilm0 { + __typename: 'ShortFilm', + __id: elementId(shortFilm0), + .title + } AS shortFilm0 + RETURN shortFilm0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + .id, + .name, + actedIn: actedIn +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "actors": [ + { + "id": "RandomString1", + "name": "aaa", + "actedIn": [ + { + "title": "doctor things", + "awardsGiven": 42 + }, + { + "title": "stranger who", + "awardsGiven": 2 + }, + { + "title": "all too well" + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/620.adoc b/core/src/test/resources/integration-test-files/issues/620.adoc new file mode 100644 index 00000000..4f5682c0 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/620.adoc @@ -0,0 +1,85 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/620 + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type User { + id: String + name: String +} + +type Business { + id: String + name: String +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (u:User {id: "1234", name: "arthur"}) + CREATE (b:Business {id: "1234", name: "ford"}) +---- + +== should return topic count + +.GraphQL-Query +[source,graphql] +---- +{ + users(where: {id: "1234"}) { + id + name + } + businesses(where: {id: "1234"}) { + id + name + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "1234" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +WHERE this.id = $param0 +RETURN this { + .id, + .name +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "users": [ + { + "id": "1234", + "name": "arthur" + } + ], + "businesses": [ + { + "id": "1234", + "name": "ford" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/issues/date-in-edge.adoc b/core/src/test/resources/integration-test-files/issues/date-in-edge.adoc new file mode 100644 index 00000000..edbb1812 --- /dev/null +++ b/core/src/test/resources/integration-test-files/issues/date-in-edge.adoc @@ -0,0 +1,119 @@ +:toc: +:toclevels: 42 + += 587: Dates in edges can cause wrongly generated cypher + +== should not throw when returning a date in an edge + +.Schema +[source,graphql,schema=true] +---- +type Genre { + id: ID! + movies: [Movie!]! @relationship(type: "MOVIE", direction: OUT) +} + +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTOR", direction: OUT) +} + +type Actor { + name: String! + birthday: DateTime! + movie: Movie! @relationship(type: "ACTOR", direction: IN) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (genre:Genre { id: "RandomString1" }) + CREATE (movie:Movie { title: "RandomString2" }) + CREATE (actor:Actor { name: "RandomString3", birthday: datetime("2021-11-16T10:53:20.200000000Z")}) + CREATE (genre)-[:Movie]->(movie)-[:Actor { role: "Name" }]->(actor) + RETURN actor +---- + +.GraphQL-Query +[source,graphql] +---- +{ + genres(where: {id: "RandomString1"}) { + movies { + actorsConnection { + edges { + node { + birthday + } + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Genre) +WHERE this.id = $param0 +CALL { + WITH this + MATCH (this)-[movie1:MOVIE]->(movie0:Movie) + CALL { + WITH movie0 + MATCH (movie0)-[actor1:ACTOR]->(actor0:Actor) + WITH collect( { + node: actor0, + relationship: actor1 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actor1 + RETURN collect( { + node: { + __typename: 'Actor', + birthday: apoc.date.convertFormat(toString(actor0.birthday), 'iso_zoned_date_time', 'iso_offset_date_time') + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection + } + WITH movie0 { + actorsConnection: actorsConnection + } AS movies + RETURN collect(movies) AS movies +} +RETURN this { + movies: movies +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "genres": [ + { + "movies": [] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type-but-relationshipproperty-exists.adoc b/core/src/test/resources/integration-test-files/relationship-properties/error-if-missing-relationship-properties.adoc similarity index 55% rename from core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type-but-relationshipproperty-exists.adoc rename to core/src/test/resources/integration-test-files/relationship-properties/error-if-missing-relationship-properties.adoc index 93edf300..8a5a8690 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type-but-relationshipproperty-exists.adoc +++ b/core/src/test/resources/integration-test-files/relationship-properties/error-if-missing-relationship-properties.adoc @@ -1,30 +1,28 @@ :toc: +:toclevels: 42 -= Subscriptions -> Empty EventPayload type, but @relationshipProperty exists += Throw error if missing @relationshipProperties -== Source schema +== should not throw error if the @relationshipProperties directive is used +.Schema [source,graphql,schema=true] ---- type Movie { - id: ID - actorCount: Int - averageRating: Float - isActive: Boolean + title: String! actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) } -type ActedIn @relationshipProperties { - screenTime: Int! +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } -type Actor { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +type ActedIn @relationshipProperties { + screenTime: Int! } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -35,93 +33,12 @@ schema { """ The edge properties for the following fields: * Movie.actors +* Actor.movies """ type ActedIn { screenTime: Int! } -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actorCount: Int - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - averageRating: Float - id: ID - isActive: Boolean -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - input ActedInSort { screenTime: SortDirection } @@ -138,7 +55,25 @@ input ActedInWhere { screenTime_LTE: Int } +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + name: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + input ActorMoviesConnectionSort { + edge: ActedInSort node: MovieSort } @@ -146,38 +81,88 @@ input ActorMoviesConnectionWhere { AND: [ActorMoviesConnectionWhere!] NOT: ActorMoviesConnectionWhere OR: [ActorMoviesConnectionWhere!] + edge: ActedInWhere node: MovieWhere } +type ActorMoviesRelationship { + cursor: String! + node: Movie! + properties: ActedIn! +} + input ActorOptions { limit: Int offset: Int + """ + Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array. + """ + sort: [ActorSort!] +} + +""" +Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object. +""" +input ActorSort { + name: SortDirection } input ActorWhere { AND: [ActorWhere!] NOT: ActorWhere OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" + """ + Return Actors where all of the related ActorMoviesConnections match this filter + """ moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" + """ + Return Actors where none of the related ActorMoviesConnections match this filter + """ moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" + """ + Return Actors where one of the related ActorMoviesConnections match this filter + """ moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" + """ + Return Actors where some of the related ActorMoviesConnections match this filter + """ moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" + """Return Actors where all of the related Movies match this filter""" movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" + """Return Actors where none of the related Movies match this filter""" movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" + """Return Actors where one of the related Movies match this filter""" movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" + """Return Actors where some of the related Movies match this filter""" movies_SOME: MovieWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! } input MovieActorsConnectionSort { edge: ActedInSort + node: ActorSort } input MovieActorsConnectionWhere { @@ -188,61 +173,97 @@ input MovieActorsConnectionWhere { node: ActorWhere } +type MovieActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + input MovieOptions { limit: Int offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + """ + Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array. + """ sort: [MovieSort!] } -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +""" +Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object. +""" input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - id: SortDirection - isActive: SortDirection + title: SortDirection } input MovieWhere { AND: [MovieWhere!] NOT: MovieWhere OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - "Return Movies where all of the related MovieActorsConnections match this filter" + """ + Return Movies where all of the related MovieActorsConnections match this filter + """ actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" + """ + Return Movies where none of the related MovieActorsConnections match this filter + """ actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" + """ + Return Movies where one of the related MovieActorsConnections match this filter + """ actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" + """ + Return Movies where some of the related MovieActorsConnections match this filter + """ actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" + """Return Movies where all of the related Actors match this filter""" actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" + """Return Movies where none of the related Actors match this filter""" actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" + """Return Movies where one of the related Actors match this filter""" actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" + """Return Movies where some of the related Actors match this filter""" actors_SOME: ActorWhere - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"""Pagination information (Relay)""" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! } +"""An enum for sorting in either ascending or descending order.""" +enum SortDirection { + """Sort by field values in ascending order.""" + ASC + """Sort by field values in descending order.""" + DESC +} ---- ''' + diff --git a/core/src/test/resources/integration-test-files/relationship-properties/read.adoc b/core/src/test/resources/integration-test-files/relationship-properties/read.adoc new file mode 100644 index 00000000..6b9034c0 --- /dev/null +++ b/core/src/test/resources/integration-test-files/relationship-properties/read.adoc @@ -0,0 +1,152 @@ +:toc: +:toclevels: 42 + += Relationship properties - read + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) +} + +type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (:Actor { name: 'aRandomString2' })-[:ACTED_IN { screenTime: 105 }]->(m:Movie { title: 'RandomString1'}) + CREATE (m)<-[:ACTED_IN { screenTime: 105 }]-(:Actor { name: 'bRandomString3' }) + CREATE (m)<-[:ACTED_IN { screenTime: 5 }]-(:Actor { name: 'cRandomString4' }) +---- + +== Projecting node and relationship properties with no arguments + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + title + actorsConnection { + totalCount + edges { + properties { + screenTime + } + node { + name + } + } + pageInfo { + hasNextPage + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Actor', + name: actor0.name + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} +RETURN this { + .title, + actorsConnection: actorsConnection +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "movies": [ + { + "title": "RandomString1", + "actorsConnection": { + "totalCount": 3, + "edges": [ + { + "properties": { + "screenTime": 105 + }, + "node": { + "name": "aRandomString2" + } + }, + { + "properties": { + "screenTime": 105 + }, + "node": { + "name": "bRandomString3" + } + }, + { + "properties": { + "screenTime": 5 + }, + "node": { + "name": "cRandomString4" + } + } + ], + "pageInfo": { + "hasNextPage": false + } + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/rfcs/query-limits.adoc b/core/src/test/resources/integration-test-files/rfcs/query-limits.adoc new file mode 100644 index 00000000..748bbbae --- /dev/null +++ b/core/src/test/resources/integration-test-files/rfcs/query-limits.adoc @@ -0,0 +1,70 @@ +:toc: +:toclevels: 42 + += integration/rfcs/query-limits + +== Top Level Query Limits + +=== should limit the top level query + +.Schema +[source,graphql,schema=true] +---- +type Movie @limit(default: 2) { + id: ID! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +WITH [1,2,3,4,5] AS iterate + UNWIND iterate AS i + CREATE (:Movie {id: "A"}) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies { + id + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 2 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WITH * LIMIT $param0 +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "A" + }, + { + "id": "A" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/scalars.adoc b/core/src/test/resources/integration-test-files/scalars.adoc new file mode 100644 index 00000000..bb79303a --- /dev/null +++ b/core/src/test/resources/integration-test-files/scalars.adoc @@ -0,0 +1,64 @@ +:toc: +:toclevels: 42 + += scalars + +== should serialize a id correctly + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {id: "986"}) + RETURN m {.id} as m +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {id: 986}) { + id + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "986" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id = $param0 +RETURN this { + .id +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "986" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/bigint.adoc b/core/src/test/resources/integration-test-files/types/bigint.adoc new file mode 100644 index 00000000..18007229 --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/bigint.adoc @@ -0,0 +1,131 @@ +:toc: +:toclevels: 42 + += BigInt + +== read + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type File { + name: String! + size: BigInt! +} +---- + +=== should successfully query an node with a BigInt property + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (f:File) + SET f.name = "RandomString1" + SET f.size = 9223372036854775807 +---- + +.GraphQL-Query +[source,graphql] +---- +{ + files(where: {name: "RandomString1"}) { + name + size + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:File) +WHERE this.name = $param0 +RETURN this { + .name, + .size +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "files": [ + { + "name": "RandomString1", + "size": "9223372036854775807" + } + ] +} +---- + +''' + +=== should successfully query an node with a BigInt property using in where + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (f:File) + SET f.name = "RandomString1" + SET f.size = 8323372036854775807 +---- + +.GraphQL-Query +[source,graphql] +---- +{ + files(where: {size: 8323372036854775807}) { + name + size + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": { + "low": -1239023617, + "high": 1937936068 + } +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:File) +WHERE this.size = $param0 +RETURN this { + .name, + .size +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "files": [ + { + "name": "RandomString1", + "size": "8323372036854775807" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/date.adoc b/core/src/test/resources/integration-test-files/types/date.adoc new file mode 100644 index 00000000..bbe630d5 --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/date.adoc @@ -0,0 +1,66 @@ +:toc: +:toclevels: 42 + += Date + +== find + +=== should find a movie (with a Date) + +.Schema +[source,graphql,schema=true] +---- +type Movie { + date: Date +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie) + SET m.date = date("2024-12-01") +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {date: "2024-12-01T15:46:32.522Z"}) { + date + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "2024-12-01" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.date = $param0 +RETURN this { + .date +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "date": "2024-12-01" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/datetime.adoc b/core/src/test/resources/integration-test-files/types/datetime.adoc new file mode 100644 index 00000000..501fc235 --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/datetime.adoc @@ -0,0 +1,127 @@ +:toc: +:toclevels: 42 + += DateTime + +== find + +=== should find a movie (with a DateTime) + +.Schema +[source,graphql,schema=true] +---- +type Movie { + datetime: DateTime +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie) + SET m.datetime = datetime("2024-12-01T15:46:12.637000000Z") +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {datetime: "2024-12-01T15:46:12.637Z"}) { + datetime + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "2024-12-01T15:46:12.637Z" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.datetime = $param0 +RETURN this { + datetime: apoc.date.convertFormat(toString(this.datetime), 'iso_zoned_date_time', 'iso_offset_date_time') +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "datetime": "2024-12-01T15:46:12.637Z" + } + ] +} +---- + +''' + +=== should find a movie (with a DateTime created with a timezone) + +.Schema +[source,graphql,schema=true] +---- +type Movie { + name: String + datetime: DateTime +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie) + SET m.name = "Movie" + SET m.datetime = datetime("2024-12-01T15:46:12.702[Etc/UTC]") +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {name: "Movie"}) { + datetime + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Movie" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.name = $param0 +RETURN this { + datetime: apoc.date.convertFormat(toString(this.datetime), 'iso_zoned_date_time', 'iso_offset_date_time') +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "datetime": "2024-12-01T15:46:12.702Z" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/duration.adoc b/core/src/test/resources/integration-test-files/types/duration.adoc new file mode 100644 index 00000000..57e7ecbb --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/duration.adoc @@ -0,0 +1,395 @@ +:toc: +:toclevels: 42 + += Duration + +== filter + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID! + duration: Duration! +} +---- + +=== should filter based on duration equality + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie) + SET movie = {id: "RandomString1", duration: duration("P0M4DT0S")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($id: ID!, $duration: Duration!) { + movies(where: {id: $id, duration: $duration}) { + id + duration + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "RandomString1", + "duration": "P4D" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "RandomString1", + "param1" : "P4D" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id = $param0 + AND (datetime() + this.duration) = (datetime() + $param1)) +RETURN this { + .id, + .duration +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "duration": "P0M4DT0S" + } + ] +} +---- + +''' + +=== should filter based on duration comparison, for filter: LT + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (long:Movie) + SET long = {id: "RandomString1", duration: duration("P24M0DT0S")} + CREATE (medium:Movie) + SET medium = {id: "RandomString2", duration: duration("P2M0DT0S")} + CREATE (short:Movie) + SET short = {id: "RandomString3", duration: duration("P0M2DT0S")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{duration: ASC}]}) { + id + duration + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "duration_LT": "P2M" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "P2M" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND (datetime() + this.duration) < (datetime() + $param1)) +WITH * ORDER BY this.duration ASC +RETURN this { + .id, + .duration +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString3", + "duration": "P0M2DT0S" + } + ] +} +---- + +''' + +=== should filter based on duration comparison, for filter: LTE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (long:Movie) + SET long = {id: "RandomString1", duration: duration("P24M0DT0S")} + CREATE (medium:Movie) + SET medium = {id: "RandomString2", duration: duration("P2M0DT0S")} + CREATE (short:Movie) + SET short = {id: "RandomString3", duration: duration("P0M2DT0S")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{duration: ASC}]}) { + id + duration + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "duration_LTE": "P2M" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "P2M" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND (datetime() + this.duration) <= (datetime() + $param1)) +WITH * ORDER BY this.duration ASC +RETURN this { + .id, + .duration +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString3", + "duration": "P0M2DT0S" + }, + { + "id": "RandomString2", + "duration": "P2M0DT0S" + } + ] +} +---- + +''' + +=== should filter based on duration comparison, for filter: GT + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (long:Movie) + SET long = {id: "RandomString1", duration: duration("P24M0DT0S")} + CREATE (medium:Movie) + SET medium = {id: "RandomString2", duration: duration("P2M0DT0S")} + CREATE (short:Movie) + SET short = {id: "RandomString3", duration: duration("P0M2DT0S")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{duration: ASC}]}) { + id + duration + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "duration_GT": "P2M" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "P2M" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND (datetime() + this.duration) > (datetime() + $param1)) +WITH * ORDER BY this.duration ASC +RETURN this { + .id, + .duration +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString1", + "duration": "P24M0DT0S" + } + ] +} +---- + +''' + +=== should filter based on duration comparison, for filter: GTE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (long:Movie) + SET long = {id: "RandomString1", duration: duration("P24M0DT0S")} + CREATE (medium:Movie) + SET medium = {id: "RandomString2", duration: duration("P2M0DT0S")} + CREATE (short:Movie) + SET short = {id: "RandomString3", duration: duration("P0M2DT0S")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{duration: ASC}]}) { + id + duration + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "duration_GTE": "P2M" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "P2M" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND (datetime() + this.duration) >= (datetime() + $param1)) +WITH * ORDER BY this.duration ASC +RETURN this { + .id, + .duration +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "id": "RandomString2", + "duration": "P2M0DT0S" + }, + { + "id": "RandomString1", + "duration": "P24M0DT0S" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/localdatetime.adoc b/core/src/test/resources/integration-test-files/types/localdatetime.adoc new file mode 100644 index 00000000..23d5b103 --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/localdatetime.adoc @@ -0,0 +1,545 @@ +:toc: +:toclevels: 42 + += LocalDateTime + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID! + localDT: LocalDateTime + localDTs: [LocalDateTime!] +} +---- + +== filter + +=== should filter based on localDT equality + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie) + SET movie = {id: "RandomString1", localDT: localdatetime("2024-09-17T11:49:48.322000000")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($localDT: LocalDateTime!) { + movies(where: {localDT: $localDT}) { + id + localDT + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "localDT": "2024-09-17T11:49:48.322" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "2024-09-17T11:49:48.322" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.localDT = $param0 +RETURN this { + .id, + .localDT +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "localDT" : "2024-09-17T11:49:48.322" + } ] +} +---- + +''' + +=== should filter based on localDT comparison, for filter LT + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", localDT: localdatetime("2025-02-18T18:10:55.462000000")} + CREATE (present:Movie) + SET present = {id: "RandomString2", localDT: localdatetime("2024-12-01T15:45:34.296000000")} + CREATE (past:Movie) + SET past = {id: "RandomString3", localDT: localdatetime("2022-08-29T10:21:43.108000000")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{localDT: ASC}]}) { + id + localDT + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "localDT_LT": "2024-12-01T15:45:34.296" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "2024-12-01T15:45:34.296" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.localDT < $param1) +WITH * ORDER BY this.localDT ASC +RETURN this { + .id, + .localDT +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "localDT" : "2022-08-29T10:21:43.108" + } ] +} +---- + +''' + +=== should filter based on localDT comparison, for filter LTE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", localDT: localdatetime("2025-02-18T18:10:55.462000000")} + CREATE (present:Movie) + SET present = {id: "RandomString2", localDT: localdatetime("2024-12-01T15:45:34.404000000")} + CREATE (past:Movie) + SET past = {id: "RandomString3", localDT: localdatetime("2022-08-29T10:21:43.108000000")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{localDT: ASC}]}) { + id + localDT + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "localDT_LTE": "2024-12-01T15:45:34.404" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "2024-12-01T15:45:34.404" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.localDT <= $param1) +WITH * ORDER BY this.localDT ASC +RETURN this { + .id, + .localDT +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "localDT" : "2022-08-29T10:21:43.108" + }, { + "id" : "RandomString2", + "localDT" : "2024-12-01T15:45:34.404" + } ] +} +---- + +''' + +=== should filter based on localDT comparison, for filter GT + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", localDT: localdatetime("2025-02-18T18:10:55.462000000")} + CREATE (present:Movie) + SET present = {id: "RandomString2", localDT: localdatetime("2024-12-01T15:45:34.459000000")} + CREATE (past:Movie) + SET past = {id: "RandomString3", localDT: localdatetime("2022-08-29T10:21:43.108000000")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{localDT: ASC}]}) { + id + localDT + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "localDT_GT": "2024-12-01T15:45:34.459" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "2024-12-01T15:45:34.459" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.localDT > $param1) +WITH * ORDER BY this.localDT ASC +RETURN this { + .id, + .localDT +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "localDT" : "2025-02-18T18:10:55.462" + } ] +} +---- + +''' + +=== should filter based on localDT comparison, for filter GTE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", localDT: localdatetime("2025-02-18T18:10:55.462000000")} + CREATE (present:Movie) + SET present = {id: "RandomString2", localDT: localdatetime("2024-12-01T15:45:34.514000000")} + CREATE (past:Movie) + SET past = {id: "RandomString3", localDT: localdatetime("2022-08-29T10:21:43.108000000")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{localDT: ASC}]}) { + id + localDT + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "localDT_GTE": "2024-12-01T15:45:34.514" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "2024-12-01T15:45:34.514" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.localDT >= $param1) +WITH * ORDER BY this.localDT ASC +RETURN this { + .id, + .localDT +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString2", + "localDT" : "2024-12-01T15:45:34.514" + }, { + "id" : "RandomString1", + "localDT" : "2025-02-18T18:10:55.462" + } ] +} +---- + +''' + +== sorting + +=== should sort based on localDT, sorting by ASC + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", localDT: localdatetime("2025-08-10T05:25:26.654000000")} + CREATE (present:Movie) + SET present = {id: "RandomString2", localDT: localdatetime("2024-12-01T15:45:34.595000000")} + CREATE (past:Movie) + SET past = {id: "RandomString3", localDT: localdatetime("2023-10-05T14:58:45.170000000")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($futureId: ID!, $presentId: ID!, $pastId: ID!, $sort: SortDirection!) { + movies( + where: {id_IN: [$futureId, $presentId, $pastId]} + options: {sort: [{localDT: $sort}]} + ) { + id + localDT + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "futureId": "RandomString1", + "presentId": "RandomString2", + "pastId": "RandomString3", + "sort": "ASC" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id IN $param0 +WITH * ORDER BY this.localDT ASC +RETURN this { + .id, + .localDT +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "localDT" : "2023-10-05T14:58:45.170" + }, { + "id" : "RandomString2", + "localDT" : "2024-12-01T15:45:34.595" + }, { + "id" : "RandomString1", + "localDT" : "2025-08-10T05:25:26.654" + } ] +} +---- + +''' + +=== should sort based on localDT, sorting by DESC + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", localDT: localdatetime("2025-08-10T05:25:26.654000000")} + CREATE (present:Movie) + SET present = {id: "RandomString2", localDT: localdatetime("2024-12-01T15:45:34.695000000")} + CREATE (past:Movie) + SET past = {id: "RandomString3", localDT: localdatetime("2023-10-05T14:58:45.170000000")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($futureId: ID!, $presentId: ID!, $pastId: ID!, $sort: SortDirection!) { + movies( + where: {id_IN: [$futureId, $presentId, $pastId]} + options: {sort: [{localDT: $sort}]} + ) { + id + localDT + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "futureId": "RandomString1", + "presentId": "RandomString2", + "pastId": "RandomString3", + "sort": "DESC" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id IN $param0 +WITH * ORDER BY this.localDT DESC +RETURN this { + .id, + .localDT +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "localDT" : "2025-08-10T05:25:26.654" + }, { + "id" : "RandomString2", + "localDT" : "2024-12-01T15:45:34.695" + }, { + "id" : "RandomString3", + "localDT" : "2023-10-05T14:58:45.170" + } ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/localtime.adoc b/core/src/test/resources/integration-test-files/types/localtime.adoc new file mode 100644 index 00000000..d4eec91f --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/localtime.adoc @@ -0,0 +1,562 @@ +:toc: +:toclevels: 42 + += LocalTime + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID! + time: LocalTime + times: [LocalTime!] +} +---- + +== filter + +=== should filter based on time equality + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie) + SET movie = {id: "RandomString1", time: localtime("11:49:48.322000000")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($time: LocalTime!) { + movies(where: {time: $time}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "RandomString1", + "time": "11:49:48.322" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "11:49:48.322" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.time = $param0 +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "time" : "11:49:48.322" + } ] +} +---- + +''' + +=== should filter based on time comparison, for filter LT + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: localtime("13:00:00")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: localtime("12:00:00")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: localtime("11:00:00")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{time: ASC}]}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "time_LT": "12:00:00" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "param1": "12:00:00" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.time < $param1) +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "time" : "11:00" + } ] +} +---- + +''' + +=== should filter based on time comparison, for filter LTE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: localtime("13:00:00")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: localtime("12:00:00")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: localtime("11:00:00")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{time: ASC}]}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "time_LTE": "12:00:00" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "param1": "12:00:00" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.time <= $param1) +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "time" : "11:00" + }, { + "id" : "RandomString2", + "time" : "12:00" + } ] +} +---- + +''' + +=== should filter based on time comparison, for filter GT + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: localtime("13:00:00")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: localtime("12:00:00")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: localtime("11:00:00")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{time: ASC}]}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "time_GT": "12:00:00" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "param1": "12:00:00" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.time > $param1) +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "time" : "13:00" + } ] +} +---- + +''' + +=== should filter based on time comparison, for filter GTE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: localtime("13:00:00")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: localtime("12:00:00")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: localtime("11:00:00")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{time: ASC}]}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "time_GTE": "12:00:00" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "param1": "12:00:00" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.time >= $param1) +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString2", + "time" : "12:00" + }, { + "id" : "RandomString1", + "time" : "13:00" + } ] +} +---- + +''' + +== sorting + +=== should sort based on time, sorting by ASC + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: localtime("13:00:00")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: localtime("12:00:00")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: localtime("11:00:00")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($futureId: ID!, $presentId: ID!, $pastId: ID!, $sort: SortDirection!) { + movies( + where: {id_IN: [$futureId, $presentId, $pastId]} + options: {sort: [{time: $sort}]} + ) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "futureId": "RandomString1", + "presentId": "RandomString2", + "pastId": "RandomString3", + "sort": "ASC" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id IN $param0 +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "time" : "11:00" + }, { + "id" : "RandomString2", + "time" : "12:00" + }, { + "id" : "RandomString1", + "time" : "13:00" + } ] +} +---- + +''' + +=== should sort based on time, sorting by DESC + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: localtime("13:00:00")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: localtime("12:00:00")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: localtime("11:00:00")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($futureId: ID!, $presentId: ID!, $pastId: ID!, $sort: SortDirection!) { + movies( + where: {id_IN: [$futureId, $presentId, $pastId]} + options: {sort: [{time: $sort}]} + ) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "futureId": "RandomString1", + "presentId": "RandomString2", + "pastId": "RandomString3", + "sort": "DESC" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id IN $param0 +WITH * ORDER BY this.time DESC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "time" : "13:00" + }, { + "id" : "RandomString2", + "time" : "12:00" + }, { + "id" : "RandomString3", + "time" : "11:00" + } ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/point-cartesian.adoc b/core/src/test/resources/integration-test-files/types/point-cartesian.adoc new file mode 100644 index 00000000..54546fe2 --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/point-cartesian.adoc @@ -0,0 +1,182 @@ +:toc: +:toclevels: 42 + += CartesianPoint + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Part { + serial: String! + location: CartesianPoint! +} +---- + +== enables query of a node with a cartesian point + +.Test Data +[source,cypher,test-data=true] +---- +CALL { + CREATE (p:Part) + SET p.serial = "bf92efbc-6c15-40ac-9cd5-8ab95fa4da90" + SET p.location = point({x: 0.2800768264569342, y: 0.6105434170458466}) + RETURN p + } + + RETURN p { .id, .location } AS p +---- + +.GraphQL-Query +[source,graphql] +---- +query Parts($serial: String!) { + parts(where: {serial: $serial}) { + serial + location { + x + y + z + crs + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "serial": "bf92efbc-6c15-40ac-9cd5-8ab95fa4da90" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "bf92efbc-6c15-40ac-9cd5-8ab95fa4da90" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Part) +WHERE this.serial = $param0 +RETURN this { + .serial, + location: CASE WHEN this.location IS NOT NULL THEN { + x: this.location.x, + y: this.location.y, + z: CASE WHEN this.location.srid = 9157 THEN this.location.z ELSE NULL END, + crs: this.location.crs + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "parts": [ + { + "serial": "bf92efbc-6c15-40ac-9cd5-8ab95fa4da90", + "location": { + "x": 0.2800768264569342, + "y": 0.6105434170458466, + "z": null, + "crs": "cartesian" + } + } + ] +} +---- + +''' + +== enables query of a node with a cartesian-3d point + +.Test Data +[source,cypher,test-data=true] +---- +CALL { + CREATE (p:Part) + SET p.serial = "c7715adc-9c9c-45ff-b4ed-6cb20bb044ad" + SET p.location = point({x: 0.9446345162577927, y: 0.7858678111806512, z: 0.4248296618461609}) + RETURN p + } + + RETURN p { .id, .location } AS p +---- + +.GraphQL-Query +[source,graphql] +---- +query Parts($serial: String!) { + parts(where: {serial: $serial}) { + serial + location { + x + y + z + crs + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "serial": "c7715adc-9c9c-45ff-b4ed-6cb20bb044ad" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "c7715adc-9c9c-45ff-b4ed-6cb20bb044ad" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Part) +WHERE this.serial = $param0 +RETURN this { + .serial, + location: CASE WHEN this.location IS NOT NULL THEN { + x: this.location.x, + y: this.location.y, + z: CASE WHEN this.location.srid = 9157 THEN this.location.z ELSE NULL END, + crs: this.location.crs + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "parts": [ + { + "serial": "c7715adc-9c9c-45ff-b4ed-6cb20bb044ad", + "location": { + "x": 0.9446345162577927, + "y": 0.7858678111806512, + "z": 0.4248296618461609, + "crs": "cartesian-3d" + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/point.adoc b/core/src/test/resources/integration-test-files/types/point.adoc new file mode 100644 index 00000000..28f6ed7f --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/point.adoc @@ -0,0 +1,116 @@ +:toc: +:toclevels: 42 + += Point + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Photograph { + id: String! + size: Int! + location: Point! +} + +type Query { + custom: String! +} +---- + +== enables query for equality of a node with a wgs-84-3d point + +.Test Data +[source,cypher,test-data=true] +---- +CALL { + CREATE (p:Photograph) + SET p.id = "3019fe82-5231-4103-8662-39c1fcc7d50c" + SET p.size = 99119 + SET p.location = point({longitude: 125.6358, latitude: -7.2045, height: 0.6950517320074141}) + RETURN p + } + + RETURN p { .id, .size, .location } AS p +---- + +.GraphQL-Query +[source,graphql] +---- +query Photographs($longitude: Float!, $latitude: Float!, $height: Float) { + photographs( + where: {location: {longitude: $longitude, latitude: $latitude, height: $height}} + ) { + id + size + location { + latitude + longitude + height + crs + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "longitude": 125.6358, + "latitude": -7.2045, + "height": 0.6950517320074141 +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": { + "longitude": 125.6358, + "latitude": -7.2045, + "height": 0.6950517320074141 + } +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Photograph) +WHERE this.location = point($param0) +RETURN this { + .id, + .size, + location: CASE WHEN this.location IS NOT NULL THEN { + latitude: this.location.latitude, + longitude: this.location.longitude, + height: CASE WHEN this.location.srid = 4979 THEN this.location.height ELSE NULL END, + crs: this.location.crs + } ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "photographs": [ + { + "id": "3019fe82-5231-4103-8662-39c1fcc7d50c", + "size": 99119, + "location": { + "latitude": -7.2045, + "longitude": 125.6358, + "height": 0.6950517320074141, + "crs": "wgs-84-3d" + } + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/points-cartesian.adoc b/core/src/test/resources/integration-test-files/types/points-cartesian.adoc new file mode 100644 index 00000000..76637a1c --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/points-cartesian.adoc @@ -0,0 +1,270 @@ +:toc: +:toclevels: 42 + += [CartesianPoint] + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Part { + id: String! + locations: [CartesianPoint!]! +} +---- + +== enables query of a node with multiple cartesian points + +.Test Data +[source,cypher,test-data=true] +---- +CALL { + CREATE (r:Part) + SET r.id = "5ba92bc4-95e7-4361-857c-60edcd771391" + SET r.locations = [p in [{x: 0.02772025833837688, y: 0.07264417805708945}, {x: 0.02772025833837688, y: 0.07264417805708945}, {x: 0.02772025833837688, y: 0.07264417805708945}, {x: 0.02772025833837688, y: 0.07264417805708945}, {x: 0.02772025833837688, y: 0.07264417805708945}, {x: 0.02772025833837688, y: 0.07264417805708945}, {x: 0.02772025833837688, y: 0.07264417805708945}, {x: 0.02772025833837688, y: 0.07264417805708945}] | point(p)] + RETURN r + } + + RETURN r { .id, .locations } AS r +---- + +.GraphQL-Query +[source,graphql] +---- +query Parts($id: String!) { + parts(where: {id: $id}) { + id + locations { + y + x + z + crs + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "5ba92bc4-95e7-4361-857c-60edcd771391" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "5ba92bc4-95e7-4361-857c-60edcd771391" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Part) +WHERE this.id = $param0 +RETURN this { + .id, + locations: CASE WHEN this.locations IS NOT NULL THEN [p_var0 IN this.locations | { + y: p_var0.y, + x: p_var0.x, + z: CASE WHEN p_var0.srid = 9157 THEN p_var0.z ELSE NULL END, + crs: p_var0.crs + }] ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "parts": [ + { + "id": "5ba92bc4-95e7-4361-857c-60edcd771391", + "locations": [ + { + "y": 0.07264417805708945, + "x": 0.02772025833837688, + "z": null, + "crs": "cartesian" + }, + { + "y": 0.07264417805708945, + "x": 0.02772025833837688, + "z": null, + "crs": "cartesian" + }, + { + "y": 0.07264417805708945, + "x": 0.02772025833837688, + "z": null, + "crs": "cartesian" + }, + { + "y": 0.07264417805708945, + "x": 0.02772025833837688, + "z": null, + "crs": "cartesian" + }, + { + "y": 0.07264417805708945, + "x": 0.02772025833837688, + "z": null, + "crs": "cartesian" + }, + { + "y": 0.07264417805708945, + "x": 0.02772025833837688, + "z": null, + "crs": "cartesian" + }, + { + "y": 0.07264417805708945, + "x": 0.02772025833837688, + "z": null, + "crs": "cartesian" + }, + { + "y": 0.07264417805708945, + "x": 0.02772025833837688, + "z": null, + "crs": "cartesian" + } + ] + } + ] +} +---- + +''' + +== enables query of a node with multiple cartesian-3d points + +.Test Data +[source,cypher,test-data=true] +---- +CALL { + CREATE (r:Part) + SET r.id = "052322ec-95e5-4b88-8a90-9f0c1df17ee3" + SET r.locations = [p in [{x: 0.8367510938551277, y: 0.7110547178890556, z: 0.9648887133225799}, {x: 0.8367510938551277, y: 0.7110547178890556, z: 0.9648887133225799}, {x: 0.8367510938551277, y: 0.7110547178890556, z: 0.9648887133225799}, {x: 0.8367510938551277, y: 0.7110547178890556, z: 0.9648887133225799}, {x: 0.8367510938551277, y: 0.7110547178890556, z: 0.9648887133225799}, {x: 0.8367510938551277, y: 0.7110547178890556, z: 0.9648887133225799}, {x: 0.8367510938551277, y: 0.7110547178890556, z: 0.9648887133225799}, {x: 0.8367510938551277, y: 0.7110547178890556, z: 0.9648887133225799}] | point(p)] + RETURN r + } + + RETURN r { .id, .locations } AS r +---- + +.GraphQL-Query +[source,graphql] +---- +query Parts($id: String!) { + parts(where: {id: $id}) { + id + locations { + y + x + z + crs + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "052322ec-95e5-4b88-8a90-9f0c1df17ee3" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "052322ec-95e5-4b88-8a90-9f0c1df17ee3" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Part) +WHERE this.id = $param0 +RETURN this { + .id, + locations: CASE WHEN this.locations IS NOT NULL THEN [p_var0 IN this.locations | { + y: p_var0.y, + x: p_var0.x, + z: CASE WHEN p_var0.srid = 9157 THEN p_var0.z ELSE NULL END, + crs: p_var0.crs + }] ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "parts": [ + { + "id": "052322ec-95e5-4b88-8a90-9f0c1df17ee3", + "locations": [ + { + "y": 0.7110547178890556, + "x": 0.8367510938551277, + "z": 0.9648887133225799, + "crs": "cartesian-3d" + }, + { + "y": 0.7110547178890556, + "x": 0.8367510938551277, + "z": 0.9648887133225799, + "crs": "cartesian-3d" + }, + { + "y": 0.7110547178890556, + "x": 0.8367510938551277, + "z": 0.9648887133225799, + "crs": "cartesian-3d" + }, + { + "y": 0.7110547178890556, + "x": 0.8367510938551277, + "z": 0.9648887133225799, + "crs": "cartesian-3d" + }, + { + "y": 0.7110547178890556, + "x": 0.8367510938551277, + "z": 0.9648887133225799, + "crs": "cartesian-3d" + }, + { + "y": 0.7110547178890556, + "x": 0.8367510938551277, + "z": 0.9648887133225799, + "crs": "cartesian-3d" + }, + { + "y": 0.7110547178890556, + "x": 0.8367510938551277, + "z": 0.9648887133225799, + "crs": "cartesian-3d" + }, + { + "y": 0.7110547178890556, + "x": 0.8367510938551277, + "z": 0.9648887133225799, + "crs": "cartesian-3d" + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/points.adoc b/core/src/test/resources/integration-test-files/types/points.adoc new file mode 100644 index 00000000..f513b5b5 --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/points.adoc @@ -0,0 +1,137 @@ +:toc: +:toclevels: 42 + += [Point] + +== Setup + +.Schema +[source,graphql,schema=true] +---- +type Route { + id: String! + waypoints: [Point!]! +} +---- + +== enables query of a node with multiple wgs-84-3d points + +.Test Data +[source,cypher,test-data=true] +---- +CALL { + CREATE (r:Route) + SET r.id = "dd320626-cc23-4938-9f33-ba624a3a3e8d" + SET r.waypoints = [p in [{longitude: 146.1568, latitude: -54.6132, height: 0.03157347836531699}, {longitude: 146.1568, latitude: -54.6132, height: 0.03157347836531699}, {longitude: 146.1568, latitude: -54.6132, height: 0.03157347836531699}, {longitude: 146.1568, latitude: -54.6132, height: 0.03157347836531699}, {longitude: 146.1568, latitude: -54.6132, height: 0.03157347836531699}, {longitude: 146.1568, latitude: -54.6132, height: 0.03157347836531699}, {longitude: 146.1568, latitude: -54.6132, height: 0.03157347836531699}] | point(p)] + RETURN r + } + + RETURN r { .id, .waypoints } AS r +---- + +.GraphQL-Query +[source,graphql] +---- +query Routes($id: String!) { + routes(where: {id: $id}) { + id + waypoints { + latitude + longitude + height + crs + } + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "id": "dd320626-cc23-4938-9f33-ba624a3a3e8d" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "dd320626-cc23-4938-9f33-ba624a3a3e8d" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Route) +WHERE this.id = $param0 +RETURN this { + .id, + waypoints: CASE WHEN this.waypoints IS NOT NULL THEN [p_var0 IN this.waypoints | { + latitude: p_var0.latitude, + longitude: p_var0.longitude, + height: CASE WHEN p_var0.srid = 4979 THEN p_var0.height ELSE NULL END, + crs: p_var0.crs + }] ELSE NULL END +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "routes": [ + { + "id": "dd320626-cc23-4938-9f33-ba624a3a3e8d", + "waypoints": [ + { + "latitude": -54.6132, + "longitude": 146.1568, + "height": 0.03157347836531699, + "crs": "wgs-84-3d" + }, + { + "latitude": -54.6132, + "longitude": 146.1568, + "height": 0.03157347836531699, + "crs": "wgs-84-3d" + }, + { + "latitude": -54.6132, + "longitude": 146.1568, + "height": 0.03157347836531699, + "crs": "wgs-84-3d" + }, + { + "latitude": -54.6132, + "longitude": 146.1568, + "height": 0.03157347836531699, + "crs": "wgs-84-3d" + }, + { + "latitude": -54.6132, + "longitude": 146.1568, + "height": 0.03157347836531699, + "crs": "wgs-84-3d" + }, + { + "latitude": -54.6132, + "longitude": 146.1568, + "height": 0.03157347836531699, + "crs": "wgs-84-3d" + }, + { + "latitude": -54.6132, + "longitude": 146.1568, + "height": 0.03157347836531699, + "crs": "wgs-84-3d" + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/types/time.adoc b/core/src/test/resources/integration-test-files/types/time.adoc new file mode 100644 index 00000000..b0b14804 --- /dev/null +++ b/core/src/test/resources/integration-test-files/types/time.adoc @@ -0,0 +1,544 @@ +:toc: +:toclevels: 42 + += Time + +== filter + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID! + time: Time! +} +---- + +=== should filter based on time equality + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (movie:Movie) + SET movie = {id: "RandomString1", time: time("11:49:48.322000000Z")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($time: Time!) { + movies(where: {time: $time}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "time": "11:49:48.322Z" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "11:49:48.322Z" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.time = $param0 +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "time" : "11:49:48.322Z" + } ] +} +---- + +''' + +=== should filter based on time comparison for filter: LT + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: time("13:00:00Z")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: time("12:00:00Z")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: time("11:00:00Z")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{time: ASC}]}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "time_LT": "12:00:00" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "12:00Z" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.time < $param1) +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "time" : "11:00Z" + } ] +} +---- + +''' + +=== should filter based on time comparison for filter: LTE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: time("13:00:00Z")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: time("12:00:00Z")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: time("11:00:00Z")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{time: ASC}]}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "time_LTE": "12:00:00" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "12:00Z" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.time <= $param1) +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "time" : "11:00Z" + }, { + "id" : "RandomString2", + "time" : "12:00Z" + } ] +} +---- + +''' + +=== should filter based on time comparison for filter: GT + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: time("13:00:00Z")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: time("12:00:00Z")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: time("11:00:00Z")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{time: ASC}]}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "time_GT": "12:00:00" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "12:00Z" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.time > $param1) +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "time" : "13:00Z" + } ] +} +---- + +''' + +=== should filter based on time comparison for filter: GTE + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: time("13:00:00Z")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: time("12:00:00Z")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: time("11:00:00Z")} +---- + +.GraphQL-Query +[source,graphql] +---- +query ($where: MovieWhere!) { + movies(where: $where, options: {sort: [{time: ASC}]}) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "where": { + "id_IN": [ + "RandomString1", + "RandomString2", + "RandomString3" + ], + "time_GTE": "12:00:00" + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "RandomString1", "RandomString2", "RandomString3" ], + "param1" : "12:00Z" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE (this.id IN $param0 + AND this.time >= $param1) +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString2", + "time" : "12:00Z" + }, { + "id" : "RandomString1", + "time" : "13:00Z" + } ] +} +---- + +''' + +== sorting + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID! + time: Time! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (future:Movie) + SET future = {id: "RandomString1", time: time("13:00:00Z")} + CREATE (present:Movie) + SET present = {id: "RandomString2", time: time("12:00:00Z")} + CREATE (past:Movie) + SET past = {id: "RandomString3", time: time("11:00:00Z")} +---- + +=== should sort based on time, sorted by: ASC + +.GraphQL-Query +[source,graphql] +---- +query ($futureId: ID!, $presentId: ID!, $pastId: ID!, $sort: SortDirection!) { + movies( + where: {id_IN: [$futureId, $presentId, $pastId]} + options: {sort: [{time: $sort}]} + ) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "futureId": "RandomString1", + "presentId": "RandomString2", + "pastId": "RandomString3", + "sort": "ASC" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id IN $param0 +WITH * ORDER BY this.time ASC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString3", + "time" : "11:00Z" + }, { + "id" : "RandomString2", + "time" : "12:00Z" + }, { + "id" : "RandomString1", + "time" : "13:00Z" + } ] +} +---- + +''' + +=== should sort based on time, sorted by: DESC + +.GraphQL-Query +[source,graphql] +---- +query ($futureId: ID!, $presentId: ID!, $pastId: ID!, $sort: SortDirection!) { + movies( + where: {id_IN: [$futureId, $presentId, $pastId]} + options: {sort: [{time: $sort}]} + ) { + id + time + } +} +---- + +.GraphQL params input +[source,json,request=true] +---- +{ + "futureId": "RandomString1", + "presentId": "RandomString2", + "pastId": "RandomString3", + "sort": "DESC" +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": [ + "RandomString1", + "RandomString2", + "RandomString3" + ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.id IN $param0 +WITH * ORDER BY this.time DESC +RETURN this { + .id, + .time +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies" : [ { + "id" : "RandomString1", + "time" : "13:00Z" + }, { + "id" : "RandomString2", + "time" : "12:00Z" + }, { + "id" : "RandomString3", + "time" : "11:00Z" + } ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/unions/union-relationship-filtering.adoc b/core/src/test/resources/integration-test-files/unions/union-relationship-filtering.adoc new file mode 100644 index 00000000..dd1fb54f --- /dev/null +++ b/core/src/test/resources/integration-test-files/unions/union-relationship-filtering.adoc @@ -0,0 +1,172 @@ +:toc: +:toclevels: 42 + += Union filtering + +== Setup + +.Schema +[source,graphql,schema=true] +---- +union Production = Movie | Series + +type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") +} + +type Series { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") +} + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE(m1:Movie { title: "The Office" }) + CREATE(m2:Movie { title: "The Office 2" }) + CREATE(m3:Movie { title: "NOT The Office 2" }) + CREATE(s1:Series { title: "The Office 2" }) + CREATE(s2:Series { title: "NOT The Office" }) + CREATE(a1:Actor {name: "Keanu"}) + CREATE(a2:Actor {name: "Michael"}) + CREATE(a3:Actor {name: "John"}) + MERGE(a1)-[:ACTED_IN]->(m1) + MERGE(a1)-[:ACTED_IN]->(s2) + MERGE(a2)-[:ACTED_IN]->(m2) + MERGE(a2)-[:ACTED_IN]->(m3) + MERGE(a2)-[:ACTED_IN]->(s1) + MERGE(a3)-[:ACTED_IN]->(s1) + MERGE(a3)-[:ACTED_IN]->(s2) +---- + +== allow for filtering on top-level union relationships + +.GraphQL-Query +[source,graphql] +---- +{ + productions( + where: {Movie: {title: "The Office"}, Series: {title: "The Office 2"}} + ) { + ... on Movie { + title + } + ... on Series { + title + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "The Office", + "param1": "The Office 2" +} +---- + +.Expected Cypher output +[source,cypher] +---- +CALL { + MATCH (movie0:Movie) + WHERE movie0.title = $param0 + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS this UNION + MATCH (series0:Series) + WHERE series0.title = $param1 + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title + } AS series0 + RETURN series0 AS this +} +WITH this +RETURN this AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "productions": [ + { + "title": "The Office" + }, + { + "title": "The Office 2" + } + ] +} +---- + +''' + +== allow for filtering on nested-level relationship unions + +.GraphQL-Query +[source,graphql] +---- +{ + actors(where: {actedIn_SOME: {Movie: {title_CONTAINS: "Office"}}}) { + name + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "Office" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title CONTAINS $param0 +} +RETURN this { + .name +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "actors": [ + { + "name": "Michael" + }, + { + "name": "Keanu" + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/unions/unions-top-level.adoc b/core/src/test/resources/integration-test-files/unions/unions-top-level.adoc new file mode 100644 index 00000000..218c364e --- /dev/null +++ b/core/src/test/resources/integration-test-files/unions/unions-top-level.adoc @@ -0,0 +1,225 @@ +:toc: +:toclevels: 42 + +== Top-level union query fields + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +union Search = Genre | Movie + +type Genre { + name: String +} + +type Movie { + title: String + search: [Search!]! @relationship(type: "SEARCH", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "The Matrix"}) + CREATE (g:Genre {name: "Action"}) + MERGE (m)-[:SEARCH]->(m) + MERGE (m)-[:SEARCH]->(g) +---- + +=== should read top-level simple query on union + +.GraphQL-Query +[source,graphql] +---- +{ + searches { + ... on Genre { + name + } + ... on Movie { + title + search { + ... on Genre { + name + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +CALL { + MATCH (genre0:Genre) + WITH genre0 { + __typename: 'Genre', + __id: elementId(genre0), + .name + } AS genre0 + RETURN genre0 AS this UNION + MATCH (movie0:Movie) + CALL { + WITH movie0 + CALL { + WITH * + MATCH (movie0)-[search1:SEARCH]->(genre1:Genre) + WITH genre1 { + __typename: 'Genre', + __id: elementId(genre1), + .name + } AS genre1 + RETURN genre1 AS search0 UNION + WITH * + MATCH (movie0)-[search2:SEARCH]->(movie1:Movie) + WITH movie1 { + __typename: 'Movie', + __id: elementId(movie1) + } AS movie1 + RETURN movie1 AS search0 + } + WITH search0 + RETURN collect(search0) AS search0 + } + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + search: search0 + } AS movie0 + RETURN movie0 AS this +} +WITH this +RETURN this AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "searches": [ + { + "name": "Action" + }, + { + "title": "The Matrix", + "search": [ + { + "name": "Action" + }, + {} + ] + } + ] +} +---- + +''' + +=== should read top-level simple query on union sorted + +.GraphQL-Query +[source,graphql] +---- +{ + searches(options: {limit: 1, offset: 1}) { + ... on Genre { + name + } + ... on Movie { + title + search { + ... on Genre { + name + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": 1, + "param1": 1 +} +---- + +.Expected Cypher output +[source,cypher] +---- +CALL { + MATCH (genre0:Genre) + WITH genre0 { + __typename: 'Genre', + __id: elementId(genre0), + .name + } AS genre0 + RETURN genre0 AS this UNION + MATCH (movie0:Movie) + CALL { + WITH movie0 + CALL { + WITH * + MATCH (movie0)-[search1:SEARCH]->(genre1:Genre) + WITH genre1 { + __typename: 'Genre', + __id: elementId(genre1), + .name + } AS genre1 + RETURN genre1 AS search0 UNION + WITH * + MATCH (movie0)-[search2:SEARCH]->(movie1:Movie) + WITH movie1 { + __typename: 'Movie', + __id: elementId(movie1) + } AS movie1 + RETURN movie1 AS search0 + } + WITH search0 + RETURN collect(search0) AS search0 + } + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + search: search0 + } AS movie0 + RETURN movie0 AS this +} +WITH this SKIP $param0 LIMIT $param1 +RETURN this AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "searches": [ + { + "title": "The Matrix", + "search": [ + { + "name": "Action" + }, + {} + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/integration-test-files/unions/unions.adoc b/core/src/test/resources/integration-test-files/unions/unions.adoc new file mode 100644 index 00000000..577bcc70 --- /dev/null +++ b/core/src/test/resources/integration-test-files/unions/unions.adoc @@ -0,0 +1,418 @@ +:toc: +:toclevels: 42 + += unions + +== read Unions with missing types + +.Schema +[source,graphql,schema=true] +---- +union Search = Genre | Movie + +type Genre { + name: String +} + +type Movie { + title: String + search: [Search!]! @relationship(type: "SEARCH", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (g:Genre {name: "RandomString2"}) + MERGE (m)-[:SEARCH]->(m) + MERGE (m)-[:SEARCH]->(g) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies { + search { + ... on Genre { + name + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[search1:SEARCH]->(genre0:Genre) + WITH genre0 { + __typename: 'Genre', + __id: elementId(genre0), + .name + } AS genre0 + RETURN genre0 AS search0 UNION + WITH * + MATCH (this)-[search2:SEARCH]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0) + } AS movie0 + RETURN movie0 AS search0 + } + WITH search0 + RETURN collect(search0) AS search0 +} +RETURN this { + search: search0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "search": [ + { + "name": "RandomString2" + }, + {} + ] + } + ] +} +---- + +''' + +== should read and return unions + +.Schema +[source,graphql,schema=true] +---- +union Search = Genre | Movie + +type Genre { + name: String +} + +type Movie { + title: String + search: [Search!]! @relationship(type: "SEARCH", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (g:Genre {name: "RandomString2"}) + MERGE (m)-[:SEARCH]->(m) + MERGE (m)-[:SEARCH]->(g) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + search { + __typename + ... on Movie { + title + } + ... on Genre { + name + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[search1:SEARCH]->(genre0:Genre) + WITH genre0 { + __typename: 'Genre', + __id: elementId(genre0), + .name + } AS genre0 + RETURN genre0 AS search0 UNION + WITH * + MATCH (this)-[search2:SEARCH]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS search0 + } + WITH search0 + RETURN collect(search0) AS search0 +} +RETURN this { + search: search0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "search": [ + { + "__typename": "Genre", + "name": "RandomString2" + }, + { + "__typename": "Movie", + "title": "RandomString1" + } + ] + } + ] +} +---- + +''' + +== should read and return correct union members with where argument + +.Schema +[source,graphql,schema=true] +---- +union Search = Movie | Genre + +type Genre { + name: String +} + +type Movie { + title: String + search: [Search!]! @relationship(type: "SEARCH", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "RandomString1"}) + CREATE (g1:Genre {name: "RandomString2"}) + CREATE (g2:Genre {name: "RandomString3"}) + MERGE (m)-[:SEARCH]->(m) + MERGE (m)-[:SEARCH]->(g1) + MERGE (m)-[:SEARCH]->(g2) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "RandomString1"}) { + search(where: {Genre: {name: "RandomString2"}}) { + __typename + ... on Movie { + title + } + ... on Genre { + name + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "RandomString1", + "param1": "RandomString2" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[this0:SEARCH]->(this1:Genre) + WHERE this1.name = $param1 + WITH this1 { .name, __typename: "Genre", __id: toString(id(this1)) } AS this1 + RETURN this1 AS var2 + } + WITH var2 + RETURN collect(var2) AS var2 +} +RETURN this { search: var2 } AS this +---- + +.GraphQL-Response +[source,json,response=true] +---- +{ + "movies": [ + { + "search": [ + { + "__typename": "Genre", + "name": "RandomString2" + } + ] + } + ] +} +---- + +''' + +== should read and return unions with sort and limit + +.Schema +[source,graphql,schema=true] +---- +union Search = Movie | Genre + +type Genre { + name: String +} + +type Movie { + title: String + search: [Search!]! @relationship(type: "SEARCH", direction: OUT) +} +---- + +.Test Data +[source,cypher,test-data=true] +---- +CREATE (m:Movie {title: "originalMovie"}) + CREATE (m1:Movie {title: "movie1"}) + CREATE (m2:Movie {title: "movie2"}) + CREATE (g1:Genre {name: "genre1"}) + CREATE (g2:Genre {name: "genre2"}) + MERGE (m)-[:SEARCH]->(m1) + MERGE (m)-[:SEARCH]->(m2) + MERGE (m)-[:SEARCH]->(g1) + MERGE (m)-[:SEARCH]->(g2) +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {title: "originalMovie"}) { + search(options: {offset: 1, limit: 3}) { + ... on Movie { + title + } + ... on Genre { + name + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0": "originalMovie", + "param1": 1, + "param2": 3 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[search1:SEARCH]->(genre0:Genre) + WITH genre0 { + __typename: 'Genre', + __id: elementId(genre0), + .name + } AS genre0 + RETURN genre0 AS search0 UNION + WITH * + MATCH (this)-[search2:SEARCH]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS search0 + } + WITH search0 SKIP $param1 LIMIT $param2 + RETURN collect(search0) AS search0 +} +RETURN this { + search: search0 +} AS this +---- + +.GraphQL-Response +[source,json,response=true,ignore-order] +---- +{ + "movies": [ + { + "search": [ + { + "name": "genre1" + }, + { + "title": "movie1" + }, + { + "title": "movie2" + } + ] + } + ] +} +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/advanced-filtering.adoc b/core/src/test/resources/tck-test-files/cypher/v2/advanced-filtering.adoc index 5d187130..cdc8b95a 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/advanced-filtering.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/advanced-filtering.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher Advanced Filtering -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -21,8 +23,6 @@ type Genre { } ---- -== Configuration - .Configuration [source,json,schema-config=true] ---- @@ -44,14 +44,14 @@ type Genre { } ---- -== CONTAINS +== IN .GraphQL-Query [source,graphql] ---- { - movies(where: {id_CONTAINS: "123"}) { - id + movies(where: {_id_IN: ["123"]}) { + _id } } ---- @@ -60,7 +60,7 @@ type Genre { [source,json] ---- { - "param0" : "123" + "param0" : [ "123" ] } ---- @@ -68,21 +68,21 @@ type Genre { [source,cypher] ---- MATCH (this:Movie) -WHERE this.id CONTAINS $param0 +WHERE this._id IN $param0 RETURN this { - .id + ._id } AS this ---- ''' -== ENDS_WITH +== REGEX .GraphQL-Query [source,graphql] ---- { - movies(where: {id_ENDS_WITH: "123"}) { + movies(where: {id_MATCHES: "(?i)123.*"}) { id } } @@ -92,7 +92,7 @@ RETURN this { [source,json] ---- { - "param0" : "123" + "param0" : "(?i)123.*" } ---- @@ -100,7 +100,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.id ENDS WITH $param0 +WHERE this.id =~ $param0 RETURN this { .id } AS this @@ -108,14 +108,14 @@ RETURN this { ''' -== GT +== CONTAINS .GraphQL-Query [source,graphql] ---- { - movies(where: {actorCount_GT: 123}) { - actorCount + movies(where: {id_CONTAINS: "123"}) { + id } } ---- @@ -124,7 +124,7 @@ RETURN this { [source,json] ---- { - "param0" : 123 + "param0" : "123" } ---- @@ -132,22 +132,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.actorCount > $param0 +WHERE this.id CONTAINS $param0 RETURN this { - .actorCount + .id } AS this ---- ''' -== GT BigInt +== STARTS_WITH .GraphQL-Query [source,graphql] ---- { - movies(where: {budget_GT: 9223372036854775000}) { - budget + movies(where: {id_STARTS_WITH: "123"}) { + id } } ---- @@ -156,10 +156,7 @@ RETURN this { [source,json] ---- { - "param0" : { - "low" : -808, - "high" : 2147483647 - } + "param0" : "123" } ---- @@ -167,22 +164,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.budget > $param0 +WHERE this.id STARTS WITH $param0 RETURN this { - .budget + .id } AS this ---- ''' -== GT String +== ENDS_WITH .GraphQL-Query [source,graphql] ---- { - movies(where: {title_GT: "The Matrix Revolutions"}) { - title + movies(where: {id_ENDS_WITH: "123"}) { + id } } ---- @@ -191,7 +188,7 @@ RETURN this { [source,json] ---- { - "param0" : "The Matrix Revolutions" + "param0" : "123" } ---- @@ -199,21 +196,21 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.title > $param0 +WHERE this.id ENDS WITH $param0 RETURN this { - .title + .id } AS this ---- ''' -== GTE +== LT .GraphQL-Query [source,graphql] ---- { - movies(where: {actorCount_GTE: 123}) { + movies(where: {actorCount_LT: 123}) { actorCount } } @@ -231,7 +228,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.actorCount >= $param0 +WHERE this.actorCount < $param0 RETURN this { .actorCount } AS this @@ -239,13 +236,13 @@ RETURN this { ''' -== GTE BigInt +== LT BigInt .GraphQL-Query [source,graphql] ---- { - movies(where: {budget_GTE: 9223372036854775000}) { + movies(where: {budget_LT: 9223372036854775807}) { budget } } @@ -256,7 +253,7 @@ RETURN this { ---- { "param0" : { - "low" : -808, + "low" : -1, "high" : 2147483647 } } @@ -266,7 +263,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.budget >= $param0 +WHERE this.budget < $param0 RETURN this { .budget } AS this @@ -274,13 +271,13 @@ RETURN this { ''' -== GTE String +== LT String .GraphQL-Query [source,graphql] ---- { - movies(where: {title_GTE: "The Matrix Revolutions"}) { + movies(where: {title_LT: "The Matrix Revolutions"}) { title } } @@ -298,7 +295,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.title >= $param0 +WHERE this.title < $param0 RETURN this { .title } AS this @@ -306,14 +303,14 @@ RETURN this { ''' -== IN +== LTE .GraphQL-Query [source,graphql] ---- { - movies(where: {_id_IN: ["123"]}) { - _id + movies(where: {actorCount_LTE: 123}) { + actorCount } } ---- @@ -322,7 +319,7 @@ RETURN this { [source,json] ---- { - "param0" : [ "123" ] + "param0" : 123 } ---- @@ -330,22 +327,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this._id IN $param0 +WHERE this.actorCount <= $param0 RETURN this { - ._id + .actorCount } AS this ---- ''' -== LT +== LTE BigInt .GraphQL-Query [source,graphql] ---- { - movies(where: {actorCount_LT: 123}) { - actorCount + movies(where: {budget_LTE: 9223372036854775807}) { + budget } } ---- @@ -354,7 +351,10 @@ RETURN this { [source,json] ---- { - "param0" : 123 + "param0" : { + "low" : -1, + "high" : 2147483647 + } } ---- @@ -362,22 +362,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.actorCount < $param0 +WHERE this.budget <= $param0 RETURN this { - .actorCount + .budget } AS this ---- ''' -== LT BigInt +== LTE String .GraphQL-Query [source,graphql] ---- { - movies(where: {budget_LT: 9223372036854775807}) { - budget + movies(where: {title_LTE: "The Matrix Revolutions"}) { + title } } ---- @@ -386,10 +386,7 @@ RETURN this { [source,json] ---- { - "param0" : { - "low" : -1, - "high" : 2147483647 - } + "param0" : "The Matrix Revolutions" } ---- @@ -397,22 +394,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.budget < $param0 +WHERE this.title <= $param0 RETURN this { - .budget + .title } AS this ---- ''' -== LT String +== GT .GraphQL-Query [source,graphql] ---- { - movies(where: {title_LT: "The Matrix Revolutions"}) { - title + movies(where: {actorCount_GT: 123}) { + actorCount } } ---- @@ -421,7 +418,7 @@ RETURN this { [source,json] ---- { - "param0" : "The Matrix Revolutions" + "param0" : 123 } ---- @@ -429,22 +426,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.title < $param0 +WHERE this.actorCount > $param0 RETURN this { - .title + .actorCount } AS this ---- ''' -== LTE +== GT BigInt .GraphQL-Query [source,graphql] ---- { - movies(where: {actorCount_LTE: 123}) { - actorCount + movies(where: {budget_GT: 9223372036854775000}) { + budget } } ---- @@ -453,7 +450,10 @@ RETURN this { [source,json] ---- { - "param0" : 123 + "param0" : { + "low" : -808, + "high" : 2147483647 + } } ---- @@ -461,22 +461,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.actorCount <= $param0 +WHERE this.budget > $param0 RETURN this { - .actorCount + .budget } AS this ---- ''' -== LTE BigInt +== GT String .GraphQL-Query [source,graphql] ---- { - movies(where: {budget_LTE: 9223372036854775807}) { - budget + movies(where: {title_GT: "The Matrix Revolutions"}) { + title } } ---- @@ -485,10 +485,7 @@ RETURN this { [source,json] ---- { - "param0" : { - "low" : -1, - "high" : 2147483647 - } + "param0" : "The Matrix Revolutions" } ---- @@ -496,22 +493,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.budget <= $param0 +WHERE this.title > $param0 RETURN this { - .budget + .title } AS this ---- ''' -== LTE String +== GTE .GraphQL-Query [source,graphql] ---- { - movies(where: {title_LTE: "The Matrix Revolutions"}) { - title + movies(where: {actorCount_GTE: 123}) { + actorCount } } ---- @@ -520,7 +517,7 @@ RETURN this { [source,json] ---- { - "param0" : "The Matrix Revolutions" + "param0" : 123 } ---- @@ -528,22 +525,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.title <= $param0 +WHERE this.actorCount >= $param0 RETURN this { - .title + .actorCount } AS this ---- ''' -== REGEX +== GTE BigInt .GraphQL-Query [source,graphql] ---- { - movies(where: {id_MATCHES: "(?i)123.*"}) { - id + movies(where: {budget_GTE: 9223372036854775000}) { + budget } } ---- @@ -552,7 +549,10 @@ RETURN this { [source,json] ---- { - "param0" : "(?i)123.*" + "param0" : { + "low" : -808, + "high" : 2147483647 + } } ---- @@ -560,22 +560,22 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.id =~ $param0 +WHERE this.budget >= $param0 RETURN this { - .id + .budget } AS this ---- ''' -== STARTS_WITH +== GTE String .GraphQL-Query [source,graphql] ---- { - movies(where: {id_STARTS_WITH: "123"}) { - id + movies(where: {title_GTE: "The Matrix Revolutions"}) { + title } } ---- @@ -584,7 +584,7 @@ RETURN this { [source,json] ---- { - "param0" : "123" + "param0" : "The Matrix Revolutions" } ---- @@ -592,15 +592,15 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.id STARTS WITH $param0 +WHERE this.title >= $param0 RETURN this { - .id + .title } AS this ---- ''' -== Connections +== Relationships === List Predicates @@ -610,7 +610,7 @@ RETURN this { [source,graphql] ---- { - movies(where: {genresConnection_ALL: {node: {name: "some genre"}}}) { + movies(where: {genres_ALL: {name: "some genre"}}) { actorCount } } @@ -629,11 +629,11 @@ RETURN this { ---- MATCH (this:Movie) WHERE (EXISTS { - MATCH (this)-[edge:IN_GENRE]->(this0:Genre) + MATCH (this)-[:IN_GENRE]->(this0:Genre) WHERE this0.name = $param0 } AND NOT (EXISTS { - MATCH (this)-[edge:IN_GENRE]->(this0:Genre) + MATCH (this)-[:IN_GENRE]->(this0:Genre) WHERE NOT (this0.name = $param0) })) RETURN this { @@ -649,7 +649,7 @@ RETURN this { [source,graphql] ---- { - movies(where: {genresConnection_NONE: {node: {name: "some genre"}}}) { + movies(where: {genres_NONE: {name: "some genre"}}) { actorCount } } @@ -668,7 +668,7 @@ RETURN this { ---- MATCH (this:Movie) WHERE NOT (EXISTS { - MATCH (this)-[edge:IN_GENRE]->(this0:Genre) + MATCH (this)-[:IN_GENRE]->(this0:Genre) WHERE this0.name = $param0 }) RETURN this { @@ -684,7 +684,7 @@ RETURN this { [source,graphql] ---- { - movies(where: {genresConnection_SINGLE: {node: {name: "some genre"}}}) { + movies(where: {genres_SINGLE: {name: "some genre"}}) { actorCount } } @@ -702,7 +702,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE single(ignore IN [(this)-[edge:IN_GENRE]->(this0:Genre) +WHERE single(ignore IN [(this)-[:IN_GENRE]->(this0:Genre) WHERE this0.name = $param0 | 1] WHERE true) RETURN this { @@ -718,7 +718,7 @@ RETURN this { [source,graphql] ---- { - movies(where: {genresConnection_SOME: {node: {name: "some genre"}}}) { + movies(where: {genres_SOME: {name: "some genre"}}) { actorCount } } @@ -737,7 +737,7 @@ RETURN this { ---- MATCH (this:Movie) WHERE EXISTS { - MATCH (this)-[edge:IN_GENRE]->(this0:Genre) + MATCH (this)-[:IN_GENRE]->(this0:Genre) WHERE this0.name = $param0 } RETURN this { @@ -747,7 +747,7 @@ RETURN this { ''' -== Relationships +== Connections === List Predicates @@ -757,7 +757,7 @@ RETURN this { [source,graphql] ---- { - movies(where: {genres_ALL: {name: "some genre"}}) { + movies(where: {genresConnection_ALL: {node: {name: "some genre"}}}) { actorCount } } @@ -776,11 +776,11 @@ RETURN this { ---- MATCH (this:Movie) WHERE (EXISTS { - MATCH (this)-[:IN_GENRE]->(this0:Genre) + MATCH (this)-[edge:IN_GENRE]->(this0:Genre) WHERE this0.name = $param0 } AND NOT (EXISTS { - MATCH (this)-[:IN_GENRE]->(this0:Genre) + MATCH (this)-[edge:IN_GENRE]->(this0:Genre) WHERE NOT (this0.name = $param0) })) RETURN this { @@ -796,7 +796,7 @@ RETURN this { [source,graphql] ---- { - movies(where: {genres_NONE: {name: "some genre"}}) { + movies(where: {genresConnection_NONE: {node: {name: "some genre"}}}) { actorCount } } @@ -815,7 +815,7 @@ RETURN this { ---- MATCH (this:Movie) WHERE NOT (EXISTS { - MATCH (this)-[:IN_GENRE]->(this0:Genre) + MATCH (this)-[edge:IN_GENRE]->(this0:Genre) WHERE this0.name = $param0 }) RETURN this { @@ -831,7 +831,7 @@ RETURN this { [source,graphql] ---- { - movies(where: {genres_SINGLE: {name: "some genre"}}) { + movies(where: {genresConnection_SINGLE: {node: {name: "some genre"}}}) { actorCount } } @@ -849,7 +849,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE single(ignore IN [(this)-[:IN_GENRE]->(this0:Genre) +WHERE single(ignore IN [(this)-[edge:IN_GENRE]->(this0:Genre) WHERE this0.name = $param0 | 1] WHERE true) RETURN this { @@ -865,7 +865,7 @@ RETURN this { [source,graphql] ---- { - movies(where: {genres_SOME: {name: "some genre"}}) { + movies(where: {genresConnection_SOME: {node: {name: "some genre"}}}) { actorCount } } @@ -884,7 +884,7 @@ RETURN this { ---- MATCH (this:Movie) WHERE EXISTS { - MATCH (this)-[:IN_GENRE]->(this0:Genre) + MATCH (this)-[edge:IN_GENRE]->(this0:Genre) WHERE this0.name = $param0 } RETURN this { @@ -894,5 +894,3 @@ RETURN this { ''' - - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/arrays.adoc b/core/src/test/resources/tck-test-files/cypher/v2/arrays.adoc index fcfb5e72..d77dff8c 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/arrays.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/arrays.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher Arrays -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/alias.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/alias.adoc index 6ba1c898..58894e80 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/alias.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/alias.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Connections Alias -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/composite.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/composite.adoc index 653007e9..f4ec0d98 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/composite.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/composite.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Composite -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -188,7 +190,7 @@ RETURN this { ''' -== Composite NOT with complex nested filters +== Composite OR (edge and node) .GraphQL-Query [source,graphql] @@ -197,7 +199,7 @@ RETURN this { movies(where: {title: "Forrest Gump"}) { title actorsConnection( - where: {NOT: {AND: [{OR: [{node: {AND: [{firstName: "Tom"}, {lastName: "Hanks"}]}}, {edge: {AND: [{screenTime_GT: 30}, {screenTime_LT: 90}]}}]}, {node: {AND: [{firstName: "Tommy"}, {lastName: "Ford"}]}}]}} + where: {OR: [{node: {AND: [{firstName: "Tom"}, {lastName: "Hanks"}]}}, {edge: {AND: [{screenTime_GT: 30}, {screenTime_LT: 90}]}}]} ) { edges { properties { @@ -221,9 +223,7 @@ RETURN this { "param1" : "Tom", "param2" : "Hanks", "param3" : 30, - "param4" : 90, - "param5" : "Tommy", - "param6" : "Ford" + "param4" : 90 } ---- @@ -235,12 +235,10 @@ WHERE this.title = $param0 CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE NOT ((((actor0.firstName = $param1 - AND actor0.lastName = $param2) - OR (actedIn0.screenTime > $param3 - AND actedIn0.screenTime < $param4)) - AND actor0.firstName = $param5 - AND actor0.lastName = $param6)) + WHERE ((actor0.firstName = $param1 + AND actor0.lastName = $param2) + OR (actedIn0.screenTime > $param3 + AND actedIn0.screenTime < $param4)) WITH collect( { node: actor0, relationship: actedIn0 @@ -358,7 +356,7 @@ RETURN this { ''' -== Composite OR (edge and node) +== Composite NOT with complex nested filters .GraphQL-Query [source,graphql] @@ -367,7 +365,7 @@ RETURN this { movies(where: {title: "Forrest Gump"}) { title actorsConnection( - where: {OR: [{node: {AND: [{firstName: "Tom"}, {lastName: "Hanks"}]}}, {edge: {AND: [{screenTime_GT: 30}, {screenTime_LT: 90}]}}]} + where: {NOT: {AND: [{OR: [{node: {AND: [{firstName: "Tom"}, {lastName: "Hanks"}]}}, {edge: {AND: [{screenTime_GT: 30}, {screenTime_LT: 90}]}}]}, {node: {AND: [{firstName: "Tommy"}, {lastName: "Ford"}]}}]}} ) { edges { properties { @@ -391,7 +389,9 @@ RETURN this { "param1" : "Tom", "param2" : "Hanks", "param3" : 30, - "param4" : 90 + "param4" : 90, + "param5" : "Tommy", + "param6" : "Ford" } ---- @@ -403,10 +403,12 @@ WHERE this.title = $param0 CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE ((actor0.firstName = $param1 - AND actor0.lastName = $param2) - OR (actedIn0.screenTime > $param3 - AND actedIn0.screenTime < $param4)) + WHERE NOT ((((actor0.firstName = $param1 + AND actor0.lastName = $param2) + OR (actedIn0.screenTime > $param3 + AND actedIn0.screenTime < $param4)) + AND actor0.firstName = $param5 + AND actor0.lastName = $param6)) WITH collect( { node: actor0, relationship: actedIn0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/and.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/and.adoc index 596b7511..28441168 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/and.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/and.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Node -> AND -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/arrays.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/arrays.adoc index 5d1b7fc9..a74c8795 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/arrays.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/arrays.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Node -> Arrays -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/equality.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/equality.adoc index 10673beb..eca34db5 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/equality.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/equality.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Node -> Equality -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/numerical.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/numerical.adoc index 92cb889e..be835fbc 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/numerical.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/numerical.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Node -> Numerical -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -22,7 +24,7 @@ type ActedIn @relationshipProperties { } ---- -== GT +== LT .GraphQL-Query [source,graphql] @@ -30,7 +32,7 @@ type ActedIn @relationshipProperties { { movies { title - actorsConnection(where: {node: {age_GT: 60}}) { + actorsConnection(where: {node: {age_LT: 60}}) { edges { properties { screenTime @@ -60,7 +62,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actor0.age > $param0 + WHERE actor0.age < $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -95,7 +97,7 @@ RETURN this { ''' -== GTE +== LTE .GraphQL-Query [source,graphql] @@ -103,7 +105,7 @@ RETURN this { { movies { title - actorsConnection(where: {node: {age_GTE: 60}}) { + actorsConnection(where: {node: {age_LTE: 60}}) { edges { properties { screenTime @@ -133,7 +135,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actor0.age >= $param0 + WHERE actor0.age <= $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -168,7 +170,7 @@ RETURN this { ''' -== LT +== GT .GraphQL-Query [source,graphql] @@ -176,7 +178,7 @@ RETURN this { { movies { title - actorsConnection(where: {node: {age_LT: 60}}) { + actorsConnection(where: {node: {age_GT: 60}}) { edges { properties { screenTime @@ -206,7 +208,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actor0.age < $param0 + WHERE actor0.age > $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -241,7 +243,7 @@ RETURN this { ''' -== LTE +== GTE .GraphQL-Query [source,graphql] @@ -249,7 +251,7 @@ RETURN this { { movies { title - actorsConnection(where: {node: {age_LTE: 60}}) { + actorsConnection(where: {node: {age_GTE: 60}}) { edges { properties { screenTime @@ -279,7 +281,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actor0.age <= $param0 + WHERE actor0.age >= $param0 WITH collect( { node: actor0, relationship: actedIn0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/or.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/or.adoc index f454afba..9a5ad65a 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/or.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/or.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Node -> OR -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/points.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/points.adoc index d3519a74..5ca56fd6 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/points.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/points.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Node -> Points -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/string.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/string.adoc index bbc2ea8a..6e1cb911 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/string.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/node/string.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Node -> String -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -21,8 +23,6 @@ type ActedIn @relationshipProperties { } ---- -== Configuration - .Configuration [source,json,schema-config=true] ---- @@ -108,7 +108,7 @@ RETURN this { ''' -== ENDS_WITH +== STARTS_WITH .GraphQL-Query [source,graphql] @@ -116,7 +116,7 @@ RETURN this { { movies { title - actorsConnection(where: {node: {name_ENDS_WITH: "Hanks"}}) { + actorsConnection(where: {node: {name_STARTS_WITH: "Tom"}}) { edges { properties { screenTime @@ -134,7 +134,7 @@ RETURN this { [source,json] ---- { - "param0" : "Hanks" + "param0" : "Tom" } ---- @@ -145,7 +145,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actor0.name ENDS WITH $param0 + WHERE actor0.name STARTS WITH $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -179,7 +179,7 @@ RETURN this { ''' -== MATCHES +== ENDS_WITH .GraphQL-Query [source,graphql] @@ -187,7 +187,7 @@ RETURN this { { movies { title - actorsConnection(where: {node: {name_MATCHES: "Tom.+"}}) { + actorsConnection(where: {node: {name_ENDS_WITH: "Hanks"}}) { edges { properties { screenTime @@ -205,7 +205,7 @@ RETURN this { [source,json] ---- { - "param0" : "Tom.+" + "param0" : "Hanks" } ---- @@ -216,7 +216,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actor0.name =~ $param0 + WHERE actor0.name ENDS WITH $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -250,7 +250,7 @@ RETURN this { ''' -== STARTS_WITH +== MATCHES .GraphQL-Query [source,graphql] @@ -258,7 +258,7 @@ RETURN this { { movies { title - actorsConnection(where: {node: {name_STARTS_WITH: "Tom"}}) { + actorsConnection(where: {node: {name_MATCHES: "Tom.+"}}) { edges { properties { screenTime @@ -276,7 +276,7 @@ RETURN this { [source,json] ---- { - "param0" : "Tom" + "param0" : "Tom.+" } ---- @@ -287,7 +287,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actor0.name STARTS WITH $param0 + WHERE actor0.name =~ $param0 WITH collect( { node: actor0, relationship: actedIn0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/and.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/and.adoc index 3d861f66..9db428b8 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/and.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/and.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Relationship -> AND -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/arrays.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/arrays.adoc index fb742584..69731492 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/arrays.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/arrays.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Relationship -> Arrays -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/equality.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/equality.adoc index 28713567..c4105307 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/equality.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/equality.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Relationship -> Equality -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/numerical.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/numerical.adoc index 3c65a030..c1bd3fc9 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/numerical.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/numerical.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Relationship -> Numerical -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -21,7 +23,7 @@ type ActedIn @relationshipProperties { } ---- -== GT +== LT .GraphQL-Query [source,graphql] @@ -29,7 +31,7 @@ type ActedIn @relationshipProperties { { movies { title - actorsConnection(where: {edge: {screenTime_GT: 60}}) { + actorsConnection(where: {edge: {screenTime_LT: 60}}) { edges { properties { screenTime @@ -58,7 +60,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actedIn0.screenTime > $param0 + WHERE actedIn0.screenTime < $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -92,7 +94,7 @@ RETURN this { ''' -== GTE +== LTE .GraphQL-Query [source,graphql] @@ -100,7 +102,7 @@ RETURN this { { movies { title - actorsConnection(where: {edge: {screenTime_GTE: 60}}) { + actorsConnection(where: {edge: {screenTime_LTE: 60}}) { edges { properties { screenTime @@ -129,7 +131,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actedIn0.screenTime >= $param0 + WHERE actedIn0.screenTime <= $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -163,7 +165,7 @@ RETURN this { ''' -== LT +== GT .GraphQL-Query [source,graphql] @@ -171,7 +173,7 @@ RETURN this { { movies { title - actorsConnection(where: {edge: {screenTime_LT: 60}}) { + actorsConnection(where: {edge: {screenTime_GT: 60}}) { edges { properties { screenTime @@ -200,7 +202,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actedIn0.screenTime < $param0 + WHERE actedIn0.screenTime > $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -234,7 +236,7 @@ RETURN this { ''' -== LTE +== GTE .GraphQL-Query [source,graphql] @@ -242,7 +244,7 @@ RETURN this { { movies { title - actorsConnection(where: {edge: {screenTime_LTE: 60}}) { + actorsConnection(where: {edge: {screenTime_GTE: 60}}) { edges { properties { screenTime @@ -271,7 +273,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actedIn0.screenTime <= $param0 + WHERE actedIn0.screenTime >= $param0 WITH collect( { node: actor0, relationship: actedIn0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/or.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/or.adoc index 6e32ca15..bca493c1 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/or.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/or.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Relationship -> OR -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/points.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/points.adoc index c83f6a62..2faecba8 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/points.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/points.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Relationship -> Points -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/string.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/string.adoc index b3821e96..55249d57 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/string.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/string.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Relationship -> String -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -22,8 +24,6 @@ type ActedIn @relationshipProperties { } ---- -== Configuration - .Configuration [source,json,schema-config=true] ---- @@ -109,7 +109,7 @@ RETURN this { ''' -== ENDS_WITH +== STARTS_WITH .GraphQL-Query [source,graphql] @@ -117,7 +117,7 @@ RETURN this { { movies { title - actorsConnection(where: {edge: {role_ENDS_WITH: "Gump"}}) { + actorsConnection(where: {edge: {role_STARTS_WITH: "Forrest"}}) { edges { properties { role @@ -135,7 +135,7 @@ RETURN this { [source,json] ---- { - "param0" : "Gump" + "param0" : "Forrest" } ---- @@ -146,7 +146,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actedIn0.role ENDS WITH $param0 + WHERE actedIn0.role STARTS WITH $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -180,7 +180,7 @@ RETURN this { ''' -== MATCHES +== ENDS_WITH .GraphQL-Query [source,graphql] @@ -188,7 +188,7 @@ RETURN this { { movies { title - actorsConnection(where: {edge: {role_MATCHES: "Forrest.+"}}) { + actorsConnection(where: {edge: {role_ENDS_WITH: "Gump"}}) { edges { properties { role @@ -206,7 +206,7 @@ RETURN this { [source,json] ---- { - "param0" : "Forrest.+" + "param0" : "Gump" } ---- @@ -217,7 +217,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actedIn0.role =~ $param0 + WHERE actedIn0.role ENDS WITH $param0 WITH collect( { node: actor0, relationship: actedIn0 @@ -251,7 +251,7 @@ RETURN this { ''' -== STARTS_WITH +== MATCHES .GraphQL-Query [source,graphql] @@ -259,7 +259,7 @@ RETURN this { { movies { title - actorsConnection(where: {edge: {role_STARTS_WITH: "Forrest"}}) { + actorsConnection(where: {edge: {role_MATCHES: "Forrest.+"}}) { edges { properties { role @@ -277,7 +277,7 @@ RETURN this { [source,json] ---- { - "param0" : "Forrest" + "param0" : "Forrest.+" } ---- @@ -288,7 +288,7 @@ MATCH (this:Movie) CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actedIn0.role STARTS WITH $param0 + WHERE actedIn0.role =~ $param0 WITH collect( { node: actor0, relationship: actedIn0 diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/temporal.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/temporal.adoc index 737b5b84..db1c857c 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/temporal.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/filtering/relationship/temporal.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Filtering -> Relationship -> Temporal -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/interfaces.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/interfaces.adoc index 82108c86..4fd89db6 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/interfaces.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/interfaces.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Interfaces -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Production { @@ -30,7 +32,7 @@ type Actor { } ---- -== Projecting interface node and relationship properties with common where argument +== Projecting interface node and relationship properties with no arguments .GraphQL-Query [source,graphql] @@ -38,7 +40,7 @@ type Actor { { actors { name - actedInConnection(where: {node: {title_STARTS_WITH: "The "}}) { + actedInConnection { edges { properties { screenTime @@ -61,10 +63,7 @@ type Actor { .Expected Cypher params [source,json] ---- -{ - "param0" : "The ", - "param1" : "The " -} +{ } ---- .Expected Cypher output @@ -76,7 +75,6 @@ CALL { CALL { WITH this MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) - WHERE movie0.title STARTS WITH $param0 WITH { properties: { __typename: 'ActedIn', @@ -92,7 +90,6 @@ CALL { RETURN edge UNION WITH this MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) - WHERE series0.title STARTS WITH $param1 WITH { properties: { __typename: 'ActedIn', @@ -122,7 +119,7 @@ RETURN this { ''' -== Projecting interface node and relationship properties with no arguments +== Projecting interface node and relationship properties with common where argument .GraphQL-Query [source,graphql] @@ -130,7 +127,7 @@ RETURN this { { actors { name - actedInConnection { + actedInConnection(where: {node: {title_STARTS_WITH: "The "}}) { edges { properties { screenTime @@ -153,7 +150,10 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ } +{ + "param0" : "The ", + "param1" : "The " +} ---- .Expected Cypher output @@ -165,6 +165,7 @@ CALL { CALL { WITH this MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WHERE movie0.title STARTS WITH $param0 WITH { properties: { __typename: 'ActedIn', @@ -180,6 +181,7 @@ CALL { RETURN edge UNION WITH this MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WHERE series0.title STARTS WITH $param1 WITH { properties: { __typename: 'ActedIn', @@ -675,5 +677,3 @@ RETURN this { ''' - - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/projections/projections.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/projections/projections.adoc index 479ee29c..db13b1c8 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/projections/projections.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/projections/projections.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Relay Cursor Connection projections -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- union Production = Movie | Series @@ -24,7 +26,7 @@ type Actor { } ---- -== edges and totalCount returned if pageInfo asked for +== edges not returned if not asked for .GraphQL-Query [source,graphql] @@ -33,12 +35,7 @@ type Actor { movies(where: {title: "Forrest Gump"}) { title actorsConnection { - pageInfo { - startCursor - endCursor - hasNextPage - hasPreviousPage - } + totalCount } } } @@ -89,15 +86,15 @@ RETURN this { ''' -== edges and totalCount returned if pageInfo asked for on a union +== edges and totalCount returned if pageInfo asked for .GraphQL-Query [source,graphql] ---- { - actors(where: {name: "Tom Hanks"}) { - name - productionsConnection { + movies(where: {title: "Forrest Gump"}) { + title + actorsConnection { pageInfo { startCursor endCursor @@ -113,53 +110,48 @@ RETURN this { [source,json] ---- { - "param0" : "Tom Hanks" + "param0" : "Forrest Gump" } ---- .Expected Cypher output [source,cypher] ---- -MATCH (this:Actor) -WHERE this.name = $param0 +MATCH (this:Movie) +WHERE this.title = $param0 CALL { WITH this + MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: actor0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount CALL { - WITH this - MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) - WITH { - node: { - __id: elementId(movie0), - __typename: 'Movie' - } - } AS edge - RETURN edge UNION - WITH this - MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) - WITH { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor0, edge.relationship AS actedIn0 + RETURN collect( { node: { - __id: elementId(series0), - __typename: 'Series' + __id: elementId(actor0), + __typename: 'Actor' } - } AS edge - RETURN edge + }) AS actorsConnectionEdges } - WITH collect(edge) AS edges - WITH edges, size(edges) AS totalCount RETURN { - edges: edges, + edges: actorsConnectionEdges, totalCount: totalCount - } AS productionsConnection + } AS actorsConnection } RETURN this { - .name, - productionsConnection: productionsConnection + .title, + actorsConnection: actorsConnection } AS this ---- ''' -== edges not returned if not asked for +== Minimal edges returned if not asked for with pagination arguments .GraphQL-Query [source,graphql] @@ -167,7 +159,7 @@ RETURN this { { movies(where: {title: "Forrest Gump"}) { title - actorsConnection { + actorsConnection(first: 5) { totalCount } } @@ -178,7 +170,8 @@ RETURN this { [source,json] ---- { - "param0" : "Forrest Gump" + "param0" : "Forrest Gump", + "param1" : 5 } ---- @@ -198,7 +191,7 @@ CALL { CALL { WITH edges UNWIND edges AS edge - WITH edge.node AS actor0, edge.relationship AS actedIn0 + WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 RETURN collect( { node: { __id: elementId(actor0), @@ -284,16 +277,21 @@ RETURN this { ''' -== Minimal edges returned if not asked for with pagination arguments +== edges and totalCount returned if pageInfo asked for on a union .GraphQL-Query [source,graphql] ---- { - movies(where: {title: "Forrest Gump"}) { - title - actorsConnection(first: 5) { - totalCount + actors(where: {name: "Tom Hanks"}) { + name + productionsConnection { + pageInfo { + startCursor + endCursor + hasNextPage + hasPreviousPage + } } } } @@ -303,43 +301,47 @@ RETURN this { [source,json] ---- { - "param0" : "Forrest Gump", - "param1" : 5 + "param0" : "Tom Hanks" } ---- .Expected Cypher output [source,cypher] ---- -MATCH (this:Movie) -WHERE this.title = $param0 +MATCH (this:Actor) +WHERE this.name = $param0 CALL { WITH this - MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WITH collect( { - node: actor0, - relationship: actedIn0 - }) AS edges - WITH edges, size(edges) AS totalCount CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS actor0, edge.relationship AS actedIn0 LIMIT $param1 - RETURN collect( { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { node: { - __id: elementId(actor0), - __typename: 'Actor' + __id: elementId(movie0), + __typename: 'Movie' } - }) AS actorsConnectionEdges + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + node: { + __id: elementId(series0), + __typename: 'Series' + } + } AS edge + RETURN edge } + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount RETURN { - edges: actorsConnectionEdges, + edges: edges, totalCount: totalCount - } AS actorsConnection + } AS productionsConnection } RETURN this { - .title, - actorsConnection: actorsConnection + .name, + productionsConnection: productionsConnection } AS this ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/relationship-properties.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/relationship-properties.adoc index 664710bf..0d6bea47 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/relationship-properties.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/relationship-properties.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Relationship Properties Cypher -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -93,7 +95,7 @@ RETURN this { ''' -== Projecting node and relationship properties with sort argument +== Projecting node and relationship properties with where argument .GraphQL-Query [source,graphql] @@ -101,7 +103,7 @@ RETURN this { { movies(where: {title: "Forrest Gump"}) { title - actorsConnection(sort: {edge: {screenTime: DESC}}) { + actorsConnection(where: {node: {name: "Tom Hanks"}}) { edges { properties { screenTime @@ -119,7 +121,8 @@ RETURN this { [source,json] ---- { - "param0" : "Forrest Gump" + "param0" : "Forrest Gump", + "param1" : "Tom Hanks" } ---- @@ -131,6 +134,7 @@ WHERE this.title = $param0 CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) + WHERE actor0.name = $param1 WITH collect( { node: actor0, relationship: actedIn0 @@ -139,7 +143,7 @@ CALL { CALL { WITH edges UNWIND edges AS edge - WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actedIn0.screenTime DESC + WITH edge.node AS actor0, edge.relationship AS actedIn0 RETURN collect( { properties: { __typename: 'ActedIn', @@ -164,17 +168,18 @@ RETURN this { ''' -== Projecting node and relationship properties with sort argument ordered edge first +== Projecting node and relationship properties with sort argument .GraphQL-Query [source,graphql] ---- { - movies { - actorsConnection(sort: [{edge: {year: DESC}}, {node: {name: ASC}}]) { + movies(where: {title: "Forrest Gump"}) { + title + actorsConnection(sort: {edge: {screenTime: DESC}}) { edges { properties { - year + screenTime } node { name @@ -188,13 +193,16 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ } +{ + "param0" : "Forrest Gump" +} ---- .Expected Cypher output [source,cypher] ---- MATCH (this:Movie) +WHERE this.title = $param0 CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) @@ -206,11 +214,11 @@ CALL { CALL { WITH edges UNWIND edges AS edge - WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actedIn0.year DESC, actor0.name ASC + WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actedIn0.screenTime DESC RETURN collect( { properties: { __typename: 'ActedIn', - year: actedIn0.year + screenTime: actedIn0.screenTime }, node: { __typename: 'Actor', @@ -224,20 +232,21 @@ CALL { } AS actorsConnection } RETURN this { + .title, actorsConnection: actorsConnection } AS this ---- ''' -== Projecting node and relationship properties with sort argument ordered node first +== Projecting node and relationship properties with sort argument ordered edge first .GraphQL-Query [source,graphql] ---- { movies { - actorsConnection(sort: [{node: {name: ASC}}, {edge: {year: DESC}}]) { + actorsConnection(sort: [{edge: {year: DESC}}, {node: {name: ASC}}]) { edges { properties { year @@ -272,7 +281,7 @@ CALL { CALL { WITH edges UNWIND edges AS edge - WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actor0.name ASC, actedIn0.year DESC + WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actedIn0.year DESC, actor0.name ASC RETURN collect( { properties: { __typename: 'ActedIn', @@ -296,18 +305,17 @@ RETURN this { ''' -== Projecting node and relationship properties with where argument +== Projecting node and relationship properties with sort argument ordered node first .GraphQL-Query [source,graphql] ---- { - movies(where: {title: "Forrest Gump"}) { - title - actorsConnection(where: {node: {name: "Tom Hanks"}}) { + movies { + actorsConnection(sort: [{node: {name: ASC}}, {edge: {year: DESC}}]) { edges { properties { - screenTime + year } node { name @@ -321,21 +329,16 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ - "param0" : "Forrest Gump", - "param1" : "Tom Hanks" -} +{ } ---- .Expected Cypher output [source,cypher] ---- MATCH (this:Movie) -WHERE this.title = $param0 CALL { WITH this MATCH (actor0:Actor)-[actedIn0:ACTED_IN]->(this) - WHERE actor0.name = $param1 WITH collect( { node: actor0, relationship: actedIn0 @@ -344,11 +347,11 @@ CALL { CALL { WITH edges UNWIND edges AS edge - WITH edge.node AS actor0, edge.relationship AS actedIn0 + WITH edge.node AS actor0, edge.relationship AS actedIn0 ORDER BY actor0.name ASC, actedIn0.year DESC RETURN collect( { properties: { __typename: 'ActedIn', - screenTime: actedIn0.screenTime + year: actedIn0.year }, node: { __typename: 'Actor', @@ -362,14 +365,13 @@ CALL { } AS actorsConnection } RETURN this { - .title, actorsConnection: actorsConnection } AS this ---- ''' -== Projecting thrice nested node and relationship properties with no arguments +== Projecting twice nested node and relationship properties with no arguments .GraphQL-Query [source,graphql] @@ -391,16 +393,6 @@ RETURN this { } node { title - actorsConnection { - edges { - properties { - screenTime - } - node { - name - } - } - } } } } @@ -448,34 +440,6 @@ CALL { WITH edges UNWIND edges AS edge WITH edge.node AS movie0, edge.relationship AS actedIn1 - CALL { - WITH movie0 - MATCH (actor1:Actor)-[actedIn2:ACTED_IN]->(movie0) - WITH collect( { - node: actor1, - relationship: actedIn2 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS actor1, edge.relationship AS actedIn2 - RETURN collect( { - properties: { - __typename: 'ActedIn', - screenTime: actedIn2.screenTime - }, - node: { - __typename: 'Actor', - name: actor1.name - } - }) AS actorsConnectionEdges - } - RETURN { - edges: actorsConnectionEdges, - totalCount: totalCount - } AS actorsConnection - } RETURN collect( { properties: { __typename: 'ActedIn', @@ -483,8 +447,7 @@ CALL { }, node: { __typename: 'Movie', - title: movie0.title, - actorsConnection: actorsConnection + title: movie0.title } }) AS moviesConnectionEdges } @@ -518,7 +481,7 @@ RETURN this { ''' -== Projecting twice nested node and relationship properties with no arguments +== Projecting thrice nested node and relationship properties with no arguments .GraphQL-Query [source,graphql] @@ -540,6 +503,16 @@ RETURN this { } node { title + actorsConnection { + edges { + properties { + screenTime + } + node { + name + } + } + } } } } @@ -587,6 +560,34 @@ CALL { WITH edges UNWIND edges AS edge WITH edge.node AS movie0, edge.relationship AS actedIn1 + CALL { + WITH movie0 + MATCH (actor1:Actor)-[actedIn2:ACTED_IN]->(movie0) + WITH collect( { + node: actor1, + relationship: actedIn2 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS actor1, edge.relationship AS actedIn2 + RETURN collect( { + properties: { + __typename: 'ActedIn', + screenTime: actedIn2.screenTime + }, + node: { + __typename: 'Actor', + name: actor1.name + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection + } RETURN collect( { properties: { __typename: 'ActedIn', @@ -594,7 +595,8 @@ CALL { }, node: { __typename: 'Movie', - title: movie0.title + title: movie0.title, + actorsConnection: actorsConnection } }) AS moviesConnectionEdges } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/connections/unions.adoc b/core/src/test/resources/tck-test-files/cypher/v2/connections/unions.adoc index e03e54d5..fa31a2c3 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/connections/unions.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/connections/unions.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher -> Connections -> Unions -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- union Publication = Book | Journal @@ -112,7 +114,7 @@ RETURN this { ''' -== Projecting union node and relationship properties with sort argument +== Projecting union node and relationship properties with where argument .GraphQL-Query [source,graphql] @@ -120,7 +122,9 @@ RETURN this { { authors { name - publicationsConnection(sort: [{edge: {words: ASC}}]) { + publicationsConnection( + where: {Book: {node: {title: "Book Title"}}, Journal: {node: {subject: "Journal Subject"}}} + ) { edges { properties { words @@ -142,7 +146,10 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ } +{ + "param0" : "Book Title", + "param1" : "Journal Subject" +} ---- .Expected Cypher output @@ -154,6 +161,7 @@ CALL { CALL { WITH this MATCH (this)-[wrote0:WROTE]->(book0:Book) + WHERE book0.title = $param0 WITH { properties: { __typename: 'Wrote', @@ -168,6 +176,7 @@ CALL { RETURN edge UNION WITH this MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WHERE journal0.subject = $param1 WITH { properties: { __typename: 'Wrote', @@ -183,14 +192,8 @@ CALL { } WITH collect(edge) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge ORDER BY edge.properties.words ASC - RETURN collect(edge) AS sortedEdges0 - } RETURN { - edges: sortedEdges0, + edges: edges, totalCount: totalCount } AS publicationsConnection } @@ -202,7 +205,7 @@ RETURN this { ''' -== Projecting union node and relationship properties with where argument +== Projecting union node and relationship properties with where relationship argument .GraphQL-Query [source,graphql] @@ -211,7 +214,7 @@ RETURN this { authors { name publicationsConnection( - where: {Book: {node: {title: "Book Title"}}, Journal: {node: {subject: "Journal Subject"}}} + where: {Book: {edge: {words: 1000}}, Journal: {edge: {words: 2000}}} ) { edges { properties { @@ -235,8 +238,8 @@ RETURN this { [source,json] ---- { - "param0" : "Book Title", - "param1" : "Journal Subject" + "param0" : 1000, + "param1" : 2000 } ---- @@ -249,7 +252,7 @@ CALL { CALL { WITH this MATCH (this)-[wrote0:WROTE]->(book0:Book) - WHERE book0.title = $param0 + WHERE wrote0.words = $param0 WITH { properties: { __typename: 'Wrote', @@ -264,7 +267,7 @@ CALL { RETURN edge UNION WITH this MATCH (this)-[wrote1:WROTE]->(journal0:Journal) - WHERE journal0.subject = $param1 + WHERE wrote1.words = $param1 WITH { properties: { __typename: 'Wrote', @@ -388,7 +391,7 @@ RETURN this { ''' -== Projecting union node and relationship properties with where relationship argument +== Projecting union node and relationship properties with sort argument .GraphQL-Query [source,graphql] @@ -396,9 +399,7 @@ RETURN this { { authors { name - publicationsConnection( - where: {Book: {edge: {words: 1000}}, Journal: {edge: {words: 2000}}} - ) { + publicationsConnection(sort: [{edge: {words: ASC}}]) { edges { properties { words @@ -420,10 +421,7 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ - "param0" : 1000, - "param1" : 2000 -} +{ } ---- .Expected Cypher output @@ -435,7 +433,6 @@ CALL { CALL { WITH this MATCH (this)-[wrote0:WROTE]->(book0:Book) - WHERE wrote0.words = $param0 WITH { properties: { __typename: 'Wrote', @@ -450,7 +447,6 @@ CALL { RETURN edge UNION WITH this MATCH (this)-[wrote1:WROTE]->(journal0:Journal) - WHERE wrote1.words = $param1 WITH { properties: { __typename: 'Wrote', @@ -466,8 +462,14 @@ CALL { } WITH collect(edge) AS edges WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge ORDER BY edge.properties.words ASC + RETURN collect(edge) AS sortedEdges0 + } RETURN { - edges: edges, + edges: sortedEdges0, totalCount: totalCount } AS publicationsConnection } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/alias.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/alias.adoc index 910e1ace..48377674 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/alias.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/alias.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher alias directive -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Actor { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce.adoc new file mode 100644 index 00000000..25bce5af --- /dev/null +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce.adoc @@ -0,0 +1,245 @@ +:toc: +:toclevels: 42 + += Cypher coalesce() + +== Coalesce with enum in match + +.Schema +[source,graphql,schema=true] +---- +enum Status { + ACTIVE + INACTIVE +} + +type Movie { + id: ID + status: Status @coalesce(value: ACTIVE) +} +---- + +.Configuration +[source,json,schema-config=true] +---- +{ + "features": { + "filters": { + "String": { + "MATCHES": true + } + } + } +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + movies(where: {status: ACTIVE}) { + id + status + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "ACTIVE" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE coalesce(this.status, 'ACTIVE') = $param0 +RETURN this { + .id, + .status +} AS this +---- + +''' + +== Coalesce with enum in projection + +.Schema +[source,graphql,schema=true] +---- +enum Status { + ACTIVE + INACTIVE +} + +type Movie { + id: ID + status: Status @coalesce(value: ACTIVE) +} + +type Actor { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Configuration +[source,json,schema-config=true] +---- +{ + "features": { + "filters": { + "String": { + "MATCHES": true + } + } + } +} +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors { + actors { + moviesConnection(where: {node: {status: ACTIVE}}) { + edges { + node { + id + status + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "ACTIVE" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WHERE coalesce(movie0.status, 'ACTIVE') = $param0 + WITH collect( { + node: movie0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS movie0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __typename: 'Movie', + id: movie0.id, + status: movie0.status + } + }) AS moviesConnectionEdges + } + RETURN { + edges: moviesConnectionEdges, + totalCount: totalCount + } AS moviesConnection +} +RETURN this { + moviesConnection: moviesConnection +} AS this +---- + +''' + +== Coalesce with enum list in projection + +.Schema +[source,graphql,schema=true] +---- +enum Status { + ACTIVE + INACTIVE +} + +type Movie { + id: ID + statuses: [Status!]! @coalesce(value: [ACTIVE, INACTIVE]) +} + +type Actor { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors { + actors { + moviesConnection(where: {node: {statuses: [ACTIVE, INACTIVE]}}) { + edges { + node { + id + statuses + } + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : [ "ACTIVE", "INACTIVE" ] +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WHERE coalesce(movie0.statuses, ['ACTIVE', 'INACTIVE']) = $param0 + WITH collect( { + node: movie0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS movie0, edge.relationship AS actedIn0 + RETURN collect( { + node: { + __typename: 'Movie', + id: movie0.id, + statuses: movie0.statuses + } + }) AS moviesConnectionEdges + } + RETURN { + edges: moviesConnectionEdges, + totalCount: totalCount + } AS moviesConnection +} +RETURN this { + moviesConnection: moviesConnection +} AS this +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_1.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_1.adoc deleted file mode 100644 index da3861b0..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_1.adoc +++ /dev/null @@ -1,69 +0,0 @@ -:toc: - -= Cypher coalesce() - -== Source schema - -[source,graphql,schema=true] ----- -enum Status { - ACTIVE - INACTIVE -} - -type Movie { - id: ID - status: Status @coalesce(value: ACTIVE) -} ----- - -== Configuration - -.Configuration -[source,json,schema-config=true] ----- -{ - "features": { - "filters": { - "String": { - "MATCHES": true - } - } - } -} ----- - -== Coalesce with enum in match - -.GraphQL-Query -[source,graphql] ----- -{ - movies(where: {status: ACTIVE}) { - id - status - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ - "param0" : "ACTIVE" -} ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Movie) -WHERE coalesce(this.status, 'ACTIVE') = $param0 -RETURN this { - .id, - .status -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_2.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_2.adoc deleted file mode 100644 index 5b91ab6b..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_2.adoc +++ /dev/null @@ -1,103 +0,0 @@ -:toc: - -= Cypher coalesce() - -== Source schema - -[source,graphql,schema=true] ----- -enum Status { - ACTIVE - INACTIVE -} - -type Movie { - id: ID - status: Status @coalesce(value: ACTIVE) -} - -type Actor { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} ----- - -== Configuration - -.Configuration -[source,json,schema-config=true] ----- -{ - "features": { - "filters": { - "String": { - "MATCHES": true - } - } - } -} ----- - -== Coalesce with enum in projection - -.GraphQL-Query -[source,graphql] ----- -query Actors { - actors { - moviesConnection(where: {node: {status: ACTIVE}}) { - edges { - node { - id - status - } - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ - "param0" : "ACTIVE" -} ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Actor) -CALL { - WITH this - MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) - WHERE coalesce(movie0.status, 'ACTIVE') = $param0 - WITH collect( { - node: movie0, - relationship: actedIn0 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS movie0, edge.relationship AS actedIn0 - RETURN collect( { - node: { - __typename: 'Movie', - id: movie0.id, - status: movie0.status - } - }) AS moviesConnectionEdges - } - RETURN { - edges: moviesConnectionEdges, - totalCount: totalCount - } AS moviesConnection -} -RETURN this { - moviesConnection: moviesConnection -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_3.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_3.adoc deleted file mode 100644 index 62571288..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/coalesce_3.adoc +++ /dev/null @@ -1,87 +0,0 @@ -:toc: - -= Cypher coalesce() - -== Source schema - -[source,graphql,schema=true] ----- -enum Status { - ACTIVE - INACTIVE -} - -type Movie { - id: ID - statuses: [Status!]! @coalesce(value: [ACTIVE, INACTIVE]) -} - -type Actor { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} ----- - -== Coalesce with enum list in projection - -.GraphQL-Query -[source,graphql] ----- -query Actors { - actors { - moviesConnection(where: {node: {statuses: [ACTIVE, INACTIVE]}}) { - edges { - node { - id - statuses - } - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ - "param0" : [ "ACTIVE", "INACTIVE" ] -} ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Actor) -CALL { - WITH this - MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) - WHERE coalesce(movie0.statuses, ['ACTIVE', 'INACTIVE']) = $param0 - WITH collect( { - node: movie0, - relationship: actedIn0 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS movie0, edge.relationship AS actedIn0 - RETURN collect( { - node: { - __typename: 'Movie', - id: movie0.id, - statuses: movie0.statuses - } - }) AS moviesConnectionEdges - } - RETURN { - edges: moviesConnectionEdges, - totalCount: totalCount - } AS moviesConnection -} -RETURN this { - moviesConnection: moviesConnection -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver.adoc new file mode 100644 index 00000000..0b59755b --- /dev/null +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver.adoc @@ -0,0 +1,893 @@ +:toc: +:toclevels: 42 + += @customResolver directive + +== Require fields on same type + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type User { + firstName: String! + lastName: String! + fullName: String! @customResolver(requires: "firstName lastName") +} +---- + +=== should not fetch required fields if @customResolver field is not selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + firstName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +RETURN this { + .firstName +} AS this +---- + +''' + +=== should not over fetch when all required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + firstName + lastName + fullName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +RETURN this { + .firstName, + .lastName +} AS this +---- + +''' + +=== should not over fetch when some required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + firstName + fullName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +RETURN this { + .firstName, + .lastName +} AS this +---- + +''' + +=== should not over fetch when no required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + fullName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +RETURN this { + .firstName, + .lastName +} AS this +---- + +''' + +== No required fields + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type User { + firstName: String! + lastName: String! + fullName: String! @customResolver +} +---- + +=== should not over fetch when other fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + firstName + fullName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +RETURN this { + .firstName +} AS this +---- + +''' + +=== should not over fetch when no other fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + fullName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +RETURN this { +} AS this +---- + +''' + +== Require fields on nested types + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +type City { + name: String! + population: Int +} + +type Address { + street: String! + city: City! @relationship(type: "IN_CITY", direction: OUT) +} + +type User { + id: ID! + firstName: String! + lastName: String! + address: Address @relationship(type: "LIVES_AT", direction: OUT) + fullName: String @customResolver(requires: "firstName lastName address { city { name population } }") +} +---- + +=== should not over fetch when all required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + firstName + lastName + fullName + address { + city { + name + population + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + CALL { + WITH address0 + MATCH (address0)-[inCity0:IN_CITY]->(city0:City) + WITH city0 { + .name, + .population + } AS city + RETURN head(collect(city)) AS city + } + WITH address0 { + city: city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + .firstName, + .lastName, + address: address +} AS this +---- + +''' + +=== should not fetch required fields if @customResolver field is not selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + firstName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +RETURN this { + .firstName +} AS this +---- + +''' + +=== should not over fetch when some required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + lastName + fullName + address { + city { + population + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + CALL { + WITH address0 + MATCH (address0)-[inCity0:IN_CITY]->(city0:City) + WITH city0 { + .population, + .name + } AS city + RETURN head(collect(city)) AS city + } + WITH address0 { + city: city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + .lastName, + address: address, + .firstName +} AS this +---- + +''' + +=== should not over fetch when no required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + users { + fullName + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) + CALL { + WITH address0 + MATCH (address0)-[inCity0:IN_CITY]->(city0:City) + WITH city0 { + .name, + .population + } AS city + RETURN head(collect(city)) AS city + } + WITH address0 { + city: city + } AS address + RETURN head(collect(address)) AS address +} +RETURN this { + .firstName, + .lastName, + address: address +} AS this +---- + +''' + +== Require fields on nested unions + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +union Publication = Book | Journal + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) + publicationsWithAuthor: [String!]! @customResolver(requires: "name publications { ...on Book { title } ... on Journal { subject } }") +} + +type Book { + title: String! + author: Author! @relationship(type: "WROTE", direction: IN) +} + +type Journal { + subject: String! + author: Author! @relationship(type: "WROTE", direction: IN) +} +---- + +=== should not over fetch when all required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + authors { + name + publicationsWithAuthor + publications { + ... on Book { + title + } + ... on Journal { + subject + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title + } AS book0 + RETURN book0 AS publications0 UNION + WITH * + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject + } AS journal0 + RETURN journal0 AS publications0 + } + WITH publications0 + RETURN collect(publications0) AS publications0 +} +RETURN this { + .name, + publications: publications0 +} AS this +---- + +''' + +=== should not fetch required fields if @customResolver field is not selected + +.GraphQL-Query +[source,graphql] +---- +{ + authors { + name + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +RETURN this { + .name +} AS this +---- + +''' + +=== should not over fetch when some required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + authors { + publicationsWithAuthor + publications { + ... on Book { + title + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title + } AS book0 + RETURN book0 AS publications0 UNION + WITH * + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject + } AS journal0 + RETURN journal0 AS publications0 + } + WITH publications0 + RETURN collect(publications0) AS publications0 +} +RETURN this { + publications: publications0, + .name +} AS this +---- + +''' + +=== should not over fetch when no required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + authors { + publicationsWithAuthor + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title + } AS book0 + RETURN book0 AS publications0 UNION + WITH * + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject + } AS journal0 + RETURN journal0 AS publications0 + } + WITH publications0 + RETURN collect(publications0) AS publications0 +} +RETURN this { + .name, + publications: publications0 +} AS this +---- + +''' + +== Require fields on nested interfaces + +=== Setup + +.Schema +[source,graphql,schema=true] +---- +interface Publication { + publicationYear: Int! +} + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) + publicationsWithAuthor: [String!]! @customResolver(requires: "name publications { publicationYear ...on Book { title } ... on Journal { subject } }") +} + +type Book implements Publication { + title: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} + +type Journal implements Publication { + subject: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} +---- + +=== should not over fetch when all required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + authors { + name + publicationsWithAuthor + publications { + publicationYear + ... on Book { + title + } + ... on Journal { + subject + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .publicationYear, + .title + } AS book0 + RETURN book0 AS publications UNION + WITH * + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .publicationYear, + .subject + } AS journal0 + RETURN journal0 AS publications + } + WITH publications + RETURN collect(publications) AS publications +} +RETURN this { + .name, + publications: publications +} AS this +---- + +''' + +=== should not fetch required fields if @customResolver field is not selected + +.GraphQL-Query +[source,graphql] +---- +{ + authors { + name + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +RETURN this { + .name +} AS this +---- + +''' + +=== should not over fetch when some required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + authors { + publicationsWithAuthor + publications { + ... on Book { + title + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title, + .publicationYear + } AS book0 + RETURN book0 AS publications UNION + WITH * + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject, + .publicationYear + } AS journal0 + RETURN journal0 AS publications + } + WITH publications + RETURN collect(publications) AS publications +} +RETURN this { + publications: publications, + .name +} AS this +---- + +''' + +=== should not over fetch when no required fields are manually selected + +.GraphQL-Query +[source,graphql] +---- +{ + authors { + publicationsWithAuthor + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Author) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[wrote0:WROTE]->(book0:Book) + WITH book0 { + __typename: 'Book', + __id: elementId(book0), + .title, + .publicationYear + } AS book0 + RETURN book0 AS publications UNION + WITH * + MATCH (this)-[wrote1:WROTE]->(journal0:Journal) + WITH journal0 { + __typename: 'Journal', + __id: elementId(journal0), + .subject, + .publicationYear + } AS journal0 + RETURN journal0 AS publications + } + WITH publications + RETURN collect(publications) AS publications +} +RETURN this { + .name, + publications: publications +} AS this +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_no-required-fields.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_no-required-fields.adoc deleted file mode 100644 index c27a4adc..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_no-required-fields.adoc +++ /dev/null @@ -1,73 +0,0 @@ -:toc: - -= No required fields - -== Source schema - -[source,graphql,schema=true] ----- -type User { - firstName: String! - lastName: String! - fullName: String! @customResolver -} ----- - -== should not over fetch when no other fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - fullName - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -RETURN this { -} AS this ----- - -''' - -== should not over fetch when other fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - firstName - fullName - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -RETURN this { - .firstName -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-interfaces.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-interfaces.adoc deleted file mode 100644 index 5bc912c5..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-interfaces.adoc +++ /dev/null @@ -1,236 +0,0 @@ -:toc: - -= Require fields on nested interfaces - -== Source schema - -[source,graphql,schema=true] ----- -interface Publication { - publicationYear: Int! -} - -type Author { - name: String! - publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) - publicationsWithAuthor: [String!]! @customResolver(requires: "name publications { publicationYear ...on Book { title } ... on Journal { subject } }") -} - -type Book implements Publication { - title: String! - publicationYear: Int! - author: [Author!]! @relationship(type: "WROTE", direction: IN) -} - -type Journal implements Publication { - subject: String! - publicationYear: Int! - author: [Author!]! @relationship(type: "WROTE", direction: IN) -} ----- - -== should not fetch required fields if @customResolver field is not selected - -.GraphQL-Query -[source,graphql] ----- -{ - authors { - name - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Author) -RETURN this { - .name -} AS this ----- - -''' - -== should not over fetch when all required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - authors { - name - publicationsWithAuthor - publications { - publicationYear - ... on Book { - title - } - ... on Journal { - subject - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Author) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[wrote0:WROTE]->(book0:Book) - WITH book0 { - __typename: 'Book', - __id: elementId(book0), - .publicationYear, - .title - } AS book0 - RETURN book0 AS publications UNION - WITH * - MATCH (this)-[wrote1:WROTE]->(journal0:Journal) - WITH journal0 { - __typename: 'Journal', - __id: elementId(journal0), - .publicationYear, - .subject - } AS journal0 - RETURN journal0 AS publications - } - WITH publications - RETURN collect(publications) AS publications -} -RETURN this { - .name, - publications: publications -} AS this ----- - -''' - -== should not over fetch when no required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - authors { - publicationsWithAuthor - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Author) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[wrote0:WROTE]->(book0:Book) - WITH book0 { - __typename: 'Book', - __id: elementId(book0), - .title - } AS book0 - RETURN book0 AS publications UNION - WITH * - MATCH (this)-[wrote1:WROTE]->(journal0:Journal) - WITH journal0 { - __typename: 'Journal', - __id: elementId(journal0), - .subject - } AS journal0 - RETURN journal0 AS publications - } - WITH publications - RETURN collect(publications) AS publications -} -RETURN this { - .name, - publications: publications -} AS this ----- - -''' - -== should not over fetch when some required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - authors { - publicationsWithAuthor - publications { - ... on Book { - title - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Author) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[wrote0:WROTE]->(book0:Book) - WITH book0 { - __typename: 'Book', - __id: elementId(book0), - .title - } AS book0 - RETURN book0 AS publications UNION - WITH * - MATCH (this)-[wrote1:WROTE]->(journal0:Journal) - WITH journal0 { - __typename: 'Journal', - __id: elementId(journal0), - .subject - } AS journal0 - RETURN journal0 AS publications - } - WITH publications - RETURN collect(publications) AS publications -} -RETURN this { - publications: publications, - .name -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-types.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-types.adoc deleted file mode 100644 index 52e2cdc9..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-types.adoc +++ /dev/null @@ -1,214 +0,0 @@ -:toc: - -= Require fields on nested types - -== Source schema - -[source,graphql,schema=true] ----- -type City { - name: String! - population: Int -} - -type Address { - street: String! - city: City! @relationship(type: "IN_CITY", direction: OUT) -} - -type User { - id: ID! - firstName: String! - lastName: String! - address: Address @relationship(type: "LIVES_AT", direction: OUT) - fullName: String @customResolver(requires: "firstName lastName address { city { name population } }") -} ----- - -== should not fetch required fields if @customResolver field is not selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - firstName - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -RETURN this { - .firstName -} AS this ----- - -''' - -== should not over fetch when all required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - firstName - lastName - fullName - address { - city { - name - population - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) - CALL { - WITH address0 - MATCH (address0)-[inCity0:IN_CITY]->(city0:City) - WITH city0 { - .name, - .population - } AS city - RETURN head(collect(city)) AS city - } - WITH address0 { - city: city - } AS address - RETURN head(collect(address)) AS address -} -RETURN this { - .firstName, - .lastName, - address: address -} AS this ----- - -''' - -== should not over fetch when no required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - fullName - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) - CALL { - WITH address0 - MATCH (address0)-[inCity0:IN_CITY]->(city0:City) - WITH city0 { - .name, - .population - } AS city - RETURN head(collect(city)) AS city - } - WITH address0 { - city: city - } AS address - RETURN head(collect(address)) AS address -} -RETURN this { - .firstName, - .lastName, - address: address -} AS this ----- - -''' - -== should not over fetch when some required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - lastName - fullName - address { - city { - population - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[livesAt0:LIVES_AT]->(address0:Address) - CALL { - WITH address0 - MATCH (address0)-[inCity0:IN_CITY]->(city0:City) - WITH city0 { - .population, - .name - } AS city - RETURN head(collect(city)) AS city - } - WITH address0 { - city: city - } AS address - RETURN head(collect(address)) AS address -} -RETURN this { - .lastName, - address: address, - .firstName -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-unions.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-unions.adoc deleted file mode 100644 index 7d329837..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-nested-unions.adoc +++ /dev/null @@ -1,229 +0,0 @@ -:toc: - -= Require fields on nested unions - -== Source schema - -[source,graphql,schema=true] ----- -union Publication = Book | Journal - -type Author { - name: String! - publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) - publicationsWithAuthor: [String!]! @customResolver(requires: "name publications { ...on Book { title } ... on Journal { subject } }") -} - -type Book { - title: String! - author: Author! @relationship(type: "WROTE", direction: IN) -} - -type Journal { - subject: String! - author: Author! @relationship(type: "WROTE", direction: IN) -} ----- - -== should not fetch required fields if @customResolver field is not selected - -.GraphQL-Query -[source,graphql] ----- -{ - authors { - name - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Author) -RETURN this { - .name -} AS this ----- - -''' - -== should not over fetch when all required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - authors { - name - publicationsWithAuthor - publications { - ... on Book { - title - } - ... on Journal { - subject - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Author) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[wrote0:WROTE]->(book0:Book) - WITH book0 { - __typename: 'Book', - __id: elementId(book0), - .title - } AS book0 - RETURN book0 AS publications0 UNION - WITH * - MATCH (this)-[wrote1:WROTE]->(journal0:Journal) - WITH journal0 { - __typename: 'Journal', - __id: elementId(journal0), - .subject - } AS journal0 - RETURN journal0 AS publications0 - } - WITH publications0 - RETURN collect(publications0) AS publications0 -} -RETURN this { - .name, - publications: publications0 -} AS this ----- - -''' - -== should not over fetch when no required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - authors { - publicationsWithAuthor - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Author) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[wrote0:WROTE]->(book0:Book) - WITH book0 { - __typename: 'Book', - __id: elementId(book0), - .title - } AS book0 - RETURN book0 AS publications0 UNION - WITH * - MATCH (this)-[wrote1:WROTE]->(journal0:Journal) - WITH journal0 { - __typename: 'Journal', - __id: elementId(journal0), - .subject - } AS journal0 - RETURN journal0 AS publications0 - } - WITH publications0 - RETURN collect(publications0) AS publications0 -} -RETURN this { - .name, - publications: publications0 -} AS this ----- - -''' - -== should not over fetch when some required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - authors { - publicationsWithAuthor - publications { - ... on Book { - title - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Author) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[wrote0:WROTE]->(book0:Book) - WITH book0 { - __typename: 'Book', - __id: elementId(book0), - .title - } AS book0 - RETURN book0 AS publications0 UNION - WITH * - MATCH (this)-[wrote1:WROTE]->(journal0:Journal) - WITH journal0 { - __typename: 'Journal', - __id: elementId(journal0), - .subject - } AS journal0 - RETURN journal0 AS publications0 - } - WITH publications0 - RETURN collect(publications0) AS publications0 -} -RETURN this { - publications: publications0, - .name -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-same-type.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-same-type.adoc deleted file mode 100644 index c3b12028..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/customResolver_require-fields-on-same-type.adoc +++ /dev/null @@ -1,137 +0,0 @@ -:toc: - -= Require fields on same type - -== Source schema - -[source,graphql,schema=true] ----- -type User { - firstName: String! - lastName: String! - fullName: String! @customResolver(requires: "firstName lastName") -} ----- - -== should not fetch required fields if @customResolver field is not selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - firstName - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -RETURN this { - .firstName -} AS this ----- - -''' - -== should not over fetch when all required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - firstName - lastName - fullName - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -RETURN this { - .firstName, - .lastName -} AS this ----- - -''' - -== should not over fetch when no required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - fullName - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -RETURN this { - .firstName, - .lastName -} AS this ----- - -''' - -== should not over fetch when some required fields are manually selected - -.GraphQL-Query -[source,graphql] ----- -{ - users { - firstName - fullName - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -RETURN this { - .firstName, - .lastName -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/interface-relationships/read.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/interface-relationships/read.adoc index cdba5b1e..581174ca 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/interface-relationships/read.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/interface-relationships/read.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Interface Relationships -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Production { @@ -31,27 +33,20 @@ type Actor { } ---- -== Interface Relationship Query through connection +== Simple Interface Relationship Query .GraphQL-Query [source,graphql] ---- { actors { - actedInConnection { - edges { - properties { - screenTime - } - node { - title - ... on Movie { - runtime - } - ... on Series { - episodes - } - } + actedIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes } } } @@ -71,74 +66,49 @@ MATCH (this:Actor) CALL { WITH this CALL { - WITH this + WITH * MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) - WITH { - properties: { - __typename: 'ActedIn', - screenTime: actedIn0.screenTime - }, - node: { - __typename: 'Movie', - title: movie0.title, - runtime: movie0.runtime, - __id: elementId(movie0) - } - } AS edge - RETURN edge UNION - WITH this + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) - WITH { - properties: { - __typename: 'ActedIn', - screenTime: actedIn1.screenTime - }, - node: { - __typename: 'Series', - title: series0.title, - episodes: series0.episodes, - __id: elementId(series0) - } - } AS edge - RETURN edge + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS actedIn } - WITH collect(edge) AS edges - WITH edges, size(edges) AS totalCount - RETURN { - edges: edges, - totalCount: totalCount - } AS actedInConnection + WITH actedIn + RETURN collect(actedIn) AS actedIn } RETURN this { - actedInConnection: actedInConnection + actedIn: actedIn } AS this ---- ''' -== Interface Relationship Query through connection with where +== Simple Interface Relationship Query For Non-Array Field .GraphQL-Query [source,graphql] ---- { actors { - actedInConnection( - where: {node: {title_STARTS_WITH: "The "}, edge: {screenTime_GT: 60}} - ) { - edges { - properties { - screenTime - } - node { - title - ... on Movie { - runtime - } - ... on Series { - episodes - } - } + currentlyActingIn { + title + ... on Movie { + runtime + } + ... on Series { + episodes } } } @@ -148,12 +118,7 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ - "param0" : "The ", - "param1" : 60, - "param2" : "The ", - "param3" : 60 -} +{ } ---- .Expected Cypher output @@ -163,63 +128,43 @@ MATCH (this:Actor) CALL { WITH this CALL { - WITH this - MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) - WHERE (movie0.title STARTS WITH $param0 - AND actedIn0.screenTime > $param1) - WITH { - properties: { - __typename: 'ActedIn', - screenTime: actedIn0.screenTime - }, - node: { - __typename: 'Movie', - title: movie0.title, - runtime: movie0.runtime, - __id: elementId(movie0) - } - } AS edge - RETURN edge UNION - WITH this - MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) - WHERE (series0.title STARTS WITH $param2 - AND actedIn1.screenTime > $param3) - WITH { - properties: { - __typename: 'ActedIn', - screenTime: actedIn1.screenTime - }, - node: { - __typename: 'Series', - title: series0.title, - episodes: series0.episodes, - __id: elementId(series0) - } - } AS edge - RETURN edge + WITH * + MATCH (this)-[currentlyActingIn0:CURRENTLY_ACTING_IN]->(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title, + .runtime + } AS movie0 + RETURN movie0 AS currentlyActingIn UNION + WITH * + MATCH (this)-[currentlyActingIn1:CURRENTLY_ACTING_IN]->(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title, + .episodes + } AS series0 + RETURN series0 AS currentlyActingIn } - WITH collect(edge) AS edges - WITH edges, size(edges) AS totalCount - RETURN { - edges: edges, - totalCount: totalCount - } AS actedInConnection + WITH currentlyActingIn + RETURN head(collect(currentlyActingIn)) AS currentlyActingIn } RETURN this { - actedInConnection: actedInConnection + currentlyActingIn: currentlyActingIn } AS this ---- ''' -== Simple Interface Relationship Query +== Simple Interface Relationship Query with offset and limit .GraphQL-Query [source,graphql] ---- { actors { - actedIn { + actedIn(options: {offset: 5, limit: 10, sort: [{title: DESC}]}) { title ... on Movie { runtime @@ -235,7 +180,10 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ } +{ + "param0" : 5, + "param1" : 10 +} ---- .Expected Cypher output @@ -264,7 +212,7 @@ CALL { } AS series0 RETURN series0 AS actedIn } - WITH actedIn + WITH actedIn ORDER BY actedIn.title DESC SKIP $param0 LIMIT $param1 RETURN collect(actedIn) AS actedIn } RETURN this { @@ -274,20 +222,27 @@ RETURN this { ''' -== Simple Interface Relationship Query For Non-Array Field +== Interface Relationship Query through connection .GraphQL-Query [source,graphql] ---- { actors { - currentlyActingIn { - title - ... on Movie { - runtime - } - ... on Series { - episodes + actedInConnection { + edges { + properties { + screenTime + } + node { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } } } } @@ -307,49 +262,74 @@ MATCH (this:Actor) CALL { WITH this CALL { - WITH * - MATCH (this)-[currentlyActingIn0:CURRENTLY_ACTING_IN]->(movie0:Movie) - WITH movie0 { - __typename: 'Movie', - __id: elementId(movie0), - .title, - .runtime - } AS movie0 - RETURN movie0 AS currentlyActingIn UNION - WITH * - MATCH (this)-[currentlyActingIn1:CURRENTLY_ACTING_IN]->(series0:Series) - WITH series0 { - __typename: 'Series', - __id: elementId(series0), - .title, - .episodes - } AS series0 - RETURN series0 AS currentlyActingIn + WITH this + MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Movie', + title: movie0.title, + runtime: movie0.runtime, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this + MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn1.screenTime + }, + node: { + __typename: 'Series', + title: series0.title, + episodes: series0.episodes, + __id: elementId(series0) + } + } AS edge + RETURN edge } - WITH currentlyActingIn - RETURN head(collect(currentlyActingIn)) AS currentlyActingIn + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection } RETURN this { - currentlyActingIn: currentlyActingIn + actedInConnection: actedInConnection } AS this ---- ''' -== Simple Interface Relationship Query with offset and limit +== Interface Relationship Query through connection with where .GraphQL-Query [source,graphql] ---- { actors { - actedIn(options: {offset: 5, limit: 10, sort: [{title: DESC}]}) { - title - ... on Movie { - runtime - } - ... on Series { - episodes + actedInConnection( + where: {node: {title_STARTS_WITH: "The "}, edge: {screenTime_GT: 60}} + ) { + edges { + properties { + screenTime + } + node { + title + ... on Movie { + runtime + } + ... on Series { + episodes + } + } } } } @@ -360,8 +340,10 @@ RETURN this { [source,json] ---- { - "param0" : 5, - "param1" : 10 + "param0" : "The ", + "param1" : 60, + "param2" : "The ", + "param3" : 60 } ---- @@ -372,30 +354,50 @@ MATCH (this:Actor) CALL { WITH this CALL { - WITH * + WITH this MATCH (this)-[actedIn0:ACTED_IN]->(movie0:Movie) - WITH movie0 { - __typename: 'Movie', - __id: elementId(movie0), - .title, - .runtime - } AS movie0 - RETURN movie0 AS actedIn UNION - WITH * + WHERE (movie0.title STARTS WITH $param0 + AND actedIn0.screenTime > $param1) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn0.screenTime + }, + node: { + __typename: 'Movie', + title: movie0.title, + runtime: movie0.runtime, + __id: elementId(movie0) + } + } AS edge + RETURN edge UNION + WITH this MATCH (this)-[actedIn1:ACTED_IN]->(series0:Series) - WITH series0 { - __typename: 'Series', - __id: elementId(series0), - .title, - .episodes - } AS series0 - RETURN series0 AS actedIn + WHERE (series0.title STARTS WITH $param2 + AND actedIn1.screenTime > $param3) + WITH { + properties: { + __typename: 'ActedIn', + screenTime: actedIn1.screenTime + }, + node: { + __typename: 'Series', + title: series0.title, + episodes: series0.episodes, + __id: elementId(series0) + } + } AS edge + RETURN edge } - WITH actedIn ORDER BY actedIn.title DESC SKIP $param0 LIMIT $param1 - RETURN collect(actedIn) AS actedIn + WITH collect(edge) AS edges + WITH edges, size(edges) AS totalCount + RETURN { + edges: edges, + totalCount: totalCount + } AS actedInConnection } RETURN this { - actedIn: actedIn + actedInConnection: actedInConnection } AS this ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-additional-labels.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-additional-labels.adoc index 03971345..7da56cbf 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-additional-labels.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-additional-labels.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Node directive with additionalLabels -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Actor @node(labels: ["Actor", "Person"]) { @@ -18,7 +20,7 @@ type Movie @node(labels: ["Film", "Multimedia"]) { } ---- -== Select movie and actor with additional labels +== Select Movie with additional labels .GraphQL-Query [source,graphql] @@ -26,9 +28,6 @@ type Movie @node(labels: ["Film", "Multimedia"]) { { movies { title - actors { - name - } } } ---- @@ -43,23 +42,14 @@ type Movie @node(labels: ["Film", "Multimedia"]) { [source,cypher] ---- MATCH (this:Film:Multimedia) -CALL { - WITH this - MATCH (actor0:Actor:Person)-[actedIn0:ACTED_IN]->(this) - WITH actor0 { - .name - } AS actors - RETURN collect(actors) AS actors -} RETURN this { - .title, - actors: actors + .title } AS this ---- ''' -== Select Movie with additional labels +== Select movie and actor with additional labels .GraphQL-Query [source,graphql] @@ -67,6 +57,9 @@ RETURN this { { movies { title + actors { + name + } } } ---- @@ -81,8 +74,17 @@ RETURN this { [source,cypher] ---- MATCH (this:Film:Multimedia) +CALL { + WITH this + MATCH (actor0:Actor:Person)-[actedIn0:ACTED_IN]->(this) + WITH actor0 { + .name + } AS actors + RETURN collect(actors) AS actors +} RETURN this { - .title + .title, + actors: actors } AS this ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-interface.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-interface.adoc index 497e5d89..585ffd3f 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-interface.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-interface.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Node directive with interface -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Search { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-union.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-union.adoc index f70c3816..8997b163 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-union.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label-union.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Node directive with unions -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- union Search = Genre | Movie diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label.adoc index 73e17370..5a506cc7 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/node/node-label.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Label in Node directive -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Actor @node(labels: ["Person"]) { @@ -18,6 +20,35 @@ type Movie @node(labels: ["Film"]) { } ---- +== Select Movie with label Film + +.GraphQL-Query +[source,graphql] +---- +{ + movies { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Film) +RETURN this { + .title +} AS this +---- + +''' + == Select movie and actor with custom labels .GraphQL-Query @@ -120,32 +151,3 @@ RETURN this { ''' -== Select Movie with label Film - -.GraphQL-Query -[source,graphql] ----- -{ - movies { - title - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Film) -RETURN this { - .title -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/directives/plural.adoc b/core/src/test/resources/tck-test-files/cypher/v2/directives/plural.adoc index e931f2cb..a4ea9529 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/directives/plural.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/directives/plural.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Plural directive -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Tech @plural(value: "Techs") { @@ -11,13 +13,13 @@ type Tech @plural(value: "Techs") { } ---- -== Query with aliases +== Select Tech with plural techs .GraphQL-Query [source,graphql] ---- { - technologies: techs { + techs { name } } @@ -40,13 +42,13 @@ RETURN this { ''' -== Select Tech with plural techs +== Query with aliases .GraphQL-Query [source,graphql] ---- { - techs { + technologies: techs { name } } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc b/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc index 94c05899..49fd6719 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = typename_IN -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Production { @@ -39,83 +41,6 @@ type Actor { } ---- -== nested - -.GraphQL-Query -[source,graphql] ----- -{ - actors { - actedIn( - where: {OR: [{AND: [{title: "The Matrix"}, {typename_IN: [Series]}]}, {typename_IN: [Movie]}]} - ) { - title - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ - "param0" : "The Matrix", - "param1" : "The Matrix", - "param2" : "The Matrix" -} ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Actor) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[actedIn0:ACTED_IN]->(cartoon0:Cartoon) - WHERE ((cartoon0.title = $param0 - AND cartoon0:Series) - OR cartoon0:Movie) - WITH cartoon0 { - __typename: 'Cartoon', - __id: elementId(cartoon0), - .title - } AS cartoon0 - RETURN cartoon0 AS actedIn UNION - WITH * - MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) - WHERE ((movie0.title = $param1 - AND movie0:Series) - OR movie0:Movie) - WITH movie0 { - __typename: 'Movie', - __id: elementId(movie0), - .title - } AS movie0 - RETURN movie0 AS actedIn UNION - WITH * - MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) - WHERE ((series0.title = $param2 - AND series0:Series) - OR series0:Movie) - WITH series0 { - __typename: 'Series', - __id: elementId(series0), - .title - } AS series0 - RETURN series0 AS actedIn - } - WITH actedIn - RETURN collect(actedIn) AS actedIn -} -RETURN this { - actedIn: actedIn -} AS this ----- - -''' - == top-level .GraphQL-Query @@ -257,3 +182,80 @@ RETURN this { ''' +== nested + +.GraphQL-Query +[source,graphql] +---- +{ + actors { + actedIn( + where: {OR: [{AND: [{title: "The Matrix"}, {typename_IN: [Series]}]}, {typename_IN: [Movie]}]} + ) { + title + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "The Matrix", + "param1" : "The Matrix", + "param2" : "The Matrix" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]->(cartoon0:Cartoon) + WHERE ((cartoon0.title = $param0 + AND cartoon0:Series) + OR cartoon0:Movie) + WITH cartoon0 { + __typename: 'Cartoon', + __id: elementId(cartoon0), + .title + } AS cartoon0 + RETURN cartoon0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]->(movie0:Movie) + WHERE ((movie0.title = $param1 + AND movie0:Series) + OR movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn2:ACTED_IN]->(series0:Series) + WHERE ((series0.title = $param2 + AND series0:Series) + OR series0:Movie) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + actedIn: actedIn +} AS this +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-relationship-filtering.adoc b/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-relationship-filtering.adoc index 3f4948c6..b0daf7c5 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-relationship-filtering.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-relationship-filtering.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Union relationship filtering operations -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- union Production = Movie | Series @@ -31,48 +33,6 @@ type ActedIn @relationshipProperties { } ---- -== Filtering on nested-level relationship unions - -.GraphQL-Query -[source,graphql] ----- -query actedInWhere { - actors( - where: {actedIn_SOME: {Movie: {title_CONTAINS: "The Office"}, Series: {title_ENDS_WITH: "Office"}}} - ) { - name - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ - "param0" : "The Office", - "param1" : "Office" -} ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Actor) -WHERE (EXISTS { - MATCH (this)-[:ACTED_IN]->(this0:Movie) - WHERE this0.title CONTAINS $param0 - } - AND EXISTS { - MATCH (this)-[:ACTED_IN]->(this1:Series) - WHERE this1.title ENDS WITH $param1 - }) -RETURN this { - .name -} AS this ----- - -''' - == Union filter (top level) .GraphQL-Query @@ -128,3 +88,45 @@ RETURN this AS this ''' +== Filtering on nested-level relationship unions + +.GraphQL-Query +[source,graphql] +---- +query actedInWhere { + actors( + where: {actedIn_SOME: {Movie: {title_CONTAINS: "The Office"}, Series: {title_ENDS_WITH: "Office"}}} + ) { + name + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "The Office", + "param1" : "Office" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +WHERE (EXISTS { + MATCH (this)-[:ACTED_IN]->(this0:Movie) + WHERE this0.title CONTAINS $param0 + } + OR EXISTS { + MATCH (this)-[:ACTED_IN]->(this1:Series) + WHERE this1.title ENDS WITH $param1 + }) +RETURN this { + .name +} AS this +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-top-level.adoc b/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-top-level.adoc index e7598bdc..c6eea331 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-top-level.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/experimental/union-top-level.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Union top level operations -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- union Search = Genre | Movie diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/1348.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/1348.adoc index 6c78654f..7955f0e9 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/1348.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/1348.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/1348 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Product { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/1687.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/1687.adoc index f30365ec..0c2c5f10 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/1687.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/1687.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/1687 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Production { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/1779.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/1779.adoc index f3742883..312aca3e 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/1779.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/1779.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/1779 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Person { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/2262.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/2262.adoc index 7e3b455c..e648baa2 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/2262.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/2262.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/2262 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Component { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/2614.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/2614.adoc index 6576f091..379a2dd6 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/2614.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/2614.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/2614 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Production { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/2713.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/2713.adoc index 1e11d99e..df61b56e 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/2713.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/2713.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/2713 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/2925.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/2925.adoc index f649d910..e1ea3ca0 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/2925.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/2925.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/2925 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Group { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/3215.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/3215.adoc index abf3bb03..276dcd52 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/3215.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/3215.adoc @@ -1,9 +1,13 @@ :toc: +:toclevels: 42 -= union += https://github.com/neo4j/graphql/issues/3215 -== Source schema +== union +=== Setup + +.Schema [source,graphql,schema=true] ---- type Actor { @@ -12,7 +16,7 @@ type Actor { } ---- -== should ignore undefined parameters on boolean NOT +=== should ignore undefined parameters on boolean NOT .GraphQL-Query [source,graphql] diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/3394.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/3394.adoc index 546264f6..0bf21d9d 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/3394.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/3394.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/3394 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Employee { @@ -213,4 +215,3 @@ RETURN this { ''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/360.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/360.adoc index 4e5426d1..8d5e5141 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/360.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/360.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = #360 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Event { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/3765.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/3765.adoc index db40fda7..cbfd0a0e 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/3765.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/3765.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/3765 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type User { @@ -24,13 +26,13 @@ type likesProperties @relationshipProperties { == property filters -=== explicit NOT with an implicit AND +=== implicit AND .GraphQL-Query [source,graphql] ---- { - posts(where: {NOT: {content: "stuff", alternateContent: "stuff2"}}) { + posts(where: {content: "stuff", alternateContent: "stuff2"}) { content } } @@ -49,8 +51,8 @@ type likesProperties @relationshipProperties { [source,cypher] ---- MATCH (this:Post) -WHERE NOT ((this.content = $param0 - AND this.alternateContent = $param1)) +WHERE (this.content = $param0 + AND this.alternateContent = $param1) RETURN this { .content } AS this @@ -96,13 +98,13 @@ RETURN this { ''' -=== implicit AND +=== explicit NOT with an implicit AND .GraphQL-Query [source,graphql] ---- { - posts(where: {content: "stuff", alternateContent: "stuff2"}) { + posts(where: {NOT: {content: "stuff", alternateContent: "stuff2"}}) { content } } @@ -121,8 +123,8 @@ RETURN this { [source,cypher] ---- MATCH (this:Post) -WHERE (this.content = $param0 - AND this.alternateContent = $param1) +WHERE NOT ((this.content = $param0 + AND this.alternateContent = $param1)) RETURN this { .content } AS this @@ -132,15 +134,13 @@ RETURN this { == relationship filters -=== explicit OR outside relationship filters +=== implicit AND inside relationship filter .GraphQL-Query [source,graphql] ---- { - posts( - where: {OR: [{likes_SOME: {name: "stuff"}}, {likes_ALL: {otherName: "stuff2"}}, {likes_SOME: {otherName: "stuff3"}}]} - ) { + posts(where: {likes_SOME: {name: "stuff", otherName: "stuff2"}}) { content } } @@ -151,8 +151,7 @@ RETURN this { ---- { "param0" : "stuff", - "param1" : "stuff2", - "param2" : "stuff3" + "param1" : "stuff2" } ---- @@ -160,22 +159,11 @@ RETURN this { [source,cypher] ---- MATCH (this:Post) -WHERE (EXISTS { - MATCH (this0:User)-[:LIKES]->(this) - WHERE this0.name = $param0 - } - OR (EXISTS { - MATCH (this1:User)-[:LIKES]->(this) - WHERE this1.otherName = $param1 - } - AND NOT (EXISTS { - MATCH (this1:User)-[:LIKES]->(this) - WHERE NOT (this1.otherName = $param1) - })) - OR EXISTS { - MATCH (this2:User)-[:LIKES]->(this) - WHERE this2.otherName = $param2 - }) +WHERE EXISTS { + MATCH (this0:User)-[:LIKES]->(this) + WHERE (this0.name = $param0 + AND this0.otherName = $param1) +} RETURN this { .content } AS this @@ -183,13 +171,13 @@ RETURN this { ''' -=== implicit AND inside relationship filter +=== implicit AND outside relationship filters .GraphQL-Query [source,graphql] ---- { - posts(where: {likes_SOME: {name: "stuff", otherName: "stuff2"}}) { + posts(where: {likes_SOME: {name: "stuff"}, likes_ALL: {otherName: "stuff2"}}) { content } } @@ -199,8 +187,8 @@ RETURN this { [source,json] ---- { - "param0" : "stuff", - "param1" : "stuff2" + "param0" : "stuff2", + "param1" : "stuff" } ---- @@ -208,11 +196,18 @@ RETURN this { [source,cypher] ---- MATCH (this:Post) -WHERE EXISTS { - MATCH (this0:User)-[:LIKES]->(this) - WHERE (this0.name = $param0 - AND this0.otherName = $param1) -} +WHERE (EXISTS { + MATCH (this0:User)-[:LIKES]->(this) + WHERE this0.otherName = $param0 + } + AND NOT (EXISTS { + MATCH (this0:User)-[:LIKES]->(this) + WHERE NOT (this0.otherName = $param0) + }) + AND EXISTS { + MATCH (this1:User)-[:LIKES]->(this) + WHERE this1.name = $param1 + }) RETURN this { .content } AS this @@ -220,13 +215,15 @@ RETURN this { ''' -=== implicit AND outside relationship filters +=== explicit OR outside relationship filters .GraphQL-Query [source,graphql] ---- { - posts(where: {likes_SOME: {name: "stuff"}, likes_ALL: {otherName: "stuff2"}}) { + posts( + where: {OR: [{likes_SOME: {name: "stuff"}}, {likes_ALL: {otherName: "stuff2"}}, {likes_SOME: {otherName: "stuff3"}}]} + ) { content } } @@ -236,8 +233,9 @@ RETURN this { [source,json] ---- { - "param0" : "stuff2", - "param1" : "stuff" + "param0" : "stuff", + "param1" : "stuff2", + "param2" : "stuff3" } ---- @@ -247,15 +245,19 @@ RETURN this { MATCH (this:Post) WHERE (EXISTS { MATCH (this0:User)-[:LIKES]->(this) - WHERE this0.otherName = $param0 + WHERE this0.name = $param0 } - AND NOT (EXISTS { - MATCH (this0:User)-[:LIKES]->(this) - WHERE NOT (this0.otherName = $param0) - }) - AND EXISTS { - MATCH (this1:User)-[:LIKES]->(this) - WHERE this1.name = $param1 + OR (EXISTS { + MATCH (this1:User)-[:LIKES]->(this) + WHERE this1.otherName = $param1 + } + AND NOT (EXISTS { + MATCH (this1:User)-[:LIKES]->(this) + WHERE NOT (this1.otherName = $param1) + })) + OR EXISTS { + MATCH (this2:User)-[:LIKES]->(this) + WHERE this2.otherName = $param2 }) RETURN this { .content @@ -264,4 +266,3 @@ RETURN this { ''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4007.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4007.adoc index 814aebc9..f74a9dab 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4007.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4007.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/4007 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4015.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4015.adoc index e25c6db0..f179b785 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4015.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4015.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/4015 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/402.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/402.adoc index b5bfd366..daafbecd 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/402.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/402.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = #402 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Event { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4287.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4287.adoc index acffd187..9ea9cb55 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4287.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4287.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/4287 -== Source schema +== filter by logical operator on interface connection +.Schema [source,graphql,schema=true] ---- type Actor { @@ -30,8 +32,6 @@ type Series implements Production { } ---- -== filter by logical operator on interface connection - .GraphQL-Query [source,graphql] ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/433.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/433.adoc index 99b1e263..e7f467ea 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/433.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/433.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = #413 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4432.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4432.adoc index 5ea34fcd..40e459f9 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4432.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4432.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/4532 -== Source schema +== connections to interfaces with sort +.Schema [source,graphql,schema=true] ---- type Inventory { @@ -28,8 +30,6 @@ type InventoryChildRelation @relationshipProperties { } ---- -== connections to interfaces with sort - .GraphQL-Query [source,graphql] ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4450.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4450.adoc index 78c222c7..a668f0aa 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4450.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4450.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/4450 -== Source schema +== filtering through a connection to a many-to-1 relationship should work +.Schema [source,graphql,schema=true] ---- type Actor { @@ -27,8 +29,6 @@ type ActorScene @relationshipProperties { } ---- -== filtering through a connection to a many-to-1 relationship should work - .GraphQL-Query [source,graphql] ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/4667.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/4667.adoc index bb07c59a..1b82dc9b 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/4667.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/4667.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/4667 -== Source schema +== when passed null as an argument of a relationship filter should check that a relationship does not exist +.Schema [source,graphql,schema=true] ---- type MyThing { @@ -17,8 +19,6 @@ type MyStuff { } ---- -== when passed null as an argument of a relationship filter should check that a relationship does not exist - .GraphQL-Query [source,graphql] ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/issues/583.adoc b/core/src/test/resources/tck-test-files/cypher/v2/issues/583.adoc index 99b0d135..a3b175fc 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/issues/583.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/issues/583.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = https://github.com/neo4j/graphql/issues/583 -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Show { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/null.adoc b/core/src/test/resources/tck-test-files/cypher/v2/null.adoc index 7321a46b..62d6ed8d 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/null.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/null.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher NULL -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Actor { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/pagination.adoc b/core/src/test/resources/tck-test-files/cypher/v2/pagination.adoc index 76c2c370..5ffcf28c 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/pagination.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/pagination.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher pagination tests -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,6 +14,38 @@ type Movie { } ---- +== Skipping + +.GraphQL-Query +[source,graphql] +---- +{ + movies(options: {offset: 1}) { + title + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : 1 +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WITH * SKIP $param0 +RETURN this { + .title +} AS this +---- + +''' + == Limit .GraphQL-Query @@ -164,35 +198,3 @@ RETURN this { ''' -== Skipping - -.GraphQL-Query -[source,graphql] ----- -{ - movies(options: {offset: 1}) { - title - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ - "param0" : 1 -} ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Movie) -WITH * SKIP $param0 -RETURN this { - .title -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/rfcs/query-limits.adoc b/core/src/test/resources/tck-test-files/cypher/v2/rfcs/query-limits.adoc index 5ede8331..0a1798c9 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/rfcs/query-limits.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/rfcs/query-limits.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = tck/rfcs/query-limits -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie @limit(default: 3, max: 5) { @@ -25,9 +27,9 @@ type Festival { } ---- -== Field Level Query Limits +== Top Level Query Limits -=== should extend the limit to the connection field if `first` provided +=== should limit the top level query with default value .GraphQL-Query [source,graphql] @@ -35,13 +37,6 @@ type Festival { { movies { id - actorsConnection(first: 4) { - edges { - node { - id - } - } - } } } ---- @@ -50,8 +45,7 @@ type Festival { [source,json] ---- { - "param0" : 4, - "param1" : 3 + "param0" : 3 } ---- @@ -59,54 +53,22 @@ type Festival { [source,cypher] ---- MATCH (this:Movie) -WITH * LIMIT $param1 -CALL { - WITH this - MATCH (person0:Person)-[actedIn0:ACTED_IN]->(this) - WITH collect( { - node: person0, - relationship: actedIn0 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS person0, edge.relationship AS actedIn0 LIMIT $param0 - RETURN collect( { - node: { - __typename: 'Person', - id: person0.id - } - }) AS actorsConnectionEdges - } - RETURN { - edges: actorsConnectionEdges, - totalCount: totalCount - } AS actorsConnection -} +WITH * LIMIT $param0 RETURN this { - .id, - actorsConnection: actorsConnection + .id } AS this ---- ''' -=== should extend the limit to the connection field if `first` provided, honouring the `max` argument +=== should limit the top level query with max value if not default is available .GraphQL-Query [source,graphql] ---- { - festivals { - name - showsConnection(first: 3) { - edges { - node { - id - } - } - } + shows { + id } } ---- @@ -122,54 +84,23 @@ RETURN this { .Expected Cypher output [source,cypher] ---- -MATCH (this:Festival) -CALL { - WITH this - MATCH (show0:Show)-[partOf0:PART_OF]->(this) - WITH collect( { - node: show0, - relationship: partOf0 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS show0, edge.relationship AS partOf0 LIMIT $param0 - RETURN collect( { - node: { - __typename: 'Show', - id: show0.id - } - }) AS showsConnectionEdges - } - RETURN { - edges: showsConnectionEdges, - totalCount: totalCount - } AS showsConnection -} +MATCH (this:Show) +WITH * LIMIT $param0 RETURN this { - .name, - showsConnection: showsConnection + .id } AS this ---- ''' -=== should limit the connection field level query +=== should limit the top level query with max value the option given is higher .GraphQL-Query [source,graphql] ---- { - movies { + shows(options: {limit: 5}) { id - actorsConnection { - edges { - node { - id - } - } - } } } ---- @@ -178,48 +109,24 @@ RETURN this { [source,json] ---- { - "param0" : 2, - "param1" : 3 + "param0" : 2 } ---- .Expected Cypher output [source,cypher] ---- -MATCH (this:Movie) -WITH * LIMIT $param1 -CALL { - WITH this - MATCH (person0:Person)-[actedIn0:ACTED_IN]->(this) - WITH collect( { - node: person0, - relationship: actedIn0 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS person0, edge.relationship AS actedIn0 LIMIT $param0 - RETURN collect( { - node: { - __typename: 'Person', - id: person0.id - } - }) AS actorsConnectionEdges - } - RETURN { - edges: actorsConnectionEdges, - totalCount: totalCount - } AS actorsConnection -} +MATCH (this:Show) +WITH * LIMIT $param0 RETURN this { - .id, - actorsConnection: actorsConnection + .id } AS this ---- ''' +== Field Level Query Limits + === should limit the normal field level query .GraphQL-Query @@ -265,7 +172,7 @@ RETURN this { ''' -=== should limit the relationship field level query +=== should limit the connection field level query .GraphQL-Query [source,graphql] @@ -273,8 +180,12 @@ RETURN this { { movies { id - actors { - id + actorsConnection { + edges { + node { + id + } + } } } } @@ -297,22 +208,36 @@ WITH * LIMIT $param1 CALL { WITH this MATCH (person0:Person)-[actedIn0:ACTED_IN]->(this) - WITH person0 { - .id - } AS actors LIMIT $param0 - RETURN collect(actors) AS actors + WITH collect( { + node: person0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS person0, edge.relationship AS actedIn0 LIMIT $param0 + RETURN collect( { + node: { + __typename: 'Person', + id: person0.id + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection } RETURN this { .id, - actors: actors + actorsConnection: actorsConnection } AS this ---- ''' -== Top Level Query Limits - -=== should limit the top level query with default value +=== should extend the limit to the connection field if `first` provided .GraphQL-Query [source,graphql] @@ -320,6 +245,13 @@ RETURN this { { movies { id + actorsConnection(first: 4) { + edges { + node { + id + } + } + } } } ---- @@ -328,7 +260,8 @@ RETURN this { [source,json] ---- { - "param0" : 3 + "param0" : 4, + "param1" : 3 } ---- @@ -336,22 +269,54 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WITH * LIMIT $param0 +WITH * LIMIT $param1 +CALL { + WITH this + MATCH (person0:Person)-[actedIn0:ACTED_IN]->(this) + WITH collect( { + node: person0, + relationship: actedIn0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS person0, edge.relationship AS actedIn0 LIMIT $param0 + RETURN collect( { + node: { + __typename: 'Person', + id: person0.id + } + }) AS actorsConnectionEdges + } + RETURN { + edges: actorsConnectionEdges, + totalCount: totalCount + } AS actorsConnection +} RETURN this { - .id + .id, + actorsConnection: actorsConnection } AS this ---- ''' -=== should limit the top level query with max value if not default is available +=== should extend the limit to the connection field if `first` provided, honouring the `max` argument .GraphQL-Query [source,graphql] ---- { - shows { - id + festivals { + name + showsConnection(first: 3) { + edges { + node { + id + } + } + } } } ---- @@ -367,23 +332,50 @@ RETURN this { .Expected Cypher output [source,cypher] ---- -MATCH (this:Show) -WITH * LIMIT $param0 +MATCH (this:Festival) +CALL { + WITH this + MATCH (show0:Show)-[partOf0:PART_OF]->(this) + WITH collect( { + node: show0, + relationship: partOf0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS show0, edge.relationship AS partOf0 LIMIT $param0 + RETURN collect( { + node: { + __typename: 'Show', + id: show0.id + } + }) AS showsConnectionEdges + } + RETURN { + edges: showsConnectionEdges, + totalCount: totalCount + } AS showsConnection +} RETURN this { - .id + .name, + showsConnection: showsConnection } AS this ---- ''' -=== should limit the top level query with max value the option given is higher +=== should limit the relationship field level query .GraphQL-Query [source,graphql] ---- { - shows(options: {limit: 5}) { + movies { id + actors { + id + } } } ---- @@ -392,20 +384,29 @@ RETURN this { [source,json] ---- { - "param0" : 2 + "param0" : 2, + "param1" : 3 } ---- .Expected Cypher output [source,cypher] ---- -MATCH (this:Show) -WITH * LIMIT $param0 +MATCH (this:Movie) +WITH * LIMIT $param1 +CALL { + WITH this + MATCH (person0:Person)-[actedIn0:ACTED_IN]->(this) + WITH person0 { + .id + } AS actors LIMIT $param0 + RETURN collect(actors) AS actors +} RETURN this { - .id + .id, + actors: actors } AS this ---- ''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/rfcs/rfc-022.adoc b/core/src/test/resources/tck-test-files/cypher/v2/rfcs/rfc-022.adoc index 0ec955e9..5fa0ecb7 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/rfcs/rfc-022.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/rfcs/rfc-022.adoc @@ -1,9 +1,13 @@ :toc: +:toclevels: 42 -= no auth += tck/rfs/022 subquery projection -== Source schema +== no auth +=== Setup + +.Schema [source,graphql,schema=true] ---- type Movie { @@ -24,7 +28,7 @@ type ActedIn @relationshipProperties { } ---- -== Double nested query +=== Nested query .GraphQL-Query [source,graphql] @@ -34,10 +38,6 @@ query Query { title actors(where: {name: "Keanu Reeves"}) { name - directed { - title - released - } } } } @@ -61,18 +61,8 @@ CALL { WITH this MATCH (person0:Person)-[actedIn0:ACTED_IN]->(this) WHERE person0.name = $param1 - CALL { - WITH person0 - MATCH (person0)-[directed0:DIRECTED]->(movie0:Movie) - WITH movie0 { - .title, - .released - } AS directed - RETURN collect(directed) AS directed - } WITH person0 { - .name, - directed: directed + .name } AS actors RETURN collect(actors) AS actors } @@ -84,7 +74,7 @@ RETURN this { ''' -== Nested query +=== Double nested query .GraphQL-Query [source,graphql] @@ -94,6 +84,10 @@ query Query { title actors(where: {name: "Keanu Reeves"}) { name + directed { + title + released + } } } } @@ -117,8 +111,18 @@ CALL { WITH this MATCH (person0:Person)-[actedIn0:ACTED_IN]->(this) WHERE person0.name = $param1 + CALL { + WITH person0 + MATCH (person0)-[directed0:DIRECTED]->(movie0:Movie) + WITH movie0 { + .title, + .released + } AS directed + RETURN collect(directed) AS directed + } WITH person0 { - .name + .name, + directed: directed } AS actors RETURN collect(actors) AS actors } diff --git a/core/src/test/resources/tck-test-files/cypher/v2/root-connection.adoc b/core/src/test/resources/tck-test-files/cypher/v2/root-connection.adoc index e91493ed..c8718ca4 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/root-connection.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/root-connection.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Root Connection Query tests -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -18,6 +20,59 @@ type Actor { } ---- +== Simple selection, Movie by title + +.GraphQL-Query +[source,graphql] +---- +{ + moviesConnection(where: {title: "River Runs Through It, A"}) { + totalCount + edges { + node { + title + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ + "param0" : "River Runs Through It, A" +} +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Movie) +WHERE this.title = $param0 +WITH collect( { + node: this +}) AS edges +WITH edges, size(edges) AS totalCount +CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS this + RETURN collect( { + node: { + __typename: 'Movie', + title: this.title + } + }) AS edges0 +} +RETURN { + edges: edges0, + totalCount: totalCount +} AS this +---- + +''' + == should apply limit and sort before return .GraphQL-Query @@ -213,56 +268,3 @@ RETURN { ''' -== Simple selection, Movie by title - -.GraphQL-Query -[source,graphql] ----- -{ - moviesConnection(where: {title: "River Runs Through It, A"}) { - totalCount - edges { - node { - title - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ - "param0" : "River Runs Through It, A" -} ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Movie) -WHERE this.title = $param0 -WITH collect( { - node: this -}) AS edges -WITH edges, size(edges) AS totalCount -CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS this - RETURN collect( { - node: { - __typename: 'Movie', - title: this.title - } - }) AS edges0 -} -RETURN { - edges: edges0, - totalCount: totalCount -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/simple.adoc b/core/src/test/resources/tck-test-files/cypher/v2/simple.adoc index 796f2f96..81b83553 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/simple.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/simple.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Simple Cypher tests -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,14 +14,13 @@ type Movie { } ---- -== Multi selection, Movie by title +== Single selection, Movie by title .GraphQL-Query [source,graphql] ---- { movies(where: {title: "River Runs Through It, A"}) { - id title } } @@ -39,39 +40,30 @@ type Movie { MATCH (this:Movie) WHERE this.title = $param0 RETURN this { - .id, .title } AS this ---- ''' -== Multi selection, Movie by title via variable +== Multi selection, Movie by title .GraphQL-Query [source,graphql] ---- -query ($title: String) { - movies(where: {title: $title}) { +{ + movies(where: {title: "River Runs Through It, A"}) { id title } } ---- -.GraphQL params input -[source,json,request=true] ----- -{ - "title": "some title" -} ----- - .Expected Cypher params [source,json] ---- { - "param0" : "some title" + "param0" : "River Runs Through It, A" } ---- @@ -88,23 +80,32 @@ RETURN this { ''' -== Single selection, Movie by title +== Multi selection, Movie by title via variable .GraphQL-Query [source,graphql] ---- -{ - movies(where: {title: "River Runs Through It, A"}) { +query ($title: String) { + movies(where: {title: $title}) { + id title } } ---- +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "some title" +} +---- + .Expected Cypher params [source,json] ---- { - "param0" : "River Runs Through It, A" + "param0" : "some title" } ---- @@ -114,6 +115,7 @@ RETURN this { MATCH (this:Movie) WHERE this.title = $param0 RETURN this { + .id, .title } AS this ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/bigint.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/bigint.adoc index b18b2e1a..54b86673 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/bigint.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/bigint.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher BigInt -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type File { @@ -12,13 +14,13 @@ type File { } ---- -== Querying with BigInt as string in AST +== Querying with native BigInt in AST .GraphQL-Query [source,graphql] ---- { - files(where: {size: "9223372036854775807"}) { + files(where: {size: 9223372036854775807}) { name } } @@ -47,26 +49,18 @@ RETURN this { ''' -== Querying with BigInt as string in variables +== Querying with BigInt as string in AST .GraphQL-Query [source,graphql] ---- -query Files($size: BigInt) { - files(where: {size: $size}) { +{ + files(where: {size: "9223372036854775807"}) { name } } ---- -.GraphQL params input -[source,json,request=true] ----- -{ - "size": "9223372036854775807" -} ----- - .Expected Cypher params [source,json] ---- @@ -90,18 +84,26 @@ RETURN this { ''' -== Querying with native BigInt in AST +== Querying with BigInt as string in variables .GraphQL-Query [source,graphql] ---- -{ - files(where: {size: 9223372036854775807}) { +query Files($size: BigInt) { + files(where: {size: $size}) { name } } ---- +.GraphQL params input +[source,json,request=true] +---- +{ + "size": "9223372036854775807" +} +---- + .Expected Cypher params [source,json] ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/date.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/date.adoc index 7ddcfe3e..2a8c602d 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/date.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/date.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher Date -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,13 +14,13 @@ type Movie { } ---- -== GTE Read +== Simple Read .GraphQL-Query [source,graphql] ---- { - movies(where: {date_GTE: "1980-04-08"}) { + movies(where: {date: "1970-01-01"}) { date } } @@ -28,7 +30,7 @@ type Movie { [source,json] ---- { - "param0" : "1980-04-08" + "param0" : "1970-01-01" } ---- @@ -36,7 +38,7 @@ type Movie { [source,cypher] ---- MATCH (this:Movie) -WHERE this.date >= $param0 +WHERE this.date = $param0 RETURN this { .date } AS this @@ -44,13 +46,13 @@ RETURN this { ''' -== Simple Read +== GTE Read .GraphQL-Query [source,graphql] ---- { - movies(where: {date: "1970-01-01"}) { + movies(where: {date_GTE: "1980-04-08"}) { date } } @@ -60,7 +62,7 @@ RETURN this { [source,json] ---- { - "param0" : "1970-01-01" + "param0" : "1980-04-08" } ---- @@ -68,7 +70,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.date = $param0 +WHERE this.date >= $param0 RETURN this { .date } AS this diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/datetime.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/datetime.adoc index d7982fb8..40ac7afc 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/datetime.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/datetime.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher DateTime -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/duration.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/duration.adoc index 4ddbbe0d..625b3b52 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/duration.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/duration.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher Duration -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,13 +14,13 @@ type Movie { } ---- -== GTE Read +== Simple Read .GraphQL-Query [source,graphql] ---- { - movies(where: {duration_GTE: "P3Y4M"}) { + movies(where: {duration: "P1Y"}) { duration } } @@ -28,7 +30,7 @@ type Movie { [source,json] ---- { - "param0" : "P3Y4M" + "param0" : "P1Y" } ---- @@ -36,7 +38,7 @@ type Movie { [source,cypher] ---- MATCH (this:Movie) -WHERE (datetime() + this.duration) >= (datetime() + $param0) +WHERE (datetime() + this.duration) = (datetime() + $param0) RETURN this { .duration } AS this @@ -44,13 +46,13 @@ RETURN this { ''' -== Simple Read +== GTE Read .GraphQL-Query [source,graphql] ---- { - movies(where: {duration: "P1Y"}) { + movies(where: {duration_GTE: "P3Y4M"}) { duration } } @@ -60,7 +62,7 @@ RETURN this { [source,json] ---- { - "param0" : "P1Y" + "param0" : "P3Y4M" } ---- @@ -68,7 +70,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE (datetime() + this.duration) = (datetime() + $param0) +WHERE (datetime() + this.duration) >= (datetime() + $param0) RETURN this { .duration } AS this diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/localdatetime.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/localdatetime.adoc index 16878bd3..3589d8b8 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/localdatetime.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/localdatetime.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher LocalDateTime -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,13 +14,13 @@ type Movie { } ---- -== GTE Read +== Simple Read .GraphQL-Query [source,graphql] ---- { - movies(where: {localDT_GTE: "2010-08-23T13:45:33.250"}) { + movies(where: {localDT: "2003-09-14T12:00:00"}) { localDT } } @@ -28,7 +30,7 @@ type Movie { [source,json] ---- { - "param0" : "2010-08-23T13:45:33.25" + "param0" : "2003-09-14T12:00:00" } ---- @@ -36,7 +38,7 @@ type Movie { [source,cypher] ---- MATCH (this:Movie) -WHERE this.localDT >= $param0 +WHERE this.localDT = $param0 RETURN this { .localDT } AS this @@ -44,13 +46,13 @@ RETURN this { ''' -== Simple Read +== GTE Read .GraphQL-Query [source,graphql] ---- { - movies(where: {localDT: "2003-09-14T12:00:00"}) { + movies(where: {localDT_GTE: "2010-08-23T13:45:33.250"}) { localDT } } @@ -60,7 +62,7 @@ RETURN this { [source,json] ---- { - "param0" : "2003-09-14T12:00:00" + "param0" : "2010-08-23T13:45:33.25" } ---- @@ -68,7 +70,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.localDT = $param0 +WHERE this.localDT >= $param0 RETURN this { .localDT } AS this diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/localtime.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/localtime.adoc index a2617e79..27dd36f9 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/localtime.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/localtime.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher LocalTime -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,13 +14,13 @@ type Movie { } ---- -== GTE Read +== Simple Read .GraphQL-Query [source,graphql] ---- { - movies(where: {time_GTE: "13:45:33.250"}) { + movies(where: {time: "12:00:00"}) { time } } @@ -28,7 +30,7 @@ type Movie { [source,json] ---- { - "param0" : "13:45:33.25" + "param0" : "12:00:00" } ---- @@ -36,7 +38,7 @@ type Movie { [source,cypher] ---- MATCH (this:Movie) -WHERE this.time >= $param0 +WHERE this.time = $param0 RETURN this { .time } AS this @@ -44,13 +46,13 @@ RETURN this { ''' -== Simple Read +== GTE Read .GraphQL-Query [source,graphql] ---- { - movies(where: {time: "12:00:00"}) { + movies(where: {time_GTE: "13:45:33.250"}) { time } } @@ -60,7 +62,7 @@ RETURN this { [source,json] ---- { - "param0" : "12:00:00" + "param0" : "13:45:33.25" } ---- @@ -68,7 +70,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.time = $param0 +WHERE this.time >= $param0 RETURN this { .time } AS this diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/point.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/point.adoc index 668d6cd2..7898ee18 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/point.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/point.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher Points -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type PointContainer { @@ -12,13 +14,13 @@ type PointContainer { } ---- -== Simple Point IN query +== Simple Point query .GraphQL-Query [source,graphql] ---- { - pointContainers(where: {point_IN: [{longitude: 1.0, latitude: 2.0}]}) { + pointContainers(where: {point: {longitude: 1.0, latitude: 2.0}}) { point { longitude latitude @@ -32,10 +34,10 @@ type PointContainer { [source,json] ---- { - "param0" : [ { - "longitude" : 1.0, - "latitude" : 2.0 - } ] + "param0" : { + "longitude" : 1, + "latitude" : 2 + } } ---- @@ -43,7 +45,7 @@ type PointContainer { [source,cypher] ---- MATCH (this:PointContainer) -WHERE this.point IN [p IN $param0 | point(p)] +WHERE this.point = point($param0) RETURN this { point: CASE WHEN this.point IS NOT NULL THEN { longitude: this.point.longitude, @@ -55,13 +57,13 @@ RETURN this { ''' -== Simple Point query +== Simple Point IN query .GraphQL-Query [source,graphql] ---- { - pointContainers(where: {point: {longitude: 1.0, latitude: 2.0}}) { + pointContainers(where: {point_IN: [{longitude: 1.0, latitude: 2.0}]}) { point { longitude latitude @@ -75,10 +77,10 @@ RETURN this { [source,json] ---- { - "param0" : { - "longitude" : 1.0, - "latitude" : 2.0 - } + "param0" : [ { + "longitude" : 1, + "latitude" : 2 + } ] } ---- @@ -86,7 +88,7 @@ RETURN this { [source,cypher] ---- MATCH (this:PointContainer) -WHERE this.point = point($param0) +WHERE this.point IN [p IN $param0 | point(p)] RETURN this { point: CASE WHEN this.point IS NOT NULL THEN { longitude: this.point.longitude, @@ -100,14 +102,14 @@ RETURN this { == tests using describe or point.describe -=== Simple Point DISTANCE query +=== Simple Point LT query .GraphQL-Query [source,graphql] ---- { pointContainers( - where: {point_DISTANCE: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} + where: {point_LT: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} ) { point { longitude @@ -135,7 +137,7 @@ RETURN this { [source,cypher] ---- MATCH (this:PointContainer) -WHERE point.distance(this.point, point($param0.point)) = $param0.distance +WHERE point.distance(this.point, point($param0.point)) < $param0.distance RETURN this { point: CASE WHEN this.point IS NOT NULL THEN { longitude: this.point.longitude, @@ -146,14 +148,14 @@ RETURN this { ''' -=== Simple Point GT query +=== Simple Point LTE query .GraphQL-Query [source,graphql] ---- { pointContainers( - where: {point_GT: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} + where: {point_LTE: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} ) { point { longitude @@ -181,7 +183,7 @@ RETURN this { [source,cypher] ---- MATCH (this:PointContainer) -WHERE point.distance(this.point, point($param0.point)) > $param0.distance +WHERE point.distance(this.point, point($param0.point)) <= $param0.distance RETURN this { point: CASE WHEN this.point IS NOT NULL THEN { longitude: this.point.longitude, @@ -192,14 +194,14 @@ RETURN this { ''' -=== Simple Point GTE query +=== Simple Point GT query .GraphQL-Query [source,graphql] ---- { pointContainers( - where: {point_GTE: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} + where: {point_GT: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} ) { point { longitude @@ -227,7 +229,7 @@ RETURN this { [source,cypher] ---- MATCH (this:PointContainer) -WHERE point.distance(this.point, point($param0.point)) >= $param0.distance +WHERE point.distance(this.point, point($param0.point)) > $param0.distance RETURN this { point: CASE WHEN this.point IS NOT NULL THEN { longitude: this.point.longitude, @@ -238,14 +240,14 @@ RETURN this { ''' -=== Simple Point LT query +=== Simple Point GTE query .GraphQL-Query [source,graphql] ---- { pointContainers( - where: {point_LT: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} + where: {point_GTE: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} ) { point { longitude @@ -273,7 +275,7 @@ RETURN this { [source,cypher] ---- MATCH (this:PointContainer) -WHERE point.distance(this.point, point($param0.point)) < $param0.distance +WHERE point.distance(this.point, point($param0.point)) >= $param0.distance RETURN this { point: CASE WHEN this.point IS NOT NULL THEN { longitude: this.point.longitude, @@ -284,14 +286,14 @@ RETURN this { ''' -=== Simple Point LTE query +=== Simple Point DISTANCE query .GraphQL-Query [source,graphql] ---- { pointContainers( - where: {point_LTE: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} + where: {point_DISTANCE: {point: {longitude: 1.1, latitude: 2.2}, distance: 3.3}} ) { point { longitude @@ -319,7 +321,7 @@ RETURN this { [source,cypher] ---- MATCH (this:PointContainer) -WHERE point.distance(this.point, point($param0.point)) <= $param0.distance +WHERE point.distance(this.point, point($param0.point)) = $param0.distance RETURN this { point: CASE WHEN this.point IS NOT NULL THEN { longitude: this.point.longitude, @@ -330,4 +332,3 @@ RETURN this { ''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/points.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/points.adoc index 29b452b0..c552f45d 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/points.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/points.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher Points -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type PointContainer { @@ -12,13 +14,13 @@ type PointContainer { } ---- -== Simple Points INCLUDES query +== Simple Points query .GraphQL-Query [source,graphql] ---- { - pointContainers(where: {points_INCLUDES: {longitude: 1.0, latitude: 2.0}}) { + pointContainers(where: {points: [{longitude: 1.0, latitude: 2.0}]}) { points { longitude latitude @@ -32,10 +34,10 @@ type PointContainer { [source,json] ---- { - "param0" : { - "longitude" : 1.0, - "latitude" : 2.0 - } + "param0" : [ { + "longitude" : 1, + "latitude" : 2 + } ] } ---- @@ -43,7 +45,7 @@ type PointContainer { [source,cypher] ---- MATCH (this:PointContainer) -WHERE point($param0) IN this.points +WHERE this.points = [p IN $param0 | point(p)] RETURN this { points: CASE WHEN this.points IS NOT NULL THEN [p_var0 IN this.points | { longitude: p_var0.longitude, @@ -55,13 +57,13 @@ RETURN this { ''' -== Simple Points query +== Simple Points INCLUDES query .GraphQL-Query [source,graphql] ---- { - pointContainers(where: {points: [{longitude: 1.0, latitude: 2.0}]}) { + pointContainers(where: {points_INCLUDES: {longitude: 1.0, latitude: 2.0}}) { points { longitude latitude @@ -75,10 +77,10 @@ RETURN this { [source,json] ---- { - "param0" : [ { - "longitude" : 1.0, - "latitude" : 2.0 - } ] + "param0" : { + "longitude" : 1, + "latitude" : 2 + } } ---- @@ -86,7 +88,7 @@ RETURN this { [source,cypher] ---- MATCH (this:PointContainer) -WHERE this.points = [p IN $param0 | point(p)] +WHERE point($param0) IN this.points RETURN this { points: CASE WHEN this.points IS NOT NULL THEN [p_var0 IN this.points | { longitude: p_var0.longitude, diff --git a/core/src/test/resources/tck-test-files/cypher/v2/types/time.adoc b/core/src/test/resources/tck-test-files/cypher/v2/types/time.adoc index 7a85c322..b69e71b0 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/types/time.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/types/time.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher Time -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,13 +14,13 @@ type Movie { } ---- -== GTE Read +== Simple Read .GraphQL-Query [source,graphql] ---- { - movies(where: {time_GTE: "13:45:33.250"}) { + movies(where: {time: "12:00:00"}) { time } } @@ -28,7 +30,7 @@ type Movie { [source,json] ---- { - "param0" : "13:45:33.250Z" + "param0" : "12:00Z" } ---- @@ -36,7 +38,7 @@ type Movie { [source,cypher] ---- MATCH (this:Movie) -WHERE this.time >= $param0 +WHERE this.time = $param0 RETURN this { .time } AS this @@ -44,13 +46,13 @@ RETURN this { ''' -== Simple Read +== GTE Read .GraphQL-Query [source,graphql] ---- { - movies(where: {time: "12:00:00"}) { + movies(where: {time_GTE: "13:45:33.250"}) { time } } @@ -60,7 +62,7 @@ RETURN this { [source,json] ---- { - "param0" : "12:00Z" + "param0" : "13:45:33.250Z" } ---- @@ -68,7 +70,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.time = $param0 +WHERE this.time >= $param0 RETURN this { .time } AS this diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection.adoc new file mode 100644 index 00000000..a5e3ee7d --- /dev/null +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection.adoc @@ -0,0 +1,197 @@ +:toc: +:toclevels: 42 + += QueryDirection in relationships connection + +== query with directed and undirected relationships with a DEFAULT_UNDIRECTED + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DEFAULT_UNDIRECTED) +} +---- + +.GraphQL-Query +[source,graphql] +---- +query FriendsAggregate { + users { + friendsConnection { + totalCount + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) + WITH collect( { + node: user0, + relationship: friendsWith0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS user0, edge.relationship AS friendsWith0 + RETURN collect( { + node: { + __id: elementId(user0), + __typename: 'User' + } + }) AS friendsConnectionEdges + } + RETURN { + edges: friendsConnectionEdges, + totalCount: totalCount + } AS friendsConnection +} +RETURN this { + friendsConnection: friendsConnection +} AS this +---- + +''' + +== query connection with a DIRECTED_ONLY relationship + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DIRECTED_ONLY) +} +---- + +.GraphQL-Query +[source,graphql] +---- +query FriendsAggregate { + users { + friendsConnection { + totalCount + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[friendsWith0:FRIENDS_WITH]->(user0:User) + WITH collect( { + node: user0, + relationship: friendsWith0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS user0, edge.relationship AS friendsWith0 + RETURN collect( { + node: { + __id: elementId(user0), + __typename: 'User' + } + }) AS friendsConnectionEdges + } + RETURN { + edges: friendsConnectionEdges, + totalCount: totalCount + } AS friendsConnection +} +RETURN this { + friendsConnection: friendsConnection +} AS this +---- + +''' + +== query with a UNDIRECTED_ONLY relationship + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: UNDIRECTED_ONLY) +} +---- + +.GraphQL-Query +[source,graphql] +---- +query FriendsAggregate { + users { + friendsConnection { + totalCount + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) + WITH collect( { + node: user0, + relationship: friendsWith0 + }) AS edges + WITH edges, size(edges) AS totalCount + CALL { + WITH edges + UNWIND edges AS edge + WITH edge.node AS user0, edge.relationship AS friendsWith0 + RETURN collect( { + node: { + __id: elementId(user0), + __typename: 'User' + } + }) AS friendsConnectionEdges + } + RETURN { + edges: friendsConnectionEdges, + totalCount: totalCount + } AS friendsConnection +} +RETURN this { + friendsConnection: friendsConnection +} AS this +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_1.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_1.adoc deleted file mode 100644 index 1d534e8c..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_1.adoc +++ /dev/null @@ -1,69 +0,0 @@ -:toc: - -= QueryDirection in relationships connection - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DEFAULT_UNDIRECTED) -} ----- - -== query with directed and undirected relationships with a DEFAULT_UNDIRECTED - -.GraphQL-Query -[source,graphql] ----- -query FriendsAggregate { - users { - friendsConnection { - totalCount - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) - WITH collect( { - node: user0, - relationship: friendsWith0 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS user0, edge.relationship AS friendsWith0 - RETURN collect( { - node: { - __id: elementId(user0), - __typename: 'User' - } - }) AS friendsConnectionEdges - } - RETURN { - edges: friendsConnectionEdges, - totalCount: totalCount - } AS friendsConnection -} -RETURN this { - friendsConnection: friendsConnection -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_2.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_2.adoc deleted file mode 100644 index 6e6a5d42..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_2.adoc +++ /dev/null @@ -1,69 +0,0 @@ -:toc: - -= QueryDirection in relationships connection - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DIRECTED_ONLY) -} ----- - -== query connection with a DIRECTED_ONLY relationship - -.GraphQL-Query -[source,graphql] ----- -query FriendsAggregate { - users { - friendsConnection { - totalCount - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[friendsWith0:FRIENDS_WITH]->(user0:User) - WITH collect( { - node: user0, - relationship: friendsWith0 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS user0, edge.relationship AS friendsWith0 - RETURN collect( { - node: { - __id: elementId(user0), - __typename: 'User' - } - }) AS friendsConnectionEdges - } - RETURN { - edges: friendsConnectionEdges, - totalCount: totalCount - } AS friendsConnection -} -RETURN this { - friendsConnection: friendsConnection -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_3.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_3.adoc deleted file mode 100644 index 2edb3f89..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction-connection_3.adoc +++ /dev/null @@ -1,69 +0,0 @@ -:toc: - -= QueryDirection in relationships connection - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: UNDIRECTED_ONLY) -} ----- - -== query with a UNDIRECTED_ONLY relationship - -.GraphQL-Query -[source,graphql] ----- -query FriendsAggregate { - users { - friendsConnection { - totalCount - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) - WITH collect( { - node: user0, - relationship: friendsWith0 - }) AS edges - WITH edges, size(edges) AS totalCount - CALL { - WITH edges - UNWIND edges AS edge - WITH edge.node AS user0, edge.relationship AS friendsWith0 - RETURN collect( { - node: { - __id: elementId(user0), - __typename: 'User' - } - }) AS friendsConnectionEdges - } - RETURN { - edges: friendsConnectionEdges, - totalCount: totalCount - } AS friendsConnection -} -RETURN this { - friendsConnection: friendsConnection -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction.adoc new file mode 100644 index 00000000..210a4fb8 --- /dev/null +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction.adoc @@ -0,0 +1,229 @@ +:toc: +:toclevels: 42 + += QueryDirection in relationships + +== query with directed and undirected relationships with DEFAULT_UNDIRECTED + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DEFAULT_UNDIRECTED) +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + users { + name + friends: friends { + name + } + directedFriends: friends(directed: true) { + name + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) + WITH user0 { + .name + } AS friends + RETURN collect(friends) AS friends +} +CALL { + WITH this + MATCH (this)-[friendsWith1:FRIENDS_WITH]->(user1:User) + WITH user1 { + .name + } AS directedFriends + RETURN collect(directedFriends) AS directedFriends +} +RETURN this { + .name, + friends: friends, + directedFriends: directedFriends +} AS this +---- + +''' + +== query with directed and undirected relationships with a DEFAULT_DIRECTED + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DEFAULT_DIRECTED) +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + users { + name + friends: friends { + name + } + undirectedFriends: friends(directed: false) { + name + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[friendsWith0:FRIENDS_WITH]->(user0:User) + WITH user0 { + .name + } AS friends + RETURN collect(friends) AS friends +} +CALL { + WITH this + MATCH (this)-[friendsWith1:FRIENDS_WITH]-(user1:User) + WITH user1 { + .name + } AS undirectedFriends + RETURN collect(undirectedFriends) AS undirectedFriends +} +RETURN this { + .name, + friends: friends, + undirectedFriends: undirectedFriends +} AS this +---- + +''' + +== query with a DIRECTED_ONLY relationship + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DIRECTED_ONLY) +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + users { + name + friends: friends { + name + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[friendsWith0:FRIENDS_WITH]->(user0:User) + WITH user0 { + .name + } AS friends + RETURN collect(friends) AS friends +} +RETURN this { + .name, + friends: friends +} AS this +---- + +''' + +== query with a UNDIRECTED_ONLY relationship + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: UNDIRECTED_ONLY) +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + users { + name + friends: friends { + name + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) + WITH user0 { + .name + } AS friends + RETURN collect(friends) AS friends +} +RETURN this { + .name, + friends: friends +} AS this +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_1.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_1.adoc deleted file mode 100644 index aba52d11..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_1.adoc +++ /dev/null @@ -1,67 +0,0 @@ -:toc: - -= QueryDirection in relationships - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DEFAULT_UNDIRECTED) -} ----- - -== query with directed and undirected relationships with DEFAULT_UNDIRECTED - -.GraphQL-Query -[source,graphql] ----- -{ - users { - name - friends: friends { - name - } - directedFriends: friends(directed: true) { - name - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) - WITH user0 { - .name - } AS friends - RETURN collect(friends) AS friends -} -CALL { - WITH this - MATCH (this)-[friendsWith1:FRIENDS_WITH]->(user1:User) - WITH user1 { - .name - } AS directedFriends - RETURN collect(directedFriends) AS directedFriends -} -RETURN this { - .name, - friends: friends, - directedFriends: directedFriends -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_2.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_2.adoc deleted file mode 100644 index 0c77b353..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_2.adoc +++ /dev/null @@ -1,67 +0,0 @@ -:toc: - -= QueryDirection in relationships - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DEFAULT_DIRECTED) -} ----- - -== query with directed and undirected relationships with a DEFAULT_DIRECTED - -.GraphQL-Query -[source,graphql] ----- -{ - users { - name - friends: friends { - name - } - undirectedFriends: friends(directed: false) { - name - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[friendsWith0:FRIENDS_WITH]->(user0:User) - WITH user0 { - .name - } AS friends - RETURN collect(friends) AS friends -} -CALL { - WITH this - MATCH (this)-[friendsWith1:FRIENDS_WITH]-(user1:User) - WITH user1 { - .name - } AS undirectedFriends - RETURN collect(undirectedFriends) AS undirectedFriends -} -RETURN this { - .name, - friends: friends, - undirectedFriends: undirectedFriends -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_3.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_3.adoc deleted file mode 100644 index 02770711..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_3.adoc +++ /dev/null @@ -1,55 +0,0 @@ -:toc: - -= QueryDirection in relationships - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DIRECTED_ONLY) -} ----- - -== query with a DIRECTED_ONLY relationship - -.GraphQL-Query -[source,graphql] ----- -{ - users { - name - friends: friends { - name - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[friendsWith0:FRIENDS_WITH]->(user0:User) - WITH user0 { - .name - } AS friends - RETURN collect(friends) AS friends -} -RETURN this { - .name, - friends: friends -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_4.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_4.adoc deleted file mode 100644 index 3e27e5ec..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/query-direction_4.adoc +++ /dev/null @@ -1,55 +0,0 @@ -:toc: - -= QueryDirection in relationships - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: UNDIRECTED_ONLY) -} ----- - -== query with a UNDIRECTED_ONLY relationship - -.GraphQL-Query -[source,graphql] ----- -{ - users { - name - friends: friends { - name - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) - WITH user0 { - .name - } AS friends - RETURN collect(friends) AS friends -} -RETURN this { - .name, - friends: friends -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-connection.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-connection.adoc index a7fa26cf..bfad5043 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-connection.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-connection.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Undirected connections -== Source schema +== query with undirected aggregation +.Schema [source,graphql,schema=true] ---- type User { @@ -12,8 +14,6 @@ type User { } ---- -== query with undirected aggregation - .GraphQL-Query [source,graphql] ---- diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships.adoc new file mode 100644 index 00000000..d8edcd8e --- /dev/null +++ b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships.adoc @@ -0,0 +1,230 @@ +:toc: +:toclevels: 42 + += Undirected relationships + +== query with directed and undirected relationships + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT) +} +---- + +.GraphQL-Query +[source,graphql] +---- +{ + users { + name + friends: friends(directed: false) { + name + } + directedFriends: friends { + name + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + MATCH (this)-[friendsWith0:FRIENDS_WITH]-(user0:User) + WITH user0 { + .name + } AS friends + RETURN collect(friends) AS friends +} +CALL { + WITH this + MATCH (this)-[friendsWith1:FRIENDS_WITH]->(user1:User) + WITH user1 { + .name + } AS directedFriends + RETURN collect(directedFriends) AS directedFriends +} +RETURN this { + .name, + friends: friends, + directedFriends: directedFriends +} AS this +---- + +''' + +== undirected with unions + +.Schema +[source,graphql,schema=true] +---- +union Content = Blog | Post + +type Blog { + title: String + posts: [Post!]! @relationship(type: "HAS_POST", direction: OUT) +} + +type Post { + content: String +} + +type User { + name: String + content: [Content!]! @relationship(type: "HAS_CONTENT", direction: OUT) +} +---- + +.GraphQL-Query +[source,graphql] +---- +query Users { + users { + content(directed: false) { + ... on Blog { + title + } + ... on Post { + content + } + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:User) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[hasContent0:HAS_CONTENT]-(blog0:Blog) + WITH blog0 { + __typename: 'Blog', + __id: elementId(blog0), + .title + } AS blog0 + RETURN blog0 AS content0 UNION + WITH * + MATCH (this)-[hasContent1:HAS_CONTENT]-(post0:Post) + WITH post0 { + __typename: 'Post', + __id: elementId(post0), + .content + } AS post0 + RETURN post0 AS content0 + } + WITH content0 + RETURN collect(content0) AS content0 +} +RETURN this { + content: content0 +} AS this +---- + +''' + +== undirected with interfaces + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! + actors: [Actor!]! +} + +type Movie implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") + runtime: Int! +} + +type Series implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") + episodes: Int! +} + +type ActedIn @relationshipProperties { + role: String! +} + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.GraphQL-Query +[source,graphql] +---- +query Actors { + actors { + actedIn(directed: false) { + title + } + } +} +---- + +.Expected Cypher params +[source,json] +---- +{ } +---- + +.Expected Cypher output +[source,cypher] +---- +MATCH (this:Actor) +CALL { + WITH this + CALL { + WITH * + MATCH (this)-[actedIn0:ACTED_IN]-(movie0:Movie) + WITH movie0 { + __typename: 'Movie', + __id: elementId(movie0), + .title + } AS movie0 + RETURN movie0 AS actedIn UNION + WITH * + MATCH (this)-[actedIn1:ACTED_IN]-(series0:Series) + WITH series0 { + __typename: 'Series', + __id: elementId(series0), + .title + } AS series0 + RETURN series0 AS actedIn + } + WITH actedIn + RETURN collect(actedIn) AS actedIn +} +RETURN this { + actedIn: actedIn +} AS this +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_2.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_2.adoc deleted file mode 100644 index 2385c297..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_2.adoc +++ /dev/null @@ -1,84 +0,0 @@ -:toc: - -= Undirected relationships - -== Source schema - -[source,graphql,schema=true] ----- -union Content = Blog | Post - -type Blog { - title: String - posts: [Post!]! @relationship(type: "HAS_POST", direction: OUT) -} - -type Post { - content: String -} - -type User { - name: String - content: [Content!]! @relationship(type: "HAS_CONTENT", direction: OUT) -} ----- - -== undirected with unions - -.GraphQL-Query -[source,graphql] ----- -query Users { - users { - content(directed: false) { - ... on Blog { - title - } - ... on Post { - content - } - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:User) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[hasContent0:HAS_CONTENT]-(blog0:Blog) - WITH blog0 { - __typename: 'Blog', - __id: elementId(blog0), - .title - } AS blog0 - RETURN blog0 AS content0 UNION - WITH * - MATCH (this)-[hasContent1:HAS_CONTENT]-(post0:Post) - WITH post0 { - __typename: 'Post', - __id: elementId(post0), - .content - } AS post0 - RETURN post0 AS content0 - } - WITH content0 - RETURN collect(content0) AS content0 -} -RETURN this { - content: content0 -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_3.adoc b/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_3.adoc deleted file mode 100644 index 8cabde63..00000000 --- a/core/src/test/resources/tck-test-files/cypher/v2/undirected-relationships/undirected-relationships_3.adoc +++ /dev/null @@ -1,89 +0,0 @@ -:toc: - -= Undirected relationships - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! - actors: [Actor!]! -} - -type Movie implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") - runtime: Int! -} - -type Series implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") - episodes: Int! -} - -type ActedIn @relationshipProperties { - role: String! -} - -type Actor { - name: String! - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== undirected with interfaces - -.GraphQL-Query -[source,graphql] ----- -query Actors { - actors { - actedIn(directed: false) { - title - } - } -} ----- - -.Expected Cypher params -[source,json] ----- -{ } ----- - -.Expected Cypher output -[source,cypher] ----- -MATCH (this:Actor) -CALL { - WITH this - CALL { - WITH * - MATCH (this)-[actedIn0:ACTED_IN]-(movie0:Movie) - WITH movie0 { - __typename: 'Movie', - __id: elementId(movie0), - .title - } AS movie0 - RETURN movie0 AS actedIn UNION - WITH * - MATCH (this)-[actedIn1:ACTED_IN]-(series0:Series) - WITH series0 { - __typename: 'Series', - __id: elementId(series0), - .title - } AS series0 - RETURN series0 AS actedIn - } - WITH actedIn - RETURN collect(actedIn) AS actedIn -} -RETURN this { - actedIn: actedIn -} AS this ----- - -''' - diff --git a/core/src/test/resources/tck-test-files/cypher/v2/where.adoc b/core/src/test/resources/tck-test-files/cypher/v2/where.adoc index 32bc4bdf..d6fa176c 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/where.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/where.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Cypher WHERE -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- type Actor { @@ -19,23 +21,33 @@ type Movie { } ---- -== Nested AND +== Simple .GraphQL-Query [source,graphql] ---- -{ - movies(where: {AND: [{AND: [{title: "some title"}]}]}) { +query ($title: String, $isFavorite: Boolean) { + movies(where: {title: $title, isFavorite: $isFavorite}) { title } } ---- +.GraphQL params input +[source,json,request=true] +---- +{ + "title": "some title", + "isFavorite": true +} +---- + .Expected Cypher params [source,json] ---- { - "param0" : "some title" + "param0" : "some title", + "param1" : true } ---- @@ -43,7 +55,8 @@ type Movie { [source,cypher] ---- MATCH (this:Movie) -WHERE this.title = $param0 +WHERE (this.title = $param0 + AND this.isFavorite = $param1) RETURN this { .title } AS this @@ -51,13 +64,13 @@ RETURN this { ''' -== Nested AND and OR +== Simple AND .GraphQL-Query [source,graphql] ---- { - movies(where: {AND: [{OR: [{title: "some title"}, {isFavorite: true}], id: 2}]}) { + movies(where: {AND: [{title: "some title"}]}) { title } } @@ -67,9 +80,7 @@ RETURN this { [source,json] ---- { - "param0" : "some title", - "param1" : true, - "param2" : "2" + "param0" : "some title" } ---- @@ -77,9 +88,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE ((this.title = $param0 - OR this.isFavorite = $param1) - AND this.id = $param2) +WHERE this.title = $param0 RETURN this { .title } AS this @@ -87,13 +96,13 @@ RETURN this { ''' -== Nested AND with multiple properties +== Simple AND with multiple parameters .GraphQL-Query [source,graphql] ---- { - movies(where: {AND: [{AND: [{title: "some title"}, {title: "another title"}]}]}) { + movies(where: {AND: [{title: "some title"}, {isFavorite: true}]}) { title } } @@ -104,7 +113,7 @@ RETURN this { ---- { "param0" : "some title", - "param1" : "another title" + "param1" : true } ---- @@ -113,7 +122,7 @@ RETURN this { ---- MATCH (this:Movie) WHERE (this.title = $param0 - AND this.title = $param1) + AND this.isFavorite = $param1) RETURN this { .title } AS this @@ -121,13 +130,13 @@ RETURN this { ''' -== Nested OR +== Nested AND .GraphQL-Query [source,graphql] ---- { - movies(where: {OR: [{OR: [{title: "some title"}]}]}) { + movies(where: {AND: [{AND: [{title: "some title"}]}]}) { title } } @@ -153,33 +162,24 @@ RETURN this { ''' -== Simple +== Nested AND with multiple properties .GraphQL-Query [source,graphql] ---- -query ($title: String, $isFavorite: Boolean) { - movies(where: {title: $title, isFavorite: $isFavorite}) { +{ + movies(where: {AND: [{AND: [{title: "some title"}, {title: "another title"}]}]}) { title } } ---- -.GraphQL params input -[source,json,request=true] ----- -{ - "title": "some title", - "isFavorite": true -} ----- - .Expected Cypher params [source,json] ---- { "param0" : "some title", - "param1" : true + "param1" : "another title" } ---- @@ -188,7 +188,7 @@ query ($title: String, $isFavorite: Boolean) { ---- MATCH (this:Movie) WHERE (this.title = $param0 - AND this.isFavorite = $param1) + AND this.title = $param1) RETURN this { .title } AS this @@ -196,13 +196,13 @@ RETURN this { ''' -== Simple AND +== Nested AND and OR .GraphQL-Query [source,graphql] ---- { - movies(where: {AND: [{title: "some title"}]}) { + movies(where: {AND: [{OR: [{title: "some title"}, {isFavorite: true}], id: 2}]}) { title } } @@ -212,7 +212,9 @@ RETURN this { [source,json] ---- { - "param0" : "some title" + "param0" : "some title", + "param1" : true, + "param2" : "2" } ---- @@ -220,7 +222,9 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.title = $param0 +WHERE ((this.title = $param0 + OR this.isFavorite = $param1) + AND this.id = $param2) RETURN this { .title } AS this @@ -228,13 +232,13 @@ RETURN this { ''' -== Simple AND with multiple parameters +== Super Nested AND .GraphQL-Query [source,graphql] ---- { - movies(where: {AND: [{title: "some title"}, {isFavorite: true}]}) { + movies(where: {AND: [{AND: [{AND: [{title: "some title"}]}]}]}) { title } } @@ -244,8 +248,7 @@ RETURN this { [source,json] ---- { - "param0" : "some title", - "param1" : true + "param0" : "some title" } ---- @@ -253,8 +256,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE (this.title = $param0 - AND this.isFavorite = $param1) +WHERE this.title = $param0 RETURN this { .title } AS this @@ -262,13 +264,13 @@ RETURN this { ''' -== Simple NOT +== Simple OR .GraphQL-Query [source,graphql] ---- { - movies(where: {NOT: {title: "some title"}}) { + movies(where: {OR: [{title: "some title"}]}) { title } } @@ -286,7 +288,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE NOT (this.title = $param0) +WHERE this.title = $param0 RETURN this { .title } AS this @@ -294,13 +296,13 @@ RETURN this { ''' -== Simple NOT, implicit AND +== Nested OR .GraphQL-Query [source,graphql] ---- { - movies(where: {NOT: {title: "some title", isFavorite: false}}) { + movies(where: {OR: [{OR: [{title: "some title"}]}]}) { title } } @@ -310,8 +312,7 @@ RETURN this { [source,json] ---- { - "param0" : "some title", - "param1" : false + "param0" : "some title" } ---- @@ -319,8 +320,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE NOT ((this.title = $param0 - AND this.isFavorite = $param1)) +WHERE this.title = $param0 RETURN this { .title } AS this @@ -328,13 +328,13 @@ RETURN this { ''' -== Simple OR +== Super Nested OR .GraphQL-Query [source,graphql] ---- { - movies(where: {OR: [{title: "some title"}]}) { + movies(where: {OR: [{OR: [{OR: [{title: "some title"}]}]}]}) { title } } @@ -360,13 +360,15 @@ RETURN this { ''' -== Super Nested AND +== Where with null + +=== Match with NULL in where .GraphQL-Query [source,graphql] ---- { - movies(where: {AND: [{AND: [{AND: [{title: "some title"}]}]}]}) { + movies(where: {title: null}) { title } } @@ -375,16 +377,14 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ - "param0" : "some title" -} +{ } ---- .Expected Cypher output [source,cypher] ---- MATCH (this:Movie) -WHERE this.title = $param0 +WHERE this.title IS NULL RETURN this { .title } AS this @@ -392,13 +392,13 @@ RETURN this { ''' -== Super Nested OR +== Simple NOT .GraphQL-Query [source,graphql] ---- { - movies(where: {OR: [{OR: [{OR: [{title: "some title"}]}]}]}) { + movies(where: {NOT: {title: "some title"}}) { title } } @@ -416,7 +416,7 @@ RETURN this { [source,cypher] ---- MATCH (this:Movie) -WHERE this.title = $param0 +WHERE NOT (this.title = $param0) RETURN this { .title } AS this @@ -424,15 +424,13 @@ RETURN this { ''' -== Where with null - -=== Match with NULL in where +== Simple NOT, implicit AND .GraphQL-Query [source,graphql] ---- { - movies(where: {title: null}) { + movies(where: {NOT: {title: "some title", isFavorite: false}}) { title } } @@ -441,14 +439,18 @@ RETURN this { .Expected Cypher params [source,json] ---- -{ } +{ + "param0" : "some title", + "param1" : false +} ---- .Expected Cypher output [source,cypher] ---- MATCH (this:Movie) -WHERE this.title IS NULL +WHERE NOT ((this.title = $param0 + AND this.isFavorite = $param1)) RETURN this { .title } AS this @@ -456,4 +458,3 @@ RETURN this { ''' - diff --git a/core/src/test/resources/tck-test-files/schema/v2/aggregations/where-level-aggregations.adoc b/core/src/test/resources/tck-test-files/schema/v2/aggregations.adoc similarity index 68% rename from core/src/test/resources/tck-test-files/schema/v2/aggregations/where-level-aggregations.adoc rename to core/src/test/resources/tck-test-files/schema/v2/aggregations.adoc index 1535f91f..c9e68818 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/aggregations/where-level-aggregations.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/aggregations.adoc @@ -1,9 +1,197 @@ :toc: +:toclevels: 42 -= Aggregations -> Where Level Aggregations += Aggregations -== Source schema +== Top Level Aggregations +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + isbn: String! + title: String + createdAt: DateTime + someTime: Time + someLocalTime: LocalTime + someLocalDateTime: LocalDateTime + imdbRating: Float + someInt: Int + someBigInt: BigInt + screenTime: Duration +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + createdAt: DateTime + id: ID + imdbRating: Float + isbn: String! + screenTime: Duration + someBigInt: BigInt + someInt: Int + someLocalDateTime: LocalDateTime + someLocalTime: LocalTime + someTime: Time + title: String +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +"A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string." +scalar BigInt + +"A date and time, represented as an ISO-8601 string" +scalar DateTime + +"A duration, represented as an ISO 8601 duration string" +scalar Duration + +"A local datetime, represented as 'YYYY-MM-DDTHH:MM:SS'" +scalar LocalDateTime + +"A local time, represented as a time string without timezone information" +scalar LocalTime + +"A time, represented as an RFC3339 time string" +scalar Time + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + createdAt: SortDirection + id: SortDirection + imdbRating: SortDirection + isbn: SortDirection + screenTime: SortDirection + someBigInt: SortDirection + someInt: SortDirection + someLocalDateTime: SortDirection + someLocalTime: SortDirection + someTime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + createdAt: DateTime + createdAt_GT: DateTime + createdAt_GTE: DateTime + createdAt_IN: [DateTime] + createdAt_LT: DateTime + createdAt_LTE: DateTime + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + imdbRating: Float + imdbRating_GT: Float + imdbRating_GTE: Float + imdbRating_IN: [Float] + imdbRating_LT: Float + imdbRating_LTE: Float + isbn: String + isbn_CONTAINS: String + isbn_ENDS_WITH: String + isbn_IN: [String!] + isbn_STARTS_WITH: String + screenTime: Duration + screenTime_GT: Duration + screenTime_GTE: Duration + screenTime_IN: [Duration] + screenTime_LT: Duration + screenTime_LTE: Duration + someBigInt: BigInt + someBigInt_GT: BigInt + someBigInt_GTE: BigInt + someBigInt_IN: [BigInt] + someBigInt_LT: BigInt + someBigInt_LTE: BigInt + someInt: Int + someInt_GT: Int + someInt_GTE: Int + someInt_IN: [Int] + someInt_LT: Int + someInt_LTE: Int + someLocalDateTime: LocalDateTime + someLocalDateTime_GT: LocalDateTime + someLocalDateTime_GTE: LocalDateTime + someLocalDateTime_IN: [LocalDateTime] + someLocalDateTime_LT: LocalDateTime + someLocalDateTime_LTE: LocalDateTime + someLocalTime: LocalTime + someLocalTime_GT: LocalTime + someLocalTime_GTE: LocalTime + someLocalTime_IN: [LocalTime] + someLocalTime_LT: LocalTime + someLocalTime_LTE: LocalTime + someTime: Time + someTime_GT: Time + someTime_GTE: Time + someTime_IN: [Time] + someTime_LT: Time + someTime_LTE: Time + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +== Where Level Aggregations + +.Schema [source,graphql,schema=true] ---- type User { @@ -38,8 +226,6 @@ type Likes @relationshipProperties { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -375,3 +561,4 @@ input UserWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/aggregations/top-level-aggregations.adoc b/core/src/test/resources/tck-test-files/schema/v2/aggregations/top-level-aggregations.adoc deleted file mode 100644 index 98026b03..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/aggregations/top-level-aggregations.adoc +++ /dev/null @@ -1,190 +0,0 @@ -:toc: - -= Aggregations -> Top Level Aggregations - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - isbn: String! - title: String - createdAt: DateTime - someTime: Time - someLocalTime: LocalTime - someLocalDateTime: LocalDateTime - imdbRating: Float - someInt: Int - someBigInt: BigInt - screenTime: Duration -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - createdAt: DateTime - id: ID - imdbRating: Float - isbn: String! - screenTime: Duration - someBigInt: BigInt - someInt: Int - someLocalDateTime: LocalDateTime - someLocalTime: LocalTime - someTime: Time - title: String -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -"A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string." -scalar BigInt - -"A date and time, represented as an ISO-8601 string" -scalar DateTime - -"A duration, represented as an ISO 8601 duration string" -scalar Duration - -"A local datetime, represented as 'YYYY-MM-DDTHH:MM:SS'" -scalar LocalDateTime - -"A local time, represented as a time string without timezone information" -scalar LocalTime - -"A time, represented as an RFC3339 time string" -scalar Time - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - createdAt: SortDirection - id: SortDirection - imdbRating: SortDirection - isbn: SortDirection - screenTime: SortDirection - someBigInt: SortDirection - someInt: SortDirection - someLocalDateTime: SortDirection - someLocalTime: SortDirection - someTime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - createdAt: DateTime - createdAt_GT: DateTime - createdAt_GTE: DateTime - createdAt_IN: [DateTime] - createdAt_LT: DateTime - createdAt_LTE: DateTime - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - imdbRating: Float - imdbRating_GT: Float - imdbRating_GTE: Float - imdbRating_IN: [Float] - imdbRating_LT: Float - imdbRating_LTE: Float - isbn: String - isbn_CONTAINS: String - isbn_ENDS_WITH: String - isbn_IN: [String!] - isbn_STARTS_WITH: String - screenTime: Duration - screenTime_GT: Duration - screenTime_GTE: Duration - screenTime_IN: [Duration] - screenTime_LT: Duration - screenTime_LTE: Duration - someBigInt: BigInt - someBigInt_GT: BigInt - someBigInt_GTE: BigInt - someBigInt_IN: [BigInt] - someBigInt_LT: BigInt - someBigInt_LTE: BigInt - someInt: Int - someInt_GT: Int - someInt_GTE: Int - someInt_IN: [Int] - someInt_LT: Int - someInt_LTE: Int - someLocalDateTime: LocalDateTime - someLocalDateTime_GT: LocalDateTime - someLocalDateTime_GTE: LocalDateTime - someLocalDateTime_IN: [LocalDateTime] - someLocalDateTime_LT: LocalDateTime - someLocalDateTime_LTE: LocalDateTime - someLocalTime: LocalTime - someLocalTime_GT: LocalTime - someLocalTime_GTE: LocalTime - someLocalTime_IN: [LocalTime] - someLocalTime_LT: LocalTime - someLocalTime_LTE: LocalTime - someTime: Time - someTime_GT: Time - someTime_GTE: Time - someTime_IN: [Time] - someTime_LT: Time - someTime_LTE: Time - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/array-methods.adoc b/core/src/test/resources/tck-test-files/schema/v2/array-methods.adoc index 69498258..5e496779 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/array-methods.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/array-methods.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Arrays Methods -> Array of Float and Array of Actor relationships += Arrays Methods -== Source schema +== Array of Float and Array of Actor relationships +.Schema [source,graphql,schema=true] ---- type Actor { @@ -23,8 +25,6 @@ type ActedIn @relationshipProperties { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -252,3 +252,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/arrays.adoc b/core/src/test/resources/tck-test-files/schema/v2/arrays.adoc index 640c62a3..7acd7f24 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/arrays.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/arrays.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Arrays -== Source schema +== Arrays +.Schema [source,graphql,schema=true] ---- type Movie { @@ -13,8 +15,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -95,3 +95,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/comments.adoc b/core/src/test/resources/tck-test-files/schema/v2/comments.adoc new file mode 100644 index 00000000..50ec009b --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/comments.adoc @@ -0,0 +1,823 @@ +:toc: +:toclevels: 42 + += Comments + +== Simple + +.Schema +[source,graphql,schema=true] +---- +"A custom scalar." +scalar CustomScalar + +"An enumeration of movie genres." +enum Genre { + ACTION + DRAMA + ROMANCE +} + +"""A type describing a movie.""" +type Movie { + id: ID + "The number of actors who acted in the movie." + actorCount: Int + """The average rating for the movie.""" + averageRating: Float + """ + Is the movie active? + + This is measured based on annual profit. + """ + isActive: Boolean + genre: Genre + customScalar: CustomScalar +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"A type describing a movie." +type Movie { + "The number of actors who acted in the movie." + actorCount: Int + "The average rating for the movie." + averageRating: Float + customScalar: CustomScalar + genre: Genre + id: ID + """ + Is the movie active? + + This is measured based on annual profit. + """ + isActive: Boolean +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enumeration of movie genres." +enum Genre { + ACTION + DRAMA + ROMANCE +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +"A custom scalar." +scalar CustomScalar + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + customScalar: SortDirection + genre: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + customScalar: CustomScalar + customScalar_IN: [CustomScalar] + genre: Genre + genre_IN: [Genre] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + +== Relationship + +=== Simple + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String +} + +type Movie { + id: ID + "Actors in Movie" + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + name: String +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + "Actors in Movie" + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +---- + +''' + +=== Interface + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! +} + +type Movie implements Production { + title: String! + runtime: Int! +} + +type Series implements Production { + title: String! + episodes: Int! +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + name: String! + "Acted in Production" + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + title: String! +} + +""" +The edge properties for the following fields: +* Actor.actedIn +""" +type ActedIn { + screenTime: Int! +} + +type Actor { + "Acted in Production" + actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! + name: String! +} + +type ActorActedInConnection { + edges: [ActorActedInRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorActedInRelationship { + cursor: String! + node: Production! + properties: ActedIn! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie implements Production { + runtime: Int! + title: String! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! + series(options: SeriesOptions, where: SeriesWhere): [Series!]! + seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! +} + +type Series implements Production { + episodes: Int! + title: String! +} + +type SeriesConnection { + edges: [SeriesEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesEdge { + cursor: String! + node: Series! +} + +enum ProductionImplementation { + Movie + Series +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + screenTime: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + screenTime: Int + screenTime_GT: Int + screenTime_GTE: Int + screenTime_IN: [Int!] + screenTime_LT: Int + screenTime_LTE: Int +} + +input ActorActedInConnectionSort { + edge: ActedInSort + node: ProductionSort +} + +input ActorActedInConnectionWhere { + AND: [ActorActedInConnectionWhere!] + NOT: ActorActedInConnectionWhere + OR: [ActorActedInConnectionWhere!] + edge: ActedInWhere + node: ProductionWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorActedInConnections match this filter" + actedInConnection_ALL: ActorActedInConnectionWhere + "Return Actors where none of the related ActorActedInConnections match this filter" + actedInConnection_NONE: ActorActedInConnectionWhere + "Return Actors where one of the related ActorActedInConnections match this filter" + actedInConnection_SINGLE: ActorActedInConnectionWhere + "Return Actors where some of the related ActorActedInConnections match this filter" + actedInConnection_SOME: ActorActedInConnectionWhere + "Return Actors where all of the related Productions match this filter" + actedIn_ALL: ProductionWhere + "Return Actors where none of the related Productions match this filter" + actedIn_NONE: ProductionWhere + "Return Actors where one of the related Productions match this filter" + actedIn_SINGLE: ProductionWhere + "Return Actors where some of the related Productions match this filter" + actedIn_SOME: ProductionWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +input SeriesOptions { + limit: Int + offset: Int + "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." + sort: [SeriesSort!] +} + +"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." +input SeriesSort { + episodes: SortDirection + title: SortDirection +} + +input SeriesWhere { + AND: [SeriesWhere!] + NOT: SeriesWhere + OR: [SeriesWhere!] + episodes: Int + episodes_GT: Int + episodes_GTE: Int + episodes_IN: [Int!] + episodes_LT: Int + episodes_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +---- + +''' + +=== Unions + +.Schema +[source,graphql,schema=true] +---- +union Search = Movie | Genre + +type Genre { + id: ID +} + +type Movie { + id: ID + search: [Search!]! @relationship(type: "SEARCH", direction: OUT) + searchNoDirective: Search +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Search = Genre | Movie + +type Genre { + id: ID +} + +type GenreEdge { + cursor: String! + node: Genre! +} + +type GenresConnection { + edges: [GenreEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + id: ID + search(directed: Boolean = true, options: QueryOptions, where: SearchWhere): [Search!]! + searchConnection(after: String, directed: Boolean = true, first: Int, where: MovieSearchConnectionWhere): MovieSearchConnection! + searchNoDirective: Search +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieSearchConnection { + edges: [MovieSearchRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieSearchRelationship { + cursor: String! + node: Search! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + genres(options: GenreOptions, where: GenreWhere): [Genre!]! + genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + searches(options: QueryOptions, where: SearchWhere): [Search!]! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input GenreOptions { + limit: Int + offset: Int + "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." + sort: [GenreSort!] +} + +"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." +input GenreSort { + id: SortDirection +} + +input GenreWhere { + AND: [GenreWhere!] + NOT: GenreWhere + OR: [GenreWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieSearchConnectionWhere { + Genre: MovieSearchGenreConnectionWhere + Movie: MovieSearchMovieConnectionWhere +} + +input MovieSearchGenreConnectionWhere { + AND: [MovieSearchGenreConnectionWhere!] + NOT: MovieSearchGenreConnectionWhere + OR: [MovieSearchGenreConnectionWhere!] + node: GenreWhere +} + +input MovieSearchMovieConnectionWhere { + AND: [MovieSearchMovieConnectionWhere!] + NOT: MovieSearchMovieConnectionWhere + OR: [MovieSearchMovieConnectionWhere!] + node: MovieWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieSearchConnections match this filter" + searchConnection_ALL: MovieSearchConnectionWhere + "Return Movies where none of the related MovieSearchConnections match this filter" + searchConnection_NONE: MovieSearchConnectionWhere + "Return Movies where one of the related MovieSearchConnections match this filter" + searchConnection_SINGLE: MovieSearchConnectionWhere + "Return Movies where some of the related MovieSearchConnections match this filter" + searchConnection_SOME: MovieSearchConnectionWhere + "Return Movies where all of the related Searches match this filter" + search_ALL: SearchWhere + "Return Movies where none of the related Searches match this filter" + search_NONE: SearchWhere + "Return Movies where one of the related Searches match this filter" + search_SINGLE: SearchWhere + "Return Movies where some of the related Searches match this filter" + search_SOME: SearchWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +input SearchWhere { + Genre: GenreWhere + Movie: MovieWhere +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/interface.adoc b/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/interface.adoc deleted file mode 100644 index 48a10862..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/interface.adoc +++ /dev/null @@ -1,314 +0,0 @@ -:toc: - -= Comments -> Relationship -> Interface - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! -} - -type Movie implements Production { - title: String! - runtime: Int! -} - -type Series implements Production { - title: String! - episodes: Int! -} - -type ActedIn @relationshipProperties { - screenTime: Int! -} - -type Actor { - name: String! - "Acted in Production" - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - title: String! -} - -""" -The edge properties for the following fields: -* Actor.actedIn -""" -type ActedIn { - screenTime: Int! -} - -type Actor { - "Acted in Production" - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - runtime: Int! - title: String! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - episodes: Int! - title: String! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - screenTime: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - screenTime: Int - screenTime_GT: Int - screenTime_GTE: Int - screenTime_IN: [Int!] - screenTime_LT: Int - screenTime_LTE: Int -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/simple.adoc b/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/simple.adoc deleted file mode 100644 index 425759eb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/simple.adoc +++ /dev/null @@ -1,171 +0,0 @@ -:toc: - -= Comments -> Relationship -> Simple - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - name: String -} - -type Movie { - id: ID - "Actors in Movie" - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - name: String -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - "Actors in Movie" - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/unions.adoc b/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/unions.adoc deleted file mode 100644 index 4c507a11..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/comments/relationship/unions.adoc +++ /dev/null @@ -1,195 +0,0 @@ -:toc: - -= Comments -> Relationship -> Unions - -== Source schema - -[source,graphql,schema=true] ----- -union Search = Movie | Genre - -type Genre { - id: ID -} - -type Movie { - id: ID - search: [Search!]! @relationship(type: "SEARCH", direction: OUT) - searchNoDirective: Search -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Search = Genre | Movie - -type Genre { - id: ID -} - -type GenreEdge { - cursor: String! - node: Genre! -} - -type GenresConnection { - edges: [GenreEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - id: ID - search(directed: Boolean = true, options: QueryOptions, where: SearchWhere): [Search!]! - searchConnection(after: String, directed: Boolean = true, first: Int, where: MovieSearchConnectionWhere): MovieSearchConnection! - searchNoDirective: Search -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieSearchConnection { - edges: [MovieSearchRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieSearchRelationship { - cursor: String! - node: Search! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - genres(options: GenreOptions, where: GenreWhere): [Genre!]! - genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - searches(options: QueryOptions, where: SearchWhere): [Search!]! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input GenreOptions { - limit: Int - offset: Int - "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." - sort: [GenreSort!] -} - -"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." -input GenreSort { - id: SortDirection -} - -input GenreWhere { - AND: [GenreWhere!] - NOT: GenreWhere - OR: [GenreWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieSearchConnectionWhere { - Genre: MovieSearchGenreConnectionWhere - Movie: MovieSearchMovieConnectionWhere -} - -input MovieSearchGenreConnectionWhere { - AND: [MovieSearchGenreConnectionWhere!] - NOT: MovieSearchGenreConnectionWhere - OR: [MovieSearchGenreConnectionWhere!] - node: GenreWhere -} - -input MovieSearchMovieConnectionWhere { - AND: [MovieSearchMovieConnectionWhere!] - NOT: MovieSearchMovieConnectionWhere - OR: [MovieSearchMovieConnectionWhere!] - node: MovieWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieSearchConnections match this filter" - searchConnection_ALL: MovieSearchConnectionWhere - "Return Movies where none of the related MovieSearchConnections match this filter" - searchConnection_NONE: MovieSearchConnectionWhere - "Return Movies where one of the related MovieSearchConnections match this filter" - searchConnection_SINGLE: MovieSearchConnectionWhere - "Return Movies where some of the related MovieSearchConnections match this filter" - searchConnection_SOME: MovieSearchConnectionWhere - "Return Movies where all of the related Searches match this filter" - search_ALL: SearchWhere - "Return Movies where none of the related Searches match this filter" - search_NONE: SearchWhere - "Return Movies where one of the related Searches match this filter" - search_SINGLE: SearchWhere - "Return Movies where some of the related Searches match this filter" - search_SOME: SearchWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - -input SearchWhere { - Genre: GenreWhere - Movie: MovieWhere -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/comments/simple.adoc b/core/src/test/resources/tck-test-files/schema/v2/comments/simple.adoc deleted file mode 100644 index 5d62d1cb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/comments/simple.adoc +++ /dev/null @@ -1,152 +0,0 @@ -:toc: - -= Comments -> Simple - -== Source schema - -[source,graphql,schema=true] ----- -"A custom scalar." -scalar CustomScalar - -"An enumeration of movie genres." -enum Genre { - ACTION - DRAMA - ROMANCE -} - -"""A type describing a movie.""" -type Movie { - id: ID - "The number of actors who acted in the movie." - actorCount: Int - """The average rating for the movie.""" - averageRating: Float - """ - Is the movie active? - - This is measured based on annual profit. - """ - isActive: Boolean - genre: Genre - customScalar: CustomScalar -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -"A type describing a movie." -type Movie { - "The number of actors who acted in the movie." - actorCount: Int - "The average rating for the movie." - averageRating: Float - customScalar: CustomScalar - genre: Genre - id: ID - """ - Is the movie active? - - This is measured based on annual profit. - """ - isActive: Boolean -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enumeration of movie genres." -enum Genre { - ACTION - DRAMA - ROMANCE -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -"A custom scalar." -scalar CustomScalar - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - customScalar: SortDirection - genre: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - customScalar: CustomScalar - customScalar_IN: [CustomScalar] - genre: Genre - genre_IN: [Genre] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/connections/enums.adoc b/core/src/test/resources/tck-test-files/schema/v2/connections/enums.adoc index b7e9a7e7..ee7f46cb 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/connections/enums.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/connections/enums.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Enums -> Enum Relationship Properties += Enums -== Source schema +== Enum Relationship Properties +.Schema [source,graphql,schema=true] ---- type Actor { @@ -26,8 +28,6 @@ type ActedIn @relationshipProperties { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -249,3 +249,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/connections/sort.adoc b/core/src/test/resources/tck-test-files/schema/v2/connections/sort.adoc index b6639d39..12717512 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/connections/sort.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/connections/sort.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Sort -> sort argument is not present when nothing to sort += Sort -== Source schema +== sort argument is not present when nothing to sort +.Schema [source,graphql,schema=true] ---- type Node1 { @@ -16,8 +18,6 @@ type Node2 { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -190,3 +190,4 @@ input Node2Where { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/connections/unions.adoc b/core/src/test/resources/tck-test-files/schema/v2/connections/unions.adoc index a517d156..55ab0ccd 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/connections/unions.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/connections/unions.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Unions -> Relationship Properties += Unions -== Source schema +== Relationship Properties +.Schema [source,graphql,schema=true] ---- union Publication = Book | Journal @@ -28,8 +30,6 @@ type Wrote @relationshipProperties { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -360,3 +360,4 @@ input WroteWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve.adoc b/core/src/test/resources/tck-test-files/schema/v2/directive-preserve.adoc new file mode 100644 index 00000000..d97261a2 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/directive-preserve.adoc @@ -0,0 +1,1389 @@ +:toc: +:toclevels: 42 + += Directive-preserve + +== Custom directives preserved + +.Schema +[source,graphql,schema=true] +---- +directive @preservedTopLevel(string: String, int: Int, float: Float, boolean: Boolean) on OBJECT + +directive @preservedFieldLevel(string: String, int: Int, float: Float, boolean: Boolean) on FIELD_DEFINITION + +type Movie @preservedTopLevel { + id: ID @preservedFieldLevel(string: "str", int: 12, float: 1.2, boolean: true) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +directive @preservedFieldLevel(boolean: Boolean, float: Float, int: Int, string: String) on FIELD_DEFINITION + +directive @preservedTopLevel(boolean: Boolean, float: Float, int: Int, string: String) on OBJECT + +type Movie @preservedTopLevel { + id: ID @preservedFieldLevel(boolean : true, float : 1.2, int : 12, string : "str") +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +---- + +''' + +== Directives on relations preserved + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String + year: Int + imdbRating: Float + genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT) @deprecated(reason: "Do not use") +} + +type Genre { + name: String + movies: [Movie!]! @relationship(type: "IN_GENRE", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Genre { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [GenreMoviesConnectionSort!], where: GenreMoviesConnectionWhere): GenreMoviesConnection! + name: String +} + +type GenreEdge { + cursor: String! + node: Genre! +} + +type GenreMoviesConnection { + edges: [GenreMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type GenreMoviesRelationship { + cursor: String! + node: Movie! +} + +type GenresConnection { + edges: [GenreEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + genres(directed: Boolean = true, options: GenreOptions, where: GenreWhere): [Genre!]! @deprecated(reason : "Do not use") + genresConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieGenresConnectionSort!], where: MovieGenresConnectionWhere): MovieGenresConnection! @deprecated(reason : "Do not use") + imdbRating: Float + title: String + year: Int +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieGenresConnection { + edges: [MovieGenresRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieGenresRelationship { + cursor: String! + node: Genre! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + genres(options: GenreOptions, where: GenreWhere): [Genre!]! + genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input GenreMoviesConnectionSort { + node: MovieSort +} + +input GenreMoviesConnectionWhere { + AND: [GenreMoviesConnectionWhere!] + NOT: GenreMoviesConnectionWhere + OR: [GenreMoviesConnectionWhere!] + node: MovieWhere +} + +input GenreOptions { + limit: Int + offset: Int + "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." + sort: [GenreSort!] +} + +"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." +input GenreSort { + name: SortDirection +} + +input GenreWhere { + AND: [GenreWhere!] + NOT: GenreWhere + OR: [GenreWhere!] + "Return Genres where all of the related GenreMoviesConnections match this filter" + moviesConnection_ALL: GenreMoviesConnectionWhere + "Return Genres where none of the related GenreMoviesConnections match this filter" + moviesConnection_NONE: GenreMoviesConnectionWhere + "Return Genres where one of the related GenreMoviesConnections match this filter" + moviesConnection_SINGLE: GenreMoviesConnectionWhere + "Return Genres where some of the related GenreMoviesConnections match this filter" + moviesConnection_SOME: GenreMoviesConnectionWhere + "Return Genres where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Genres where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Genres where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Genres where some of the related Movies match this filter" + movies_SOME: MovieWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input MovieGenresConnectionSort { + node: GenreSort +} + +input MovieGenresConnectionWhere { + AND: [MovieGenresConnectionWhere!] + NOT: MovieGenresConnectionWhere + OR: [MovieGenresConnectionWhere!] + node: GenreWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + imdbRating: SortDirection + title: SortDirection + year: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieGenresConnections match this filter" + genresConnection_ALL: MovieGenresConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where none of the related MovieGenresConnections match this filter" + genresConnection_NONE: MovieGenresConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where one of the related MovieGenresConnections match this filter" + genresConnection_SINGLE: MovieGenresConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where some of the related MovieGenresConnections match this filter" + genresConnection_SOME: MovieGenresConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where all of the related Genres match this filter" + genres_ALL: GenreWhere @deprecated(reason : "Do not use") + "Return Movies where none of the related Genres match this filter" + genres_NONE: GenreWhere @deprecated(reason : "Do not use") + "Return Movies where one of the related Genres match this filter" + genres_SINGLE: GenreWhere @deprecated(reason : "Do not use") + "Return Movies where some of the related Genres match this filter" + genres_SOME: GenreWhere @deprecated(reason : "Do not use") + imdbRating: Float + imdbRating_GT: Float + imdbRating_GTE: Float + imdbRating_IN: [Float] + imdbRating_LT: Float + imdbRating_LTE: Float + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String + year: Int + year_GT: Int + year_GTE: Int + year_IN: [Int] + year_LT: Int + year_LTE: Int +} + +---- + +''' + +== Directives on implemented interface relations preserved - field not declared relationship + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! + actors: [Actor!]! +} + +type Movie implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") @deprecated(reason: "Do not use") + runtime: Int! +} + +type Series implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") + episodes: Int! +} + +type ActedIn @relationshipProperties { + role: String! +} + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + actors: [Actor!]! + title: String! +} + +""" +The edge properties for the following fields: +* Movie.actors +* Series.actors +* Actor.actedIn +""" +type ActedIn { + role: String! +} + +type Actor { + actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! + name: String! +} + +type ActorActedInConnection { + edges: [ActorActedInRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorActedInRelationship { + cursor: String! + node: Production! + properties: ActedIn! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie implements Production { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! @deprecated(reason : "Do not use") + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! @deprecated(reason : "Do not use") + runtime: Int! + title: String! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! + series(options: SeriesOptions, where: SeriesWhere): [Series!]! + seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! +} + +type Series implements Production { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [SeriesActorsConnectionSort!], where: SeriesActorsConnectionWhere): SeriesActorsConnection! + episodes: Int! + title: String! +} + +type SeriesActorsConnection { + edges: [SeriesActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type SeriesConnection { + edges: [SeriesEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesEdge { + cursor: String! + node: Series! +} + +enum ProductionImplementation { + Movie + Series +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + role: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + role: String + role_CONTAINS: String + role_ENDS_WITH: String + role_IN: [String!] + role_STARTS_WITH: String +} + +input ActorActedInConnectionSort { + edge: ActedInSort + node: ProductionSort +} + +input ActorActedInConnectionWhere { + AND: [ActorActedInConnectionWhere!] + NOT: ActorActedInConnectionWhere + OR: [ActorActedInConnectionWhere!] + edge: ActedInWhere + node: ProductionWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorActedInConnections match this filter" + actedInConnection_ALL: ActorActedInConnectionWhere + "Return Actors where none of the related ActorActedInConnections match this filter" + actedInConnection_NONE: ActorActedInConnectionWhere + "Return Actors where one of the related ActorActedInConnections match this filter" + actedInConnection_SINGLE: ActorActedInConnectionWhere + "Return Actors where some of the related ActorActedInConnections match this filter" + actedInConnection_SOME: ActorActedInConnectionWhere + "Return Actors where all of the related Productions match this filter" + actedIn_ALL: ProductionWhere + "Return Actors where none of the related Productions match this filter" + actedIn_NONE: ProductionWhere + "Return Actors where one of the related Productions match this filter" + actedIn_SINGLE: ProductionWhere + "Return Actors where some of the related Productions match this filter" + actedIn_SOME: ProductionWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + edge: ActedInSort + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere @deprecated(reason : "Do not use") + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere @deprecated(reason : "Do not use") + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere @deprecated(reason : "Do not use") + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere @deprecated(reason : "Do not use") + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +input SeriesActorsConnectionSort { + edge: ActedInSort + node: ActorSort +} + +input SeriesActorsConnectionWhere { + AND: [SeriesActorsConnectionWhere!] + NOT: SeriesActorsConnectionWhere + OR: [SeriesActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input SeriesOptions { + limit: Int + offset: Int + "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." + sort: [SeriesSort!] +} + +"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." +input SeriesSort { + episodes: SortDirection + title: SortDirection +} + +input SeriesWhere { + AND: [SeriesWhere!] + NOT: SeriesWhere + OR: [SeriesWhere!] + "Return Series where all of the related SeriesActorsConnections match this filter" + actorsConnection_ALL: SeriesActorsConnectionWhere + "Return Series where none of the related SeriesActorsConnections match this filter" + actorsConnection_NONE: SeriesActorsConnectionWhere + "Return Series where one of the related SeriesActorsConnections match this filter" + actorsConnection_SINGLE: SeriesActorsConnectionWhere + "Return Series where some of the related SeriesActorsConnections match this filter" + actorsConnection_SOME: SeriesActorsConnectionWhere + "Return Series where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Series where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Series where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Series where some of the related Actors match this filter" + actors_SOME: ActorWhere + episodes: Int + episodes_GT: Int + episodes_GTE: Int + episodes_IN: [Int!] + episodes_LT: Int + episodes_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +---- + +''' + +== Directives on base interface preserved + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! + actors: [Actor!]! @deprecated(reason: "Do not use") +} + +type Movie implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") + runtime: Int! +} + +type Series implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") + episodes: Int! +} + +type ActedIn @relationshipProperties { + role: String! +} + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + actors: [Actor!]! @deprecated(reason : "Do not use") + title: String! +} + +""" +The edge properties for the following fields: +* Movie.actors +* Series.actors +* Actor.actedIn +""" +type ActedIn { + role: String! +} + +type Actor { + actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! + name: String! +} + +type ActorActedInConnection { + edges: [ActorActedInRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorActedInRelationship { + cursor: String! + node: Production! + properties: ActedIn! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie implements Production { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + runtime: Int! + title: String! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! + series(options: SeriesOptions, where: SeriesWhere): [Series!]! + seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! +} + +type Series implements Production { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [SeriesActorsConnectionSort!], where: SeriesActorsConnectionWhere): SeriesActorsConnection! + episodes: Int! + title: String! +} + +type SeriesActorsConnection { + edges: [SeriesActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type SeriesConnection { + edges: [SeriesEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesEdge { + cursor: String! + node: Series! +} + +enum ProductionImplementation { + Movie + Series +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + role: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + role: String + role_CONTAINS: String + role_ENDS_WITH: String + role_IN: [String!] + role_STARTS_WITH: String +} + +input ActorActedInConnectionSort { + edge: ActedInSort + node: ProductionSort +} + +input ActorActedInConnectionWhere { + AND: [ActorActedInConnectionWhere!] + NOT: ActorActedInConnectionWhere + OR: [ActorActedInConnectionWhere!] + edge: ActedInWhere + node: ProductionWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorActedInConnections match this filter" + actedInConnection_ALL: ActorActedInConnectionWhere + "Return Actors where none of the related ActorActedInConnections match this filter" + actedInConnection_NONE: ActorActedInConnectionWhere + "Return Actors where one of the related ActorActedInConnections match this filter" + actedInConnection_SINGLE: ActorActedInConnectionWhere + "Return Actors where some of the related ActorActedInConnections match this filter" + actedInConnection_SOME: ActorActedInConnectionWhere + "Return Actors where all of the related Productions match this filter" + actedIn_ALL: ProductionWhere + "Return Actors where none of the related Productions match this filter" + actedIn_NONE: ProductionWhere + "Return Actors where one of the related Productions match this filter" + actedIn_SINGLE: ProductionWhere + "Return Actors where some of the related Productions match this filter" + actedIn_SOME: ProductionWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + edge: ActedInSort + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +input SeriesActorsConnectionSort { + edge: ActedInSort + node: ActorSort +} + +input SeriesActorsConnectionWhere { + AND: [SeriesActorsConnectionWhere!] + NOT: SeriesActorsConnectionWhere + OR: [SeriesActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input SeriesOptions { + limit: Int + offset: Int + "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." + sort: [SeriesSort!] +} + +"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." +input SeriesSort { + episodes: SortDirection + title: SortDirection +} + +input SeriesWhere { + AND: [SeriesWhere!] + NOT: SeriesWhere + OR: [SeriesWhere!] + "Return Series where all of the related SeriesActorsConnections match this filter" + actorsConnection_ALL: SeriesActorsConnectionWhere + "Return Series where none of the related SeriesActorsConnections match this filter" + actorsConnection_NONE: SeriesActorsConnectionWhere + "Return Series where one of the related SeriesActorsConnections match this filter" + actorsConnection_SINGLE: SeriesActorsConnectionWhere + "Return Series where some of the related SeriesActorsConnections match this filter" + actorsConnection_SOME: SeriesActorsConnectionWhere + "Return Series where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Series where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Series where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Series where some of the related Actors match this filter" + actors_SOME: ActorWhere + episodes: Int + episodes_GT: Int + episodes_GTE: Int + episodes_IN: [Int!] + episodes_LT: Int + episodes_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +---- + +''' + +== Directives on unions preserved + +.Schema +[source,graphql,schema=true] +---- +union Content = Blog | Post + +type Blog { + title: String + posts: [Post!]! @relationship(type: "HAS_POST", direction: OUT) +} + +type Post { + content: String @deprecated(reason: "Do not use post.content") +} + +type User { + name: String + content: [Content!]! @relationship(type: "HAS_CONTENT", direction: OUT) @deprecated(reason: "Do not use user.content") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Content = Blog | Post + +type Blog { + posts(directed: Boolean = true, options: PostOptions, where: PostWhere): [Post!]! + postsConnection(after: String, directed: Boolean = true, first: Int, sort: [BlogPostsConnectionSort!], where: BlogPostsConnectionWhere): BlogPostsConnection! + title: String +} + +type BlogEdge { + cursor: String! + node: Blog! +} + +type BlogPostsConnection { + edges: [BlogPostsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type BlogPostsRelationship { + cursor: String! + node: Post! +} + +type BlogsConnection { + edges: [BlogEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Post { + content: String @deprecated(reason : "Do not use post.content") +} + +type PostEdge { + cursor: String! + node: Post! +} + +type PostsConnection { + edges: [PostEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + blogs(options: BlogOptions, where: BlogWhere): [Blog!]! + blogsConnection(after: String, first: Int, sort: [BlogSort], where: BlogWhere): BlogsConnection! + contents(options: QueryOptions, where: ContentWhere): [Content!]! + posts(options: PostOptions, where: PostWhere): [Post!]! + postsConnection(after: String, first: Int, sort: [PostSort], where: PostWhere): PostsConnection! + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +type User { + content(directed: Boolean = true, options: QueryOptions, where: ContentWhere): [Content!]! @deprecated(reason : "Do not use user.content") + contentConnection(after: String, directed: Boolean = true, first: Int, where: UserContentConnectionWhere): UserContentConnection! @deprecated(reason : "Do not use user.content") + name: String +} + +type UserContentConnection { + edges: [UserContentRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type UserContentRelationship { + cursor: String! + node: Content! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input BlogOptions { + limit: Int + offset: Int + "Specify one or more BlogSort objects to sort Blogs by. The sorts will be applied in the order in which they are arranged in the array." + sort: [BlogSort!] +} + +input BlogPostsConnectionSort { + node: PostSort +} + +input BlogPostsConnectionWhere { + AND: [BlogPostsConnectionWhere!] + NOT: BlogPostsConnectionWhere + OR: [BlogPostsConnectionWhere!] + node: PostWhere +} + +"Fields to sort Blogs by. The order in which sorts are applied is not guaranteed when specifying many fields in one BlogSort object." +input BlogSort { + title: SortDirection +} + +input BlogWhere { + AND: [BlogWhere!] + NOT: BlogWhere + OR: [BlogWhere!] + "Return Blogs where all of the related BlogPostsConnections match this filter" + postsConnection_ALL: BlogPostsConnectionWhere + "Return Blogs where none of the related BlogPostsConnections match this filter" + postsConnection_NONE: BlogPostsConnectionWhere + "Return Blogs where one of the related BlogPostsConnections match this filter" + postsConnection_SINGLE: BlogPostsConnectionWhere + "Return Blogs where some of the related BlogPostsConnections match this filter" + postsConnection_SOME: BlogPostsConnectionWhere + "Return Blogs where all of the related Posts match this filter" + posts_ALL: PostWhere + "Return Blogs where none of the related Posts match this filter" + posts_NONE: PostWhere + "Return Blogs where one of the related Posts match this filter" + posts_SINGLE: PostWhere + "Return Blogs where some of the related Posts match this filter" + posts_SOME: PostWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input ContentWhere { + Blog: BlogWhere + Post: PostWhere +} + +input PostOptions { + limit: Int + offset: Int + "Specify one or more PostSort objects to sort Posts by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PostSort!] +} + +"Fields to sort Posts by. The order in which sorts are applied is not guaranteed when specifying many fields in one PostSort object." +input PostSort { + content: SortDirection @deprecated(reason : "Do not use post.content") +} + +input PostWhere { + AND: [PostWhere!] + NOT: PostWhere + OR: [PostWhere!] + content: String @deprecated(reason : "Do not use post.content") + content_CONTAINS: String @deprecated(reason : "Do not use post.content") + content_ENDS_WITH: String @deprecated(reason : "Do not use post.content") + content_IN: [String] @deprecated(reason : "Do not use post.content") + content_STARTS_WITH: String @deprecated(reason : "Do not use post.content") +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +input UserContentBlogConnectionWhere { + AND: [UserContentBlogConnectionWhere!] + NOT: UserContentBlogConnectionWhere + OR: [UserContentBlogConnectionWhere!] + node: BlogWhere +} + +input UserContentConnectionWhere { + Blog: UserContentBlogConnectionWhere + Post: UserContentPostConnectionWhere +} + +input UserContentPostConnectionWhere { + AND: [UserContentPostConnectionWhere!] + NOT: UserContentPostConnectionWhere + OR: [UserContentPostConnectionWhere!] + node: PostWhere +} + +input UserOptions { + limit: Int + offset: Int + "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserSort!] +} + +"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." +input UserSort { + name: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + "Return Users where all of the related UserContentConnections match this filter" + contentConnection_ALL: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") + "Return Users where none of the related UserContentConnections match this filter" + contentConnection_NONE: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") + "Return Users where one of the related UserContentConnections match this filter" + contentConnection_SINGLE: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") + "Return Users where some of the related UserContentConnections match this filter" + contentConnection_SOME: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") + "Return Users where all of the related Contents match this filter" + content_ALL: ContentWhere @deprecated(reason : "Do not use user.content") + "Return Users where none of the related Contents match this filter" + content_NONE: ContentWhere @deprecated(reason : "Do not use user.content") + "Return Users where one of the related Contents match this filter" + content_SINGLE: ContentWhere @deprecated(reason : "Do not use user.content") + "Return Users where some of the related Contents match this filter" + content_SOME: ContentWhere @deprecated(reason : "Do not use user.content") + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/custom-directives-preserved.adoc b/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/custom-directives-preserved.adoc deleted file mode 100644 index f0361be4..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/custom-directives-preserved.adoc +++ /dev/null @@ -1,92 +0,0 @@ -:toc: - -= Directive-preserve -> Custom directives preserved - -== Source schema - -[source,graphql,schema=true] ----- -directive @preservedTopLevel(string: String, int: Int, float: Float, boolean: Boolean) on OBJECT - -directive @preservedFieldLevel(string: String, int: Int, float: Float, boolean: Boolean) on FIELD_DEFINITION - -type Movie @preservedTopLevel { - id: ID @preservedFieldLevel(string: "str", int: 12, float: 1.2, boolean: true) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -directive @preservedFieldLevel(boolean: Boolean, float: Float, int: Int, string: String) on FIELD_DEFINITION - -directive @preservedTopLevel(boolean: Boolean, float: Float, int: Int, string: String) on OBJECT - -type Movie @preservedTopLevel { - id: ID @preservedFieldLevel(boolean : true, float : 1.2, int : 12, string : "str") -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-base-interface-preserved.adoc b/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-base-interface-preserved.adoc deleted file mode 100644 index a2603428..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-base-interface-preserved.adoc +++ /dev/null @@ -1,403 +0,0 @@ -:toc: - -= Directive-preserve -> Directives on base interface preserved - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! - actors: [Actor!]! @deprecated(reason: "Do not use") -} - -type Movie implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") - runtime: Int! -} - -type Series implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") - episodes: Int! -} - -type ActedIn @relationshipProperties { - role: String! -} - -type Actor { - name: String! - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - actors: [Actor!]! @deprecated(reason : "Do not use") - title: String! -} - -""" -The edge properties for the following fields: -* Movie.actors -* Series.actors -* Actor.actedIn -""" -type ActedIn { - role: String! -} - -type Actor { - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - runtime: Int! - title: String! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [SeriesActorsConnectionSort!], where: SeriesActorsConnectionWhere): SeriesActorsConnection! - episodes: Int! - title: String! -} - -type SeriesActorsConnection { - edges: [SeriesActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - role: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - role: String - role_CONTAINS: String - role_ENDS_WITH: String - role_IN: [String!] - role_STARTS_WITH: String -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - edge: ActedInSort - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesActorsConnectionSort { - edge: ActedInSort - node: ActorSort -} - -input SeriesActorsConnectionWhere { - AND: [SeriesActorsConnectionWhere!] - NOT: SeriesActorsConnectionWhere - OR: [SeriesActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - "Return Series where all of the related SeriesActorsConnections match this filter" - actorsConnection_ALL: SeriesActorsConnectionWhere - "Return Series where none of the related SeriesActorsConnections match this filter" - actorsConnection_NONE: SeriesActorsConnectionWhere - "Return Series where one of the related SeriesActorsConnections match this filter" - actorsConnection_SINGLE: SeriesActorsConnectionWhere - "Return Series where some of the related SeriesActorsConnections match this filter" - actorsConnection_SOME: SeriesActorsConnectionWhere - "Return Series where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Series where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Series where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Series where some of the related Actors match this filter" - actors_SOME: ActorWhere - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-implemented-interface-relations-preserved-field-not-declared-relationship.adoc b/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-implemented-interface-relations-preserved-field-not-declared-relationship.adoc deleted file mode 100644 index bf83dc05..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-implemented-interface-relations-preserved-field-not-declared-relationship.adoc +++ /dev/null @@ -1,403 +0,0 @@ -:toc: - -= Directive-preserve -> Directives on implemented interface relations preserved - field not declared relationship - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! - actors: [Actor!]! -} - -type Movie implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") @deprecated(reason: "Do not use") - runtime: Int! -} - -type Series implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") - episodes: Int! -} - -type ActedIn @relationshipProperties { - role: String! -} - -type Actor { - name: String! - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - actors: [Actor!]! - title: String! -} - -""" -The edge properties for the following fields: -* Movie.actors -* Series.actors -* Actor.actedIn -""" -type ActedIn { - role: String! -} - -type Actor { - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! @deprecated(reason : "Do not use") - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! @deprecated(reason : "Do not use") - runtime: Int! - title: String! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [SeriesActorsConnectionSort!], where: SeriesActorsConnectionWhere): SeriesActorsConnection! - episodes: Int! - title: String! -} - -type SeriesActorsConnection { - edges: [SeriesActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - role: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - role: String - role_CONTAINS: String - role_ENDS_WITH: String - role_IN: [String!] - role_STARTS_WITH: String -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - edge: ActedInSort - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere @deprecated(reason : "Do not use") - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere @deprecated(reason : "Do not use") - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere @deprecated(reason : "Do not use") - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere @deprecated(reason : "Do not use") - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesActorsConnectionSort { - edge: ActedInSort - node: ActorSort -} - -input SeriesActorsConnectionWhere { - AND: [SeriesActorsConnectionWhere!] - NOT: SeriesActorsConnectionWhere - OR: [SeriesActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - "Return Series where all of the related SeriesActorsConnections match this filter" - actorsConnection_ALL: SeriesActorsConnectionWhere - "Return Series where none of the related SeriesActorsConnections match this filter" - actorsConnection_NONE: SeriesActorsConnectionWhere - "Return Series where one of the related SeriesActorsConnections match this filter" - actorsConnection_SINGLE: SeriesActorsConnectionWhere - "Return Series where some of the related SeriesActorsConnections match this filter" - actorsConnection_SOME: SeriesActorsConnectionWhere - "Return Series where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Series where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Series where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Series where some of the related Actors match this filter" - actors_SOME: ActorWhere - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-relations-preserved.adoc b/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-relations-preserved.adoc deleted file mode 100644 index 453fcb83..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-relations-preserved.adoc +++ /dev/null @@ -1,228 +0,0 @@ -:toc: - -= Directive-preserve -> Directives on relations preserved - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - title: String - year: Int - imdbRating: Float - genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT) @deprecated(reason: "Do not use") -} - -type Genre { - name: String - movies: [Movie!]! @relationship(type: "IN_GENRE", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Genre { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [GenreMoviesConnectionSort!], where: GenreMoviesConnectionWhere): GenreMoviesConnection! - name: String -} - -type GenreEdge { - cursor: String! - node: Genre! -} - -type GenreMoviesConnection { - edges: [GenreMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type GenreMoviesRelationship { - cursor: String! - node: Movie! -} - -type GenresConnection { - edges: [GenreEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - genres(directed: Boolean = true, options: GenreOptions, where: GenreWhere): [Genre!]! @deprecated(reason : "Do not use") - genresConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieGenresConnectionSort!], where: MovieGenresConnectionWhere): MovieGenresConnection! @deprecated(reason : "Do not use") - imdbRating: Float - title: String - year: Int -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieGenresConnection { - edges: [MovieGenresRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieGenresRelationship { - cursor: String! - node: Genre! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - genres(options: GenreOptions, where: GenreWhere): [Genre!]! - genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input GenreMoviesConnectionSort { - node: MovieSort -} - -input GenreMoviesConnectionWhere { - AND: [GenreMoviesConnectionWhere!] - NOT: GenreMoviesConnectionWhere - OR: [GenreMoviesConnectionWhere!] - node: MovieWhere -} - -input GenreOptions { - limit: Int - offset: Int - "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." - sort: [GenreSort!] -} - -"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." -input GenreSort { - name: SortDirection -} - -input GenreWhere { - AND: [GenreWhere!] - NOT: GenreWhere - OR: [GenreWhere!] - "Return Genres where all of the related GenreMoviesConnections match this filter" - moviesConnection_ALL: GenreMoviesConnectionWhere - "Return Genres where none of the related GenreMoviesConnections match this filter" - moviesConnection_NONE: GenreMoviesConnectionWhere - "Return Genres where one of the related GenreMoviesConnections match this filter" - moviesConnection_SINGLE: GenreMoviesConnectionWhere - "Return Genres where some of the related GenreMoviesConnections match this filter" - moviesConnection_SOME: GenreMoviesConnectionWhere - "Return Genres where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Genres where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Genres where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Genres where some of the related Movies match this filter" - movies_SOME: MovieWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input MovieGenresConnectionSort { - node: GenreSort -} - -input MovieGenresConnectionWhere { - AND: [MovieGenresConnectionWhere!] - NOT: MovieGenresConnectionWhere - OR: [MovieGenresConnectionWhere!] - node: GenreWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - imdbRating: SortDirection - title: SortDirection - year: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieGenresConnections match this filter" - genresConnection_ALL: MovieGenresConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where none of the related MovieGenresConnections match this filter" - genresConnection_NONE: MovieGenresConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where one of the related MovieGenresConnections match this filter" - genresConnection_SINGLE: MovieGenresConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where some of the related MovieGenresConnections match this filter" - genresConnection_SOME: MovieGenresConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where all of the related Genres match this filter" - genres_ALL: GenreWhere @deprecated(reason : "Do not use") - "Return Movies where none of the related Genres match this filter" - genres_NONE: GenreWhere @deprecated(reason : "Do not use") - "Return Movies where one of the related Genres match this filter" - genres_SINGLE: GenreWhere @deprecated(reason : "Do not use") - "Return Movies where some of the related Genres match this filter" - genres_SOME: GenreWhere @deprecated(reason : "Do not use") - imdbRating: Float - imdbRating_GT: Float - imdbRating_GTE: Float - imdbRating_IN: [Float] - imdbRating_LT: Float - imdbRating_LTE: Float - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String - year: Int - year_GT: Int - year_GTE: Int - year_IN: [Int] - year_LT: Int - year_LTE: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-unions-preserved.adoc b/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-unions-preserved.adoc deleted file mode 100644 index f2c3920c..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directive-preserve/directives-on-unions-preserved.adoc +++ /dev/null @@ -1,278 +0,0 @@ -:toc: - -= Directive-preserve -> Directives on unions preserved - -== Source schema - -[source,graphql,schema=true] ----- -union Content = Blog | Post - -type Blog { - title: String - posts: [Post!]! @relationship(type: "HAS_POST", direction: OUT) -} - -type Post { - content: String @deprecated(reason: "Do not use post.content") -} - -type User { - name: String - content: [Content!]! @relationship(type: "HAS_CONTENT", direction: OUT) @deprecated(reason: "Do not use user.content") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Content = Blog | Post - -type Blog { - posts(directed: Boolean = true, options: PostOptions, where: PostWhere): [Post!]! - postsConnection(after: String, directed: Boolean = true, first: Int, sort: [BlogPostsConnectionSort!], where: BlogPostsConnectionWhere): BlogPostsConnection! - title: String -} - -type BlogEdge { - cursor: String! - node: Blog! -} - -type BlogPostsConnection { - edges: [BlogPostsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type BlogPostsRelationship { - cursor: String! - node: Post! -} - -type BlogsConnection { - edges: [BlogEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Post { - content: String @deprecated(reason : "Do not use post.content") -} - -type PostEdge { - cursor: String! - node: Post! -} - -type PostsConnection { - edges: [PostEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - blogs(options: BlogOptions, where: BlogWhere): [Blog!]! - blogsConnection(after: String, first: Int, sort: [BlogSort], where: BlogWhere): BlogsConnection! - contents(options: QueryOptions, where: ContentWhere): [Content!]! - posts(options: PostOptions, where: PostWhere): [Post!]! - postsConnection(after: String, first: Int, sort: [PostSort], where: PostWhere): PostsConnection! - users(options: UserOptions, where: UserWhere): [User!]! - usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! -} - -type User { - content(directed: Boolean = true, options: QueryOptions, where: ContentWhere): [Content!]! @deprecated(reason : "Do not use user.content") - contentConnection(after: String, directed: Boolean = true, first: Int, where: UserContentConnectionWhere): UserContentConnection! @deprecated(reason : "Do not use user.content") - name: String -} - -type UserContentConnection { - edges: [UserContentRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type UserContentRelationship { - cursor: String! - node: Content! -} - -type UserEdge { - cursor: String! - node: User! -} - -type UsersConnection { - edges: [UserEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input BlogOptions { - limit: Int - offset: Int - "Specify one or more BlogSort objects to sort Blogs by. The sorts will be applied in the order in which they are arranged in the array." - sort: [BlogSort!] -} - -input BlogPostsConnectionSort { - node: PostSort -} - -input BlogPostsConnectionWhere { - AND: [BlogPostsConnectionWhere!] - NOT: BlogPostsConnectionWhere - OR: [BlogPostsConnectionWhere!] - node: PostWhere -} - -"Fields to sort Blogs by. The order in which sorts are applied is not guaranteed when specifying many fields in one BlogSort object." -input BlogSort { - title: SortDirection -} - -input BlogWhere { - AND: [BlogWhere!] - NOT: BlogWhere - OR: [BlogWhere!] - "Return Blogs where all of the related BlogPostsConnections match this filter" - postsConnection_ALL: BlogPostsConnectionWhere - "Return Blogs where none of the related BlogPostsConnections match this filter" - postsConnection_NONE: BlogPostsConnectionWhere - "Return Blogs where one of the related BlogPostsConnections match this filter" - postsConnection_SINGLE: BlogPostsConnectionWhere - "Return Blogs where some of the related BlogPostsConnections match this filter" - postsConnection_SOME: BlogPostsConnectionWhere - "Return Blogs where all of the related Posts match this filter" - posts_ALL: PostWhere - "Return Blogs where none of the related Posts match this filter" - posts_NONE: PostWhere - "Return Blogs where one of the related Posts match this filter" - posts_SINGLE: PostWhere - "Return Blogs where some of the related Posts match this filter" - posts_SOME: PostWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input ContentWhere { - Blog: BlogWhere - Post: PostWhere -} - -input PostOptions { - limit: Int - offset: Int - "Specify one or more PostSort objects to sort Posts by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PostSort!] -} - -"Fields to sort Posts by. The order in which sorts are applied is not guaranteed when specifying many fields in one PostSort object." -input PostSort { - content: SortDirection @deprecated(reason : "Do not use post.content") -} - -input PostWhere { - AND: [PostWhere!] - NOT: PostWhere - OR: [PostWhere!] - content: String @deprecated(reason : "Do not use post.content") - content_CONTAINS: String @deprecated(reason : "Do not use post.content") - content_ENDS_WITH: String @deprecated(reason : "Do not use post.content") - content_IN: [String] @deprecated(reason : "Do not use post.content") - content_STARTS_WITH: String @deprecated(reason : "Do not use post.content") -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - -input UserContentBlogConnectionWhere { - AND: [UserContentBlogConnectionWhere!] - NOT: UserContentBlogConnectionWhere - OR: [UserContentBlogConnectionWhere!] - node: BlogWhere -} - -input UserContentConnectionWhere { - Blog: UserContentBlogConnectionWhere - Post: UserContentPostConnectionWhere -} - -input UserContentPostConnectionWhere { - AND: [UserContentPostConnectionWhere!] - NOT: UserContentPostConnectionWhere - OR: [UserContentPostConnectionWhere!] - node: PostWhere -} - -input UserOptions { - limit: Int - offset: Int - "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserSort!] -} - -"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." -input UserSort { - name: SortDirection -} - -input UserWhere { - AND: [UserWhere!] - NOT: UserWhere - OR: [UserWhere!] - "Return Users where all of the related UserContentConnections match this filter" - contentConnection_ALL: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") - "Return Users where none of the related UserContentConnections match this filter" - contentConnection_NONE: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") - "Return Users where one of the related UserContentConnections match this filter" - contentConnection_SINGLE: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") - "Return Users where some of the related UserContentConnections match this filter" - contentConnection_SOME: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") - "Return Users where all of the related Contents match this filter" - content_ALL: ContentWhere @deprecated(reason : "Do not use user.content") - "Return Users where none of the related Contents match this filter" - content_NONE: ContentWhere @deprecated(reason : "Do not use user.content") - "Return Users where one of the related Contents match this filter" - content_SINGLE: ContentWhere @deprecated(reason : "Do not use user.content") - "Return Users where some of the related Contents match this filter" - content_SOME: ContentWhere @deprecated(reason : "Do not use user.content") - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/alias.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/alias.adoc index 819dde21..994ba120 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/alias.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/alias.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Alias -> Custom Directive Simple += Alias -== Source schema +== Custom Directive Simple +.Schema [source,graphql,schema=true] ---- type Actor { @@ -23,8 +25,6 @@ type ActorActedInProps @relationshipProperties { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -223,3 +223,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/customResolver.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/customResolver.adoc index fafe8248..0a01c85d 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/customResolver.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/customResolver.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= @customResolver directive -> passes fields directly through with no generation += @customResolver directive -== Source schema +== passes fields directly through with no generation +.Schema [source,graphql,schema=true] ---- interface UserInterface { @@ -19,8 +21,6 @@ type User implements UserInterface { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -151,3 +151,4 @@ input UserWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/default.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/default.adoc index 56176826..1b58d09d 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/default.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/default.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= @default directive -> sets default values in schema += @default directive -== Source schema +== sets default values in schema +.Schema [source,graphql,schema=true] ---- interface UserInterface { @@ -30,8 +32,6 @@ enum Location { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -214,3 +214,4 @@ input UserWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable.adoc new file mode 100644 index 00000000..7349858d --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable.adoc @@ -0,0 +1,2094 @@ +:toc: +:toclevels: 42 + += @filterable directive + +== on INTERFACE RELATIONSHIP FIELD, (aggregation are not generated for abstract types) + +=== disable value filters + +.Schema +[source,graphql,schema=true] +---- +type Actor implements Person { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +interface Person { + username: String! +} + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: false) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + username: String! +} + +type Actor implements Person { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +enum PersonImplementation { + Actor +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + username: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + typename_IN: [PersonImplementation!] + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +---- + +''' + +== snapshot tests + +=== on SCALAR + +==== default arguments should disable aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Movie { + title: String @filterable + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +=== on RELATIONSHIP FIELD + +==== default arguments should disable aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Movie { + title: String + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) @filterable +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +==== enable only value filters + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Movie { + title: String + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +=== on INTERFACE RELATIONSHIP FIELD, (aggregation does not exists on abstract types) + +==== default arguments should disable aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor implements Person { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +interface Person { + username: String! +} + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + username: String! +} + +type Actor implements Person { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +enum PersonImplementation { + Actor +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + username: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + typename_IN: [PersonImplementation!] + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +---- + +''' + +==== enable only value filters + +.Schema +[source,graphql,schema=true] +---- +type Actor implements Person { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +interface Person { + username: String! +} + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + username: String! +} + +type Actor implements Person { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +enum PersonImplementation { + Actor +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + username: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + typename_IN: [PersonImplementation!] + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +---- + +''' + +=== on UNION RELATIONSHIP FIELD, (aggregation does not exists on abstract types) + +==== default arguments should disable aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Appearance { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +union Person = Actor | Appearance + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = Actor | Appearance + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Appearance { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [AppearanceMoviesConnectionSort!], where: AppearanceMoviesConnectionWhere): AppearanceMoviesConnection! + password: String! + username: String! +} + +type AppearanceEdge { + cursor: String! + node: Appearance! +} + +type AppearanceMoviesConnection { + edges: [AppearanceMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type AppearanceMoviesRelationship { + cursor: String! + node: Movie! +} + +type AppearancesConnection { + edges: [AppearanceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + appearances(options: AppearanceOptions, where: AppearanceWhere): [Appearance!]! + appearancesConnection(after: String, first: Int, sort: [AppearanceSort], where: AppearanceWhere): AppearancesConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input AppearanceMoviesConnectionSort { + node: MovieSort +} + +input AppearanceMoviesConnectionWhere { + AND: [AppearanceMoviesConnectionWhere!] + NOT: AppearanceMoviesConnectionWhere + OR: [AppearanceMoviesConnectionWhere!] + node: MovieWhere +} + +input AppearanceOptions { + limit: Int + offset: Int + "Specify one or more AppearanceSort objects to sort Appearances by. The sorts will be applied in the order in which they are arranged in the array." + sort: [AppearanceSort!] +} + +"Fields to sort Appearances by. The order in which sorts are applied is not guaranteed when specifying many fields in one AppearanceSort object." +input AppearanceSort { + password: SortDirection + username: SortDirection +} + +input AppearanceWhere { + AND: [AppearanceWhere!] + NOT: AppearanceWhere + OR: [AppearanceWhere!] + "Return Appearances where all of the related AppearanceMoviesConnections match this filter" + moviesConnection_ALL: AppearanceMoviesConnectionWhere + "Return Appearances where none of the related AppearanceMoviesConnections match this filter" + moviesConnection_NONE: AppearanceMoviesConnectionWhere + "Return Appearances where one of the related AppearanceMoviesConnections match this filter" + moviesConnection_SINGLE: AppearanceMoviesConnectionWhere + "Return Appearances where some of the related AppearanceMoviesConnections match this filter" + moviesConnection_SOME: AppearanceMoviesConnectionWhere + "Return Appearances where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Appearances where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Appearances where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Appearances where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsActorConnectionWhere { + AND: [MovieActorsActorConnectionWhere!] + NOT: MovieActorsActorConnectionWhere + OR: [MovieActorsActorConnectionWhere!] + node: ActorWhere +} + +input MovieActorsAppearanceConnectionWhere { + AND: [MovieActorsAppearanceConnectionWhere!] + NOT: MovieActorsAppearanceConnectionWhere + OR: [MovieActorsAppearanceConnectionWhere!] + node: AppearanceWhere +} + +input MovieActorsConnectionWhere { + Actor: MovieActorsActorConnectionWhere + Appearance: MovieActorsAppearanceConnectionWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonWhere { + Actor: ActorWhere + Appearance: AppearanceWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +==== enable only value filters + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Appearance { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +union Person = Actor | Appearance + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = Actor | Appearance + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Appearance { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [AppearanceMoviesConnectionSort!], where: AppearanceMoviesConnectionWhere): AppearanceMoviesConnection! + password: String! + username: String! +} + +type AppearanceEdge { + cursor: String! + node: Appearance! +} + +type AppearanceMoviesConnection { + edges: [AppearanceMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type AppearanceMoviesRelationship { + cursor: String! + node: Movie! +} + +type AppearancesConnection { + edges: [AppearanceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + appearances(options: AppearanceOptions, where: AppearanceWhere): [Appearance!]! + appearancesConnection(after: String, first: Int, sort: [AppearanceSort], where: AppearanceWhere): AppearancesConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input AppearanceMoviesConnectionSort { + node: MovieSort +} + +input AppearanceMoviesConnectionWhere { + AND: [AppearanceMoviesConnectionWhere!] + NOT: AppearanceMoviesConnectionWhere + OR: [AppearanceMoviesConnectionWhere!] + node: MovieWhere +} + +input AppearanceOptions { + limit: Int + offset: Int + "Specify one or more AppearanceSort objects to sort Appearances by. The sorts will be applied in the order in which they are arranged in the array." + sort: [AppearanceSort!] +} + +"Fields to sort Appearances by. The order in which sorts are applied is not guaranteed when specifying many fields in one AppearanceSort object." +input AppearanceSort { + password: SortDirection + username: SortDirection +} + +input AppearanceWhere { + AND: [AppearanceWhere!] + NOT: AppearanceWhere + OR: [AppearanceWhere!] + "Return Appearances where all of the related AppearanceMoviesConnections match this filter" + moviesConnection_ALL: AppearanceMoviesConnectionWhere + "Return Appearances where none of the related AppearanceMoviesConnections match this filter" + moviesConnection_NONE: AppearanceMoviesConnectionWhere + "Return Appearances where one of the related AppearanceMoviesConnections match this filter" + moviesConnection_SINGLE: AppearanceMoviesConnectionWhere + "Return Appearances where some of the related AppearanceMoviesConnections match this filter" + moviesConnection_SOME: AppearanceMoviesConnectionWhere + "Return Appearances where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Appearances where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Appearances where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Appearances where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsActorConnectionWhere { + AND: [MovieActorsActorConnectionWhere!] + NOT: MovieActorsActorConnectionWhere + OR: [MovieActorsActorConnectionWhere!] + node: ActorWhere +} + +input MovieActorsAppearanceConnectionWhere { + AND: [MovieActorsAppearanceConnectionWhere!] + NOT: MovieActorsAppearanceConnectionWhere + OR: [MovieActorsAppearanceConnectionWhere!] + node: AppearanceWhere +} + +input MovieActorsConnectionWhere { + Actor: MovieActorsActorConnectionWhere + Appearance: MovieActorsAppearanceConnectionWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonWhere { + Actor: ActorWhere + Appearance: AppearanceWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/on-interface-relationship-field-aggregation-are-not-generated-for-abstract-types-/disable-value-filters.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/on-interface-relationship-field-aggregation-are-not-generated-for-abstract-types-/disable-value-filters.adoc deleted file mode 100644 index 6408ed4f..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/on-interface-relationship-field-aggregation-are-not-generated-for-abstract-types-/disable-value-filters.adoc +++ /dev/null @@ -1,251 +0,0 @@ -:toc: - -= @filterable directive -> on INTERFACE RELATIONSHIP FIELD, (aggregation are not generated for abstract types) -> disable value filters - -== Source schema - -[source,graphql,schema=true] ----- -type Actor implements Person { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -interface Person { - username: String! -} - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: false) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - username: String! -} - -type Actor implements Person { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -enum PersonImplementation { - Actor -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - username: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - typename_IN: [PersonImplementation!] - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc deleted file mode 100644 index 1f07f9eb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on INTERFACE RELATIONSHIP FIELD, (aggregation does not exists on abstract types) -> default arguments should disable aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor implements Person { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -interface Person { - username: String! -} - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - username: String! -} - -type Actor implements Person { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -enum PersonImplementation { - Actor -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - username: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - typename_IN: [PersonImplementation!] - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc deleted file mode 100644 index b75e7fde..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on INTERFACE RELATIONSHIP FIELD, (aggregation does not exists on abstract types) -> enable only value filters - -== Source schema - -[source,graphql,schema=true] ----- -type Actor implements Person { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -interface Person { - username: String! -} - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - username: String! -} - -type Actor implements Person { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -enum PersonImplementation { - Actor -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - username: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - typename_IN: [PersonImplementation!] - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-relationship-field/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-relationship-field/default-arguments-should-disable-aggregation.adoc deleted file mode 100644 index 234567fd..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-relationship-field/default-arguments-should-disable-aggregation.adoc +++ /dev/null @@ -1,218 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on RELATIONSHIP FIELD -> default arguments should disable aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Movie { - title: String - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) @filterable -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-relationship-field/enable-only-value-filters.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-relationship-field/enable-only-value-filters.adoc deleted file mode 100644 index 35171cc7..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-relationship-field/enable-only-value-filters.adoc +++ /dev/null @@ -1,218 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on RELATIONSHIP FIELD -> enable only value filters - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Movie { - title: String - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-scalar/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-scalar/default-arguments-should-disable-aggregation.adoc deleted file mode 100644 index 856fe832..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-scalar/default-arguments-should-disable-aggregation.adoc +++ /dev/null @@ -1,218 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on SCALAR -> default arguments should disable aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Movie { - title: String @filterable - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc deleted file mode 100644 index fdb1bfce..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc +++ /dev/null @@ -1,335 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on UNION RELATIONSHIP FIELD, (aggregation does not exists on abstract types) -> default arguments should disable aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Appearance { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -union Person = Actor | Appearance - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = Actor | Appearance - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Appearance { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [AppearanceMoviesConnectionSort!], where: AppearanceMoviesConnectionWhere): AppearanceMoviesConnection! - password: String! - username: String! -} - -type AppearanceEdge { - cursor: String! - node: Appearance! -} - -type AppearanceMoviesConnection { - edges: [AppearanceMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type AppearanceMoviesRelationship { - cursor: String! - node: Movie! -} - -type AppearancesConnection { - edges: [AppearanceEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - appearances(options: AppearanceOptions, where: AppearanceWhere): [Appearance!]! - appearancesConnection(after: String, first: Int, sort: [AppearanceSort], where: AppearanceWhere): AppearancesConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input AppearanceMoviesConnectionSort { - node: MovieSort -} - -input AppearanceMoviesConnectionWhere { - AND: [AppearanceMoviesConnectionWhere!] - NOT: AppearanceMoviesConnectionWhere - OR: [AppearanceMoviesConnectionWhere!] - node: MovieWhere -} - -input AppearanceOptions { - limit: Int - offset: Int - "Specify one or more AppearanceSort objects to sort Appearances by. The sorts will be applied in the order in which they are arranged in the array." - sort: [AppearanceSort!] -} - -"Fields to sort Appearances by. The order in which sorts are applied is not guaranteed when specifying many fields in one AppearanceSort object." -input AppearanceSort { - password: SortDirection - username: SortDirection -} - -input AppearanceWhere { - AND: [AppearanceWhere!] - NOT: AppearanceWhere - OR: [AppearanceWhere!] - "Return Appearances where all of the related AppearanceMoviesConnections match this filter" - moviesConnection_ALL: AppearanceMoviesConnectionWhere - "Return Appearances where none of the related AppearanceMoviesConnections match this filter" - moviesConnection_NONE: AppearanceMoviesConnectionWhere - "Return Appearances where one of the related AppearanceMoviesConnections match this filter" - moviesConnection_SINGLE: AppearanceMoviesConnectionWhere - "Return Appearances where some of the related AppearanceMoviesConnections match this filter" - moviesConnection_SOME: AppearanceMoviesConnectionWhere - "Return Appearances where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Appearances where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Appearances where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Appearances where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsActorConnectionWhere { - AND: [MovieActorsActorConnectionWhere!] - NOT: MovieActorsActorConnectionWhere - OR: [MovieActorsActorConnectionWhere!] - node: ActorWhere -} - -input MovieActorsAppearanceConnectionWhere { - AND: [MovieActorsAppearanceConnectionWhere!] - NOT: MovieActorsAppearanceConnectionWhere - OR: [MovieActorsAppearanceConnectionWhere!] - node: AppearanceWhere -} - -input MovieActorsConnectionWhere { - Actor: MovieActorsActorConnectionWhere - Appearance: MovieActorsAppearanceConnectionWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonWhere { - Actor: ActorWhere - Appearance: AppearanceWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc deleted file mode 100644 index 0891c828..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc +++ /dev/null @@ -1,335 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on UNION RELATIONSHIP FIELD, (aggregation does not exists on abstract types) -> enable only value filters - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Appearance { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -union Person = Actor | Appearance - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = Actor | Appearance - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Appearance { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [AppearanceMoviesConnectionSort!], where: AppearanceMoviesConnectionWhere): AppearanceMoviesConnection! - password: String! - username: String! -} - -type AppearanceEdge { - cursor: String! - node: Appearance! -} - -type AppearanceMoviesConnection { - edges: [AppearanceMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type AppearanceMoviesRelationship { - cursor: String! - node: Movie! -} - -type AppearancesConnection { - edges: [AppearanceEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - appearances(options: AppearanceOptions, where: AppearanceWhere): [Appearance!]! - appearancesConnection(after: String, first: Int, sort: [AppearanceSort], where: AppearanceWhere): AppearancesConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input AppearanceMoviesConnectionSort { - node: MovieSort -} - -input AppearanceMoviesConnectionWhere { - AND: [AppearanceMoviesConnectionWhere!] - NOT: AppearanceMoviesConnectionWhere - OR: [AppearanceMoviesConnectionWhere!] - node: MovieWhere -} - -input AppearanceOptions { - limit: Int - offset: Int - "Specify one or more AppearanceSort objects to sort Appearances by. The sorts will be applied in the order in which they are arranged in the array." - sort: [AppearanceSort!] -} - -"Fields to sort Appearances by. The order in which sorts are applied is not guaranteed when specifying many fields in one AppearanceSort object." -input AppearanceSort { - password: SortDirection - username: SortDirection -} - -input AppearanceWhere { - AND: [AppearanceWhere!] - NOT: AppearanceWhere - OR: [AppearanceWhere!] - "Return Appearances where all of the related AppearanceMoviesConnections match this filter" - moviesConnection_ALL: AppearanceMoviesConnectionWhere - "Return Appearances where none of the related AppearanceMoviesConnections match this filter" - moviesConnection_NONE: AppearanceMoviesConnectionWhere - "Return Appearances where one of the related AppearanceMoviesConnections match this filter" - moviesConnection_SINGLE: AppearanceMoviesConnectionWhere - "Return Appearances where some of the related AppearanceMoviesConnections match this filter" - moviesConnection_SOME: AppearanceMoviesConnectionWhere - "Return Appearances where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Appearances where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Appearances where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Appearances where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsActorConnectionWhere { - AND: [MovieActorsActorConnectionWhere!] - NOT: MovieActorsActorConnectionWhere - OR: [MovieActorsActorConnectionWhere!] - node: ActorWhere -} - -input MovieActorsAppearanceConnectionWhere { - AND: [MovieActorsAppearanceConnectionWhere!] - NOT: MovieActorsAppearanceConnectionWhere - OR: [MovieActorsAppearanceConnectionWhere!] - node: AppearanceWhere -} - -input MovieActorsConnectionWhere { - Actor: MovieActorsActorConnectionWhere - Appearance: MovieActorsAppearanceConnectionWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonWhere { - Actor: ActorWhere - Appearance: AppearanceWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/private/private-is-not-inherited.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/private.adoc similarity index 50% rename from core/src/test/resources/tck-test-files/schema/v2/directives/private/private-is-not-inherited.adoc rename to core/src/test/resources/tck-test-files/schema/v2/directives/private.adoc index cb13b34f..1cf1d3e1 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/private/private-is-not-inherited.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/private.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= @private directive -> private is not inherited += @private directive -== Source schema +== does not add fields to schema +.Schema [source,graphql,schema=true] ---- interface UserInterface { @@ -14,11 +16,141 @@ interface UserInterface { type User implements UserInterface { id: ID password: String @private - private: String + private: String @private +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface UserInterface { + id: ID +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + userInterfaces(options: UserInterfaceOptions, where: UserInterfaceWhere): [UserInterface!]! + userInterfacesConnection(after: String, first: Int, sort: [UserInterfaceSort], where: UserInterfaceWhere): UserInterfacesConnection! + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +type User implements UserInterface { + id: ID +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserInterfaceEdge { + cursor: String! + node: UserInterface! +} + +type UserInterfacesConnection { + edges: [UserInterfaceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +enum UserInterfaceImplementation { + User +} + +input UserInterfaceOptions { + limit: Int + offset: Int + "Specify one or more UserInterfaceSort objects to sort UserInterfaces by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserInterfaceSort] +} + +"Fields to sort UserInterfaces by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserInterfaceSort object." +input UserInterfaceSort { + id: SortDirection +} + +input UserInterfaceWhere { + AND: [UserInterfaceWhere!] + NOT: UserInterfaceWhere + OR: [UserInterfaceWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + typename_IN: [UserInterfaceImplementation!] +} + +input UserOptions { + limit: Int + offset: Int + "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserSort!] +} + +"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." +input UserSort { + id: SortDirection } + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + ---- -== Augmented schema +''' + +== private is not inherited + +.Schema +[source,graphql,schema=true] +---- +interface UserInterface { + id: ID + private: String @private +} + +type User implements UserInterface { + id: ID + password: String @private + private: String +} +---- .Augmented Schema [source,graphql] @@ -141,3 +273,4 @@ input UserWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/private/does-not-add-fields-to-schema.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/private/does-not-add-fields-to-schema.adoc deleted file mode 100644 index 97f711cc..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/private/does-not-add-fields-to-schema.adoc +++ /dev/null @@ -1,136 +0,0 @@ -:toc: - -= @private directive -> does not add fields to schema - -== Source schema - -[source,graphql,schema=true] ----- -interface UserInterface { - id: ID - private: String @private -} - -type User implements UserInterface { - id: ID - password: String @private - private: String @private -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface UserInterface { - id: ID -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - userInterfaces(options: UserInterfaceOptions, where: UserInterfaceWhere): [UserInterface!]! - userInterfacesConnection(after: String, first: Int, sort: [UserInterfaceSort], where: UserInterfaceWhere): UserInterfacesConnection! - users(options: UserOptions, where: UserWhere): [User!]! - usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! -} - -type User implements UserInterface { - id: ID -} - -type UserEdge { - cursor: String! - node: User! -} - -type UserInterfaceEdge { - cursor: String! - node: UserInterface! -} - -type UserInterfacesConnection { - edges: [UserInterfaceEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type UsersConnection { - edges: [UserEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -enum UserInterfaceImplementation { - User -} - -input UserInterfaceOptions { - limit: Int - offset: Int - "Specify one or more UserInterfaceSort objects to sort UserInterfaces by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserInterfaceSort] -} - -"Fields to sort UserInterfaces by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserInterfaceSort object." -input UserInterfaceSort { - id: SortDirection -} - -input UserInterfaceWhere { - AND: [UserInterfaceWhere!] - NOT: UserInterfaceWhere - OR: [UserInterfaceWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - typename_IN: [UserInterfaceImplementation!] -} - -input UserOptions { - limit: Int - offset: Int - "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserSort!] -} - -"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." -input UserSort { - id: SortDirection -} - -input UserWhere { - AND: [UserWhere!] - NOT: UserWhere - OR: [UserWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/query/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/query.adoc similarity index 86% rename from core/src/test/resources/tck-test-files/schema/v2/directives/query/default-arguments-should-disable-aggregation.adoc rename to core/src/test/resources/tck-test-files/schema/v2/directives/query.adoc index 27a0c36e..63baa9a2 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/query/default-arguments-should-disable-aggregation.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/query.adoc @@ -1,9 +1,13 @@ :toc: +:toclevels: 42 -= @query directive -> on SCHEMA -> default arguments should disable aggregation += @query directive -== Source schema +== on SCHEMA +=== default arguments should disable aggregation + +.Schema [source,graphql,schema=true] ---- type Actor { @@ -20,8 +24,6 @@ extend schema @query { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -138,3 +140,37 @@ input MovieWhere { ---- ''' + +=== should disable read and aggregate + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String +} + +type Movie { + title: String +} + +extend schema @query(read: false) { + query: Query +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Query { + _empty: Boolean +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/query/should-disable-read-and-aggregate.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/query/should-disable-read-and-aggregate.adoc deleted file mode 100644 index 3a0b439a..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/query/should-disable-read-and-aggregate.adoc +++ /dev/null @@ -1,37 +0,0 @@ -:toc: - -= @query directive -> on SCHEMA -> should disable read and aggregate - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - name: String -} - -type Movie { - title: String -} - -extend schema @query(read: false) { - query: Query -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Query { - _empty: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate.adoc new file mode 100644 index 00000000..69443bd0 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate.adoc @@ -0,0 +1,828 @@ +:toc: +:toclevels: 42 + += @relationship directive, aggregate argument + +== should disable nested aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! +} + +type Movie { + title: String + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +== snapshot tests + +=== aggregate argument set as false + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! +} + +type Movie { + title: String + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +=== on INTERFACE + +==== aggregate argument set as false, (no-op as abstract does not support aggregation) + +.Schema +[source,graphql,schema=true] +---- +type Actor implements Person { + username: String! + password: String! +} + +interface Person { + username: String! + password: String! +} + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + password: String! + username: String! +} + +type Actor implements Person { + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +enum PersonImplementation { + Actor +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + password: SortDirection + username: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + typename_IN: [PersonImplementation!] + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +---- + +''' + +=== on UNION + +==== aggregate argument set as false, (no-op as abstract does not support aggregation) + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! +} + +type Person { + name: String! +} + +union CastMember = Actor | Person + +type Movie { + title: String + actors: [CastMember!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union CastMember = Actor | Person + +type Actor { + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: CastMemberWhere): [CastMember!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: CastMember! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + castMembers(options: QueryOptions, where: CastMemberWhere): [CastMember!]! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input CastMemberWhere { + Actor: ActorWhere + Person: PersonWhere +} + +input MovieActorsActorConnectionWhere { + AND: [MovieActorsActorConnectionWhere!] + NOT: MovieActorsActorConnectionWhere + OR: [MovieActorsActorConnectionWhere!] + node: ActorWhere +} + +input MovieActorsConnectionWhere { + Actor: MovieActorsActorConnectionWhere + Person: MovieActorsPersonConnectionWhere +} + +input MovieActorsPersonConnectionWhere { + AND: [MovieActorsPersonConnectionWhere!] + NOT: MovieActorsPersonConnectionWhere + OR: [MovieActorsPersonConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related CastMembers match this filter" + actors_ALL: CastMemberWhere + "Return Movies where none of the related CastMembers match this filter" + actors_NONE: CastMemberWhere + "Return Movies where one of the related CastMembers match this filter" + actors_SINGLE: CastMemberWhere + "Return Movies where some of the related CastMembers match this filter" + actors_SOME: CastMemberWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/should-disable-nested-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/should-disable-nested-aggregation.adoc deleted file mode 100644 index 2eea4a3b..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/should-disable-nested-aggregation.adoc +++ /dev/null @@ -1,177 +0,0 @@ -:toc: - -= @relationship directive, aggregate argument -> should disable nested aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! -} - -type Movie { - title: String - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/snapshot-tests/on-interface/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/snapshot-tests/on-interface/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc deleted file mode 100644 index 55ff1be4..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/snapshot-tests/on-interface/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc +++ /dev/null @@ -1,234 +0,0 @@ -:toc: - -= @relationship directive, aggregate argument -> snapshot tests -> on INTERFACE -> aggregate argument set as false, (no-op as abstract does not support aggregation) - -== Source schema - -[source,graphql,schema=true] ----- -type Actor implements Person { - username: String! - password: String! -} - -interface Person { - username: String! - password: String! -} - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - password: String! - username: String! -} - -type Actor implements Person { - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -enum PersonImplementation { - Actor -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - password: SortDirection - username: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - typename_IN: [PersonImplementation!] - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/snapshot-tests/on-union/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/snapshot-tests/on-union/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc deleted file mode 100644 index d3bd802a..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-aggregate/snapshot-tests/on-union/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc +++ /dev/null @@ -1,245 +0,0 @@ -:toc: - -= @relationship directive, aggregate argument -> snapshot tests -> on UNION -> aggregate argument set as false, (no-op as abstract does not support aggregation) - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! -} - -type Person { - name: String! -} - -union CastMember = Actor | Person - -type Movie { - title: String - actors: [CastMember!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union CastMember = Actor | Person - -type Actor { - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: CastMemberWhere): [CastMember!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: CastMember! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - castMembers(options: QueryOptions, where: CastMemberWhere): [CastMember!]! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input CastMemberWhere { - Actor: ActorWhere - Person: PersonWhere -} - -input MovieActorsActorConnectionWhere { - AND: [MovieActorsActorConnectionWhere!] - NOT: MovieActorsActorConnectionWhere - OR: [MovieActorsActorConnectionWhere!] - node: ActorWhere -} - -input MovieActorsConnectionWhere { - Actor: MovieActorsActorConnectionWhere - Person: MovieActorsPersonConnectionWhere -} - -input MovieActorsPersonConnectionWhere { - AND: [MovieActorsPersonConnectionWhere!] - NOT: MovieActorsPersonConnectionWhere - OR: [MovieActorsPersonConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related CastMembers match this filter" - actors_ALL: CastMemberWhere - "Return Movies where none of the related CastMembers match this filter" - actors_NONE: CastMemberWhere - "Return Movies where one of the related CastMembers match this filter" - actors_SINGLE: CastMemberWhere - "Return Movies where some of the related CastMembers match this filter" - actors_SOME: CastMemberWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations.adoc new file mode 100644 index 00000000..5cdc0577 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations.adoc @@ -0,0 +1,5959 @@ +:toc: +:toclevels: 42 + += Relationship nested operations + +== Related to a concrete type + +=== Should not generate UpdateFieldInput input with no nested operations + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation CREATE specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation CONNECT specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation UPDATE specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation DELETE specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation DISCONNECT specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Should not generate any nested operations if only CONNECT_OR_CREATE is specified and the related type does not have a unique field + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT_OR_CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Two relationships with nested operations specified on one + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionSort { + node: PersonSort +} + +input MovieProducersConnectionWhere { + AND: [MovieProducersConnectionWhere!] + NOT: MovieProducersConnectionWhere + OR: [MovieProducersConnectionWhere!] + node: PersonWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Two relationships with nested operations specified on both + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionSort { + node: PersonSort +} + +input MovieProducersConnectionWhere { + AND: [MovieProducersConnectionWhere!] + NOT: MovieProducersConnectionWhere + OR: [MovieProducersConnectionWhere!] + node: PersonWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +== Related to a union type + +=== Should not generate UpdateFieldInput input with no nested operations + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation CREATE specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation CONNECT specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation UPDATE specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation DELETE specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation DISCONNECT specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Should not generate any nested operations if only CONNECT_OR_CREATE is specified and the related type does not have a unique field + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT_OR_CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Two relationships with nested operations specified on one + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionWhere { + PersonOne: MovieProducersPersonOneConnectionWhere + PersonTwo: MovieProducersPersonTwoConnectionWhere +} + +input MovieProducersPersonOneConnectionWhere { + AND: [MovieProducersPersonOneConnectionWhere!] + NOT: MovieProducersPersonOneConnectionWhere + OR: [MovieProducersPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieProducersPersonTwoConnectionWhere { + AND: [MovieProducersPersonTwoConnectionWhere!] + NOT: MovieProducersPersonTwoConnectionWhere + OR: [MovieProducersPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Two relationships with nested operations specified on both + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionWhere { + PersonOne: MovieProducersPersonOneConnectionWhere + PersonTwo: MovieProducersPersonTwoConnectionWhere +} + +input MovieProducersPersonOneConnectionWhere { + AND: [MovieProducersPersonOneConnectionWhere!] + NOT: MovieProducersPersonOneConnectionWhere + OR: [MovieProducersPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieProducersPersonTwoConnectionWhere { + AND: [MovieProducersPersonTwoConnectionWhere!] + NOT: MovieProducersPersonTwoConnectionWhere + OR: [MovieProducersPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +== Related to an interface type + +=== Should not generate UpdateFieldInput input with no nested operations + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation CREATE specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation CONNECT specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation UPDATE specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation DELETE specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation DISCONNECT specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Two relationships with nested operations specified on one + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionSort { + node: PersonSort +} + +input MovieProducersConnectionWhere { + AND: [MovieProducersConnectionWhere!] + NOT: MovieProducersConnectionWhere + OR: [MovieProducersConnectionWhere!] + node: PersonWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Two relationships with nested operations specified on both + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE, DELETE]) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionSort { + node: PersonSort +} + +input MovieProducersConnectionWhere { + AND: [MovieProducersConnectionWhere!] + NOT: MovieProducersConnectionWhere + OR: [MovieProducersConnectionWhere!] + node: PersonWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc deleted file mode 100644 index 8def6fe4..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Should not generate any nested operations if only CONNECT_OR_CREATE is specified and the related type does not have a unique field - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT_OR_CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc deleted file mode 100644 index 77c0d5da..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Should not generate UpdateFieldInput input with no nested operations - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-connect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-connect-specified.adoc deleted file mode 100644 index 446ab2b8..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-connect-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation CONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-create-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-create-specified.adoc deleted file mode 100644 index a7c13705..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-create-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation CREATE specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-delete-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-delete-specified.adoc deleted file mode 100644 index 25b6ef74..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-delete-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation DELETE specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-disconnect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-disconnect-specified.adoc deleted file mode 100644 index ea81ffbe..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-disconnect-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation DISCONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-update-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-update-specified.adoc deleted file mode 100644 index c65d9b20..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-update-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation UPDATE specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-both.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-both.adoc deleted file mode 100644 index 5e07c418..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-both.adoc +++ /dev/null @@ -1,210 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Two relationships with nested operations specified on both - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionSort { - node: PersonSort -} - -input MovieProducersConnectionWhere { - AND: [MovieProducersConnectionWhere!] - NOT: MovieProducersConnectionWhere - OR: [MovieProducersConnectionWhere!] - node: PersonWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-one.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-one.adoc deleted file mode 100644 index c677036e..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-one.adoc +++ /dev/null @@ -1,210 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Two relationships with nested operations specified on one - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionSort { - node: PersonSort -} - -input MovieProducersConnectionWhere { - AND: [MovieProducersConnectionWhere!] - NOT: MovieProducersConnectionWhere - OR: [MovieProducersConnectionWhere!] - node: PersonWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc deleted file mode 100644 index e85c734a..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Should not generate any nested operations if only CONNECT_OR_CREATE is specified and the related type does not have a unique field - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT_OR_CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc deleted file mode 100644 index 96f0b21d..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Should not generate UpdateFieldInput input with no nested operations - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-connect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-connect-specified.adoc deleted file mode 100644 index bd34f3b6..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-connect-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation CONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-create-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-create-specified.adoc deleted file mode 100644 index 1be16ffc..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-create-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation CREATE specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-delete-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-delete-specified.adoc deleted file mode 100644 index b7121f99..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-delete-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation DELETE specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-disconnect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-disconnect-specified.adoc deleted file mode 100644 index 0c0ef0ab..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-disconnect-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation DISCONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-update-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-update-specified.adoc deleted file mode 100644 index cdf46108..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-update-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation UPDATE specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-both.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-both.adoc deleted file mode 100644 index 70cf37f3..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-both.adoc +++ /dev/null @@ -1,286 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Two relationships with nested operations specified on both - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionWhere { - PersonOne: MovieProducersPersonOneConnectionWhere - PersonTwo: MovieProducersPersonTwoConnectionWhere -} - -input MovieProducersPersonOneConnectionWhere { - AND: [MovieProducersPersonOneConnectionWhere!] - NOT: MovieProducersPersonOneConnectionWhere - OR: [MovieProducersPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieProducersPersonTwoConnectionWhere { - AND: [MovieProducersPersonTwoConnectionWhere!] - NOT: MovieProducersPersonTwoConnectionWhere - OR: [MovieProducersPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-one.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-one.adoc deleted file mode 100644 index 73b83e47..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-one.adoc +++ /dev/null @@ -1,286 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Two relationships with nested operations specified on one - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionWhere { - PersonOne: MovieProducersPersonOneConnectionWhere - PersonTwo: MovieProducersPersonTwoConnectionWhere -} - -input MovieProducersPersonOneConnectionWhere { - AND: [MovieProducersPersonOneConnectionWhere!] - NOT: MovieProducersPersonOneConnectionWhere - OR: [MovieProducersPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieProducersPersonTwoConnectionWhere { - AND: [MovieProducersPersonTwoConnectionWhere!] - NOT: MovieProducersPersonTwoConnectionWhere - OR: [MovieProducersPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc deleted file mode 100644 index 28cc659b..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Should not generate UpdateFieldInput input with no nested operations - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-connect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-connect-specified.adoc deleted file mode 100644 index 2fd4d4d2..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-connect-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation CONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-create-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-create-specified.adoc deleted file mode 100644 index 4548ff56..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-create-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation CREATE specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-delete-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-delete-specified.adoc deleted file mode 100644 index d0de8701..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-delete-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation DELETE specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-disconnect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-disconnect-specified.adoc deleted file mode 100644 index c1300901..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-disconnect-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation DISCONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-update-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-update-specified.adoc deleted file mode 100644 index 226df35f..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-update-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation UPDATE specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-both.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-both.adoc deleted file mode 100644 index baa7bcc6..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-both.adoc +++ /dev/null @@ -1,308 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Two relationships with nested operations specified on both - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE, DELETE]) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionSort { - node: PersonSort -} - -input MovieProducersConnectionWhere { - AND: [MovieProducersConnectionWhere!] - NOT: MovieProducersConnectionWhere - OR: [MovieProducersConnectionWhere!] - node: PersonWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-one.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-one.adoc deleted file mode 100644 index c3cda6d5..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-one.adoc +++ /dev/null @@ -1,308 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Two relationships with nested operations specified on one - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionSort { - node: PersonSort -} - -input MovieProducersConnectionWhere { - AND: [MovieProducersConnectionWhere!] - NOT: MovieProducersConnectionWhere - OR: [MovieProducersConnectionWhere!] - node: PersonWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-properties.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-properties.adoc index d043ea17..28d27dec 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-properties.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship-properties.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Relationship-properties -> Relationship Properties += Relationship-properties -== Source schema +== Relationship Properties +.Schema [source,graphql,schema=true] ---- type Actor { @@ -23,8 +25,6 @@ type ActedIn @relationshipProperties { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -259,3 +259,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship/multi-relationship.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship.adoc similarity index 58% rename from core/src/test/resources/tck-test-files/schema/v2/directives/relationship/multi-relationship.adoc rename to core/src/test/resources/tck-test-files/schema/v2/directives/relationship.adoc index 810e4ac1..69993e81 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship/multi-relationship.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship.adoc @@ -1,14 +1,15 @@ :toc: +:toclevels: 42 -= Relationship -> Multi Relationship += Relationship -== Source schema +== Single Relationship +.Schema [source,graphql,schema=true] ---- type Actor { name: String - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) } type Movie { @@ -17,7 +18,171 @@ type Movie { } ---- -== Augmented schema +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + name: String +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +---- + +''' + +== Multi Relationship + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Movie { + id: ID + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- .Augmented Schema [source,graphql] @@ -208,3 +373,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship/single-relationship.adoc b/core/src/test/resources/tck-test-files/schema/v2/directives/relationship/single-relationship.adoc deleted file mode 100644 index 834ba9b7..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/directives/relationship/single-relationship.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship -> Single Relationship - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - name: String -} - -type Movie { - id: ID - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - name: String -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/enum.adoc b/core/src/test/resources/tck-test-files/schema/v2/enum.adoc index 70457653..4ff56284 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/enum.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/enum.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Enum -> Enums += Enum -== Source schema +== Enums +.Schema [source,graphql,schema=true] ---- enum Status { @@ -17,8 +19,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -91,3 +91,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments.adoc new file mode 100644 index 00000000..50ec009b --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments.adoc @@ -0,0 +1,823 @@ +:toc: +:toclevels: 42 + += Comments + +== Simple + +.Schema +[source,graphql,schema=true] +---- +"A custom scalar." +scalar CustomScalar + +"An enumeration of movie genres." +enum Genre { + ACTION + DRAMA + ROMANCE +} + +"""A type describing a movie.""" +type Movie { + id: ID + "The number of actors who acted in the movie." + actorCount: Int + """The average rating for the movie.""" + averageRating: Float + """ + Is the movie active? + + This is measured based on annual profit. + """ + isActive: Boolean + genre: Genre + customScalar: CustomScalar +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"A type describing a movie." +type Movie { + "The number of actors who acted in the movie." + actorCount: Int + "The average rating for the movie." + averageRating: Float + customScalar: CustomScalar + genre: Genre + id: ID + """ + Is the movie active? + + This is measured based on annual profit. + """ + isActive: Boolean +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enumeration of movie genres." +enum Genre { + ACTION + DRAMA + ROMANCE +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +"A custom scalar." +scalar CustomScalar + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + customScalar: SortDirection + genre: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + customScalar: CustomScalar + customScalar_IN: [CustomScalar] + genre: Genre + genre_IN: [Genre] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + +== Relationship + +=== Simple + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String +} + +type Movie { + id: ID + "Actors in Movie" + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + name: String +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + "Actors in Movie" + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +---- + +''' + +=== Interface + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! +} + +type Movie implements Production { + title: String! + runtime: Int! +} + +type Series implements Production { + title: String! + episodes: Int! +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + name: String! + "Acted in Production" + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + title: String! +} + +""" +The edge properties for the following fields: +* Actor.actedIn +""" +type ActedIn { + screenTime: Int! +} + +type Actor { + "Acted in Production" + actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! + name: String! +} + +type ActorActedInConnection { + edges: [ActorActedInRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorActedInRelationship { + cursor: String! + node: Production! + properties: ActedIn! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie implements Production { + runtime: Int! + title: String! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! + series(options: SeriesOptions, where: SeriesWhere): [Series!]! + seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! +} + +type Series implements Production { + episodes: Int! + title: String! +} + +type SeriesConnection { + edges: [SeriesEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesEdge { + cursor: String! + node: Series! +} + +enum ProductionImplementation { + Movie + Series +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + screenTime: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + screenTime: Int + screenTime_GT: Int + screenTime_GTE: Int + screenTime_IN: [Int!] + screenTime_LT: Int + screenTime_LTE: Int +} + +input ActorActedInConnectionSort { + edge: ActedInSort + node: ProductionSort +} + +input ActorActedInConnectionWhere { + AND: [ActorActedInConnectionWhere!] + NOT: ActorActedInConnectionWhere + OR: [ActorActedInConnectionWhere!] + edge: ActedInWhere + node: ProductionWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorActedInConnections match this filter" + actedInConnection_ALL: ActorActedInConnectionWhere + "Return Actors where none of the related ActorActedInConnections match this filter" + actedInConnection_NONE: ActorActedInConnectionWhere + "Return Actors where one of the related ActorActedInConnections match this filter" + actedInConnection_SINGLE: ActorActedInConnectionWhere + "Return Actors where some of the related ActorActedInConnections match this filter" + actedInConnection_SOME: ActorActedInConnectionWhere + "Return Actors where all of the related Productions match this filter" + actedIn_ALL: ProductionWhere + "Return Actors where none of the related Productions match this filter" + actedIn_NONE: ProductionWhere + "Return Actors where one of the related Productions match this filter" + actedIn_SINGLE: ProductionWhere + "Return Actors where some of the related Productions match this filter" + actedIn_SOME: ProductionWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +input SeriesOptions { + limit: Int + offset: Int + "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." + sort: [SeriesSort!] +} + +"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." +input SeriesSort { + episodes: SortDirection + title: SortDirection +} + +input SeriesWhere { + AND: [SeriesWhere!] + NOT: SeriesWhere + OR: [SeriesWhere!] + episodes: Int + episodes_GT: Int + episodes_GTE: Int + episodes_IN: [Int!] + episodes_LT: Int + episodes_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +---- + +''' + +=== Unions + +.Schema +[source,graphql,schema=true] +---- +union Search = Movie | Genre + +type Genre { + id: ID +} + +type Movie { + id: ID + search: [Search!]! @relationship(type: "SEARCH", direction: OUT) + searchNoDirective: Search +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Search = Genre | Movie + +type Genre { + id: ID +} + +type GenreEdge { + cursor: String! + node: Genre! +} + +type GenresConnection { + edges: [GenreEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + id: ID + search(directed: Boolean = true, options: QueryOptions, where: SearchWhere): [Search!]! + searchConnection(after: String, directed: Boolean = true, first: Int, where: MovieSearchConnectionWhere): MovieSearchConnection! + searchNoDirective: Search +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieSearchConnection { + edges: [MovieSearchRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieSearchRelationship { + cursor: String! + node: Search! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + genres(options: GenreOptions, where: GenreWhere): [Genre!]! + genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + searches(options: QueryOptions, where: SearchWhere): [Search!]! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input GenreOptions { + limit: Int + offset: Int + "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." + sort: [GenreSort!] +} + +"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." +input GenreSort { + id: SortDirection +} + +input GenreWhere { + AND: [GenreWhere!] + NOT: GenreWhere + OR: [GenreWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieSearchConnectionWhere { + Genre: MovieSearchGenreConnectionWhere + Movie: MovieSearchMovieConnectionWhere +} + +input MovieSearchGenreConnectionWhere { + AND: [MovieSearchGenreConnectionWhere!] + NOT: MovieSearchGenreConnectionWhere + OR: [MovieSearchGenreConnectionWhere!] + node: GenreWhere +} + +input MovieSearchMovieConnectionWhere { + AND: [MovieSearchMovieConnectionWhere!] + NOT: MovieSearchMovieConnectionWhere + OR: [MovieSearchMovieConnectionWhere!] + node: MovieWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieSearchConnections match this filter" + searchConnection_ALL: MovieSearchConnectionWhere + "Return Movies where none of the related MovieSearchConnections match this filter" + searchConnection_NONE: MovieSearchConnectionWhere + "Return Movies where one of the related MovieSearchConnections match this filter" + searchConnection_SINGLE: MovieSearchConnectionWhere + "Return Movies where some of the related MovieSearchConnections match this filter" + searchConnection_SOME: MovieSearchConnectionWhere + "Return Movies where all of the related Searches match this filter" + search_ALL: SearchWhere + "Return Movies where none of the related Searches match this filter" + search_NONE: SearchWhere + "Return Movies where one of the related Searches match this filter" + search_SINGLE: SearchWhere + "Return Movies where some of the related Searches match this filter" + search_SOME: SearchWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +input SearchWhere { + Genre: GenreWhere + Movie: MovieWhere +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/interface.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/interface.adoc deleted file mode 100644 index 48a10862..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/interface.adoc +++ /dev/null @@ -1,314 +0,0 @@ -:toc: - -= Comments -> Relationship -> Interface - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! -} - -type Movie implements Production { - title: String! - runtime: Int! -} - -type Series implements Production { - title: String! - episodes: Int! -} - -type ActedIn @relationshipProperties { - screenTime: Int! -} - -type Actor { - name: String! - "Acted in Production" - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - title: String! -} - -""" -The edge properties for the following fields: -* Actor.actedIn -""" -type ActedIn { - screenTime: Int! -} - -type Actor { - "Acted in Production" - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - runtime: Int! - title: String! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - episodes: Int! - title: String! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - screenTime: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - screenTime: Int - screenTime_GT: Int - screenTime_GTE: Int - screenTime_IN: [Int!] - screenTime_LT: Int - screenTime_LTE: Int -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/simple.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/simple.adoc deleted file mode 100644 index 425759eb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/simple.adoc +++ /dev/null @@ -1,171 +0,0 @@ -:toc: - -= Comments -> Relationship -> Simple - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - name: String -} - -type Movie { - id: ID - "Actors in Movie" - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - name: String -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - "Actors in Movie" - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/unions.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/unions.adoc deleted file mode 100644 index 4c507a11..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/relationship/unions.adoc +++ /dev/null @@ -1,195 +0,0 @@ -:toc: - -= Comments -> Relationship -> Unions - -== Source schema - -[source,graphql,schema=true] ----- -union Search = Movie | Genre - -type Genre { - id: ID -} - -type Movie { - id: ID - search: [Search!]! @relationship(type: "SEARCH", direction: OUT) - searchNoDirective: Search -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Search = Genre | Movie - -type Genre { - id: ID -} - -type GenreEdge { - cursor: String! - node: Genre! -} - -type GenresConnection { - edges: [GenreEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - id: ID - search(directed: Boolean = true, options: QueryOptions, where: SearchWhere): [Search!]! - searchConnection(after: String, directed: Boolean = true, first: Int, where: MovieSearchConnectionWhere): MovieSearchConnection! - searchNoDirective: Search -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieSearchConnection { - edges: [MovieSearchRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieSearchRelationship { - cursor: String! - node: Search! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - genres(options: GenreOptions, where: GenreWhere): [Genre!]! - genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - searches(options: QueryOptions, where: SearchWhere): [Search!]! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input GenreOptions { - limit: Int - offset: Int - "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." - sort: [GenreSort!] -} - -"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." -input GenreSort { - id: SortDirection -} - -input GenreWhere { - AND: [GenreWhere!] - NOT: GenreWhere - OR: [GenreWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieSearchConnectionWhere { - Genre: MovieSearchGenreConnectionWhere - Movie: MovieSearchMovieConnectionWhere -} - -input MovieSearchGenreConnectionWhere { - AND: [MovieSearchGenreConnectionWhere!] - NOT: MovieSearchGenreConnectionWhere - OR: [MovieSearchGenreConnectionWhere!] - node: GenreWhere -} - -input MovieSearchMovieConnectionWhere { - AND: [MovieSearchMovieConnectionWhere!] - NOT: MovieSearchMovieConnectionWhere - OR: [MovieSearchMovieConnectionWhere!] - node: MovieWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieSearchConnections match this filter" - searchConnection_ALL: MovieSearchConnectionWhere - "Return Movies where none of the related MovieSearchConnections match this filter" - searchConnection_NONE: MovieSearchConnectionWhere - "Return Movies where one of the related MovieSearchConnections match this filter" - searchConnection_SINGLE: MovieSearchConnectionWhere - "Return Movies where some of the related MovieSearchConnections match this filter" - searchConnection_SOME: MovieSearchConnectionWhere - "Return Movies where all of the related Searches match this filter" - search_ALL: SearchWhere - "Return Movies where none of the related Searches match this filter" - search_NONE: SearchWhere - "Return Movies where one of the related Searches match this filter" - search_SINGLE: SearchWhere - "Return Movies where some of the related Searches match this filter" - search_SOME: SearchWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - -input SearchWhere { - Genre: GenreWhere - Movie: MovieWhere -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/simple.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/simple.adoc deleted file mode 100644 index 5d62d1cb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/comments/simple.adoc +++ /dev/null @@ -1,152 +0,0 @@ -:toc: - -= Comments -> Simple - -== Source schema - -[source,graphql,schema=true] ----- -"A custom scalar." -scalar CustomScalar - -"An enumeration of movie genres." -enum Genre { - ACTION - DRAMA - ROMANCE -} - -"""A type describing a movie.""" -type Movie { - id: ID - "The number of actors who acted in the movie." - actorCount: Int - """The average rating for the movie.""" - averageRating: Float - """ - Is the movie active? - - This is measured based on annual profit. - """ - isActive: Boolean - genre: Genre - customScalar: CustomScalar -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -"A type describing a movie." -type Movie { - "The number of actors who acted in the movie." - actorCount: Int - "The average rating for the movie." - averageRating: Float - customScalar: CustomScalar - genre: Genre - id: ID - """ - Is the movie active? - - This is measured based on annual profit. - """ - isActive: Boolean -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enumeration of movie genres." -enum Genre { - ACTION - DRAMA - ROMANCE -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -"A custom scalar." -scalar CustomScalar - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - customScalar: SortDirection - genre: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - customScalar: CustomScalar - customScalar_IN: [CustomScalar] - genre: Genre - genre_IN: [Genre] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve.adoc new file mode 100644 index 00000000..d97261a2 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve.adoc @@ -0,0 +1,1389 @@ +:toc: +:toclevels: 42 + += Directive-preserve + +== Custom directives preserved + +.Schema +[source,graphql,schema=true] +---- +directive @preservedTopLevel(string: String, int: Int, float: Float, boolean: Boolean) on OBJECT + +directive @preservedFieldLevel(string: String, int: Int, float: Float, boolean: Boolean) on FIELD_DEFINITION + +type Movie @preservedTopLevel { + id: ID @preservedFieldLevel(string: "str", int: 12, float: 1.2, boolean: true) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +directive @preservedFieldLevel(boolean: Boolean, float: Float, int: Int, string: String) on FIELD_DEFINITION + +directive @preservedTopLevel(boolean: Boolean, float: Float, int: Int, string: String) on OBJECT + +type Movie @preservedTopLevel { + id: ID @preservedFieldLevel(boolean : true, float : 1.2, int : 12, string : "str") +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +---- + +''' + +== Directives on relations preserved + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String + year: Int + imdbRating: Float + genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT) @deprecated(reason: "Do not use") +} + +type Genre { + name: String + movies: [Movie!]! @relationship(type: "IN_GENRE", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Genre { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [GenreMoviesConnectionSort!], where: GenreMoviesConnectionWhere): GenreMoviesConnection! + name: String +} + +type GenreEdge { + cursor: String! + node: Genre! +} + +type GenreMoviesConnection { + edges: [GenreMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type GenreMoviesRelationship { + cursor: String! + node: Movie! +} + +type GenresConnection { + edges: [GenreEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + genres(directed: Boolean = true, options: GenreOptions, where: GenreWhere): [Genre!]! @deprecated(reason : "Do not use") + genresConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieGenresConnectionSort!], where: MovieGenresConnectionWhere): MovieGenresConnection! @deprecated(reason : "Do not use") + imdbRating: Float + title: String + year: Int +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieGenresConnection { + edges: [MovieGenresRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieGenresRelationship { + cursor: String! + node: Genre! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + genres(options: GenreOptions, where: GenreWhere): [Genre!]! + genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input GenreMoviesConnectionSort { + node: MovieSort +} + +input GenreMoviesConnectionWhere { + AND: [GenreMoviesConnectionWhere!] + NOT: GenreMoviesConnectionWhere + OR: [GenreMoviesConnectionWhere!] + node: MovieWhere +} + +input GenreOptions { + limit: Int + offset: Int + "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." + sort: [GenreSort!] +} + +"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." +input GenreSort { + name: SortDirection +} + +input GenreWhere { + AND: [GenreWhere!] + NOT: GenreWhere + OR: [GenreWhere!] + "Return Genres where all of the related GenreMoviesConnections match this filter" + moviesConnection_ALL: GenreMoviesConnectionWhere + "Return Genres where none of the related GenreMoviesConnections match this filter" + moviesConnection_NONE: GenreMoviesConnectionWhere + "Return Genres where one of the related GenreMoviesConnections match this filter" + moviesConnection_SINGLE: GenreMoviesConnectionWhere + "Return Genres where some of the related GenreMoviesConnections match this filter" + moviesConnection_SOME: GenreMoviesConnectionWhere + "Return Genres where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Genres where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Genres where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Genres where some of the related Movies match this filter" + movies_SOME: MovieWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input MovieGenresConnectionSort { + node: GenreSort +} + +input MovieGenresConnectionWhere { + AND: [MovieGenresConnectionWhere!] + NOT: MovieGenresConnectionWhere + OR: [MovieGenresConnectionWhere!] + node: GenreWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + imdbRating: SortDirection + title: SortDirection + year: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieGenresConnections match this filter" + genresConnection_ALL: MovieGenresConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where none of the related MovieGenresConnections match this filter" + genresConnection_NONE: MovieGenresConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where one of the related MovieGenresConnections match this filter" + genresConnection_SINGLE: MovieGenresConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where some of the related MovieGenresConnections match this filter" + genresConnection_SOME: MovieGenresConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where all of the related Genres match this filter" + genres_ALL: GenreWhere @deprecated(reason : "Do not use") + "Return Movies where none of the related Genres match this filter" + genres_NONE: GenreWhere @deprecated(reason : "Do not use") + "Return Movies where one of the related Genres match this filter" + genres_SINGLE: GenreWhere @deprecated(reason : "Do not use") + "Return Movies where some of the related Genres match this filter" + genres_SOME: GenreWhere @deprecated(reason : "Do not use") + imdbRating: Float + imdbRating_GT: Float + imdbRating_GTE: Float + imdbRating_IN: [Float] + imdbRating_LT: Float + imdbRating_LTE: Float + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String + year: Int + year_GT: Int + year_GTE: Int + year_IN: [Int] + year_LT: Int + year_LTE: Int +} + +---- + +''' + +== Directives on implemented interface relations preserved - field not declared relationship + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! + actors: [Actor!]! +} + +type Movie implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") @deprecated(reason: "Do not use") + runtime: Int! +} + +type Series implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") + episodes: Int! +} + +type ActedIn @relationshipProperties { + role: String! +} + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + actors: [Actor!]! + title: String! +} + +""" +The edge properties for the following fields: +* Movie.actors +* Series.actors +* Actor.actedIn +""" +type ActedIn { + role: String! +} + +type Actor { + actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! + name: String! +} + +type ActorActedInConnection { + edges: [ActorActedInRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorActedInRelationship { + cursor: String! + node: Production! + properties: ActedIn! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie implements Production { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! @deprecated(reason : "Do not use") + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! @deprecated(reason : "Do not use") + runtime: Int! + title: String! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! + series(options: SeriesOptions, where: SeriesWhere): [Series!]! + seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! +} + +type Series implements Production { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [SeriesActorsConnectionSort!], where: SeriesActorsConnectionWhere): SeriesActorsConnection! + episodes: Int! + title: String! +} + +type SeriesActorsConnection { + edges: [SeriesActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type SeriesConnection { + edges: [SeriesEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesEdge { + cursor: String! + node: Series! +} + +enum ProductionImplementation { + Movie + Series +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + role: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + role: String + role_CONTAINS: String + role_ENDS_WITH: String + role_IN: [String!] + role_STARTS_WITH: String +} + +input ActorActedInConnectionSort { + edge: ActedInSort + node: ProductionSort +} + +input ActorActedInConnectionWhere { + AND: [ActorActedInConnectionWhere!] + NOT: ActorActedInConnectionWhere + OR: [ActorActedInConnectionWhere!] + edge: ActedInWhere + node: ProductionWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorActedInConnections match this filter" + actedInConnection_ALL: ActorActedInConnectionWhere + "Return Actors where none of the related ActorActedInConnections match this filter" + actedInConnection_NONE: ActorActedInConnectionWhere + "Return Actors where one of the related ActorActedInConnections match this filter" + actedInConnection_SINGLE: ActorActedInConnectionWhere + "Return Actors where some of the related ActorActedInConnections match this filter" + actedInConnection_SOME: ActorActedInConnectionWhere + "Return Actors where all of the related Productions match this filter" + actedIn_ALL: ProductionWhere + "Return Actors where none of the related Productions match this filter" + actedIn_NONE: ProductionWhere + "Return Actors where one of the related Productions match this filter" + actedIn_SINGLE: ProductionWhere + "Return Actors where some of the related Productions match this filter" + actedIn_SOME: ProductionWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + edge: ActedInSort + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere @deprecated(reason : "Do not use") + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere @deprecated(reason : "Do not use") + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere @deprecated(reason : "Do not use") + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere @deprecated(reason : "Do not use") + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere @deprecated(reason : "Do not use") + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +input SeriesActorsConnectionSort { + edge: ActedInSort + node: ActorSort +} + +input SeriesActorsConnectionWhere { + AND: [SeriesActorsConnectionWhere!] + NOT: SeriesActorsConnectionWhere + OR: [SeriesActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input SeriesOptions { + limit: Int + offset: Int + "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." + sort: [SeriesSort!] +} + +"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." +input SeriesSort { + episodes: SortDirection + title: SortDirection +} + +input SeriesWhere { + AND: [SeriesWhere!] + NOT: SeriesWhere + OR: [SeriesWhere!] + "Return Series where all of the related SeriesActorsConnections match this filter" + actorsConnection_ALL: SeriesActorsConnectionWhere + "Return Series where none of the related SeriesActorsConnections match this filter" + actorsConnection_NONE: SeriesActorsConnectionWhere + "Return Series where one of the related SeriesActorsConnections match this filter" + actorsConnection_SINGLE: SeriesActorsConnectionWhere + "Return Series where some of the related SeriesActorsConnections match this filter" + actorsConnection_SOME: SeriesActorsConnectionWhere + "Return Series where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Series where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Series where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Series where some of the related Actors match this filter" + actors_SOME: ActorWhere + episodes: Int + episodes_GT: Int + episodes_GTE: Int + episodes_IN: [Int!] + episodes_LT: Int + episodes_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +---- + +''' + +== Directives on base interface preserved + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! + actors: [Actor!]! @deprecated(reason: "Do not use") +} + +type Movie implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") + runtime: Int! +} + +type Series implements Production { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") + episodes: Int! +} + +type ActedIn @relationshipProperties { + role: String! +} + +type Actor { + name: String! + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + actors: [Actor!]! @deprecated(reason : "Do not use") + title: String! +} + +""" +The edge properties for the following fields: +* Movie.actors +* Series.actors +* Actor.actedIn +""" +type ActedIn { + role: String! +} + +type Actor { + actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! + name: String! +} + +type ActorActedInConnection { + edges: [ActorActedInRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorActedInRelationship { + cursor: String! + node: Production! + properties: ActedIn! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie implements Production { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + runtime: Int! + title: String! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! + series(options: SeriesOptions, where: SeriesWhere): [Series!]! + seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! +} + +type Series implements Production { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [SeriesActorsConnectionSort!], where: SeriesActorsConnectionWhere): SeriesActorsConnection! + episodes: Int! + title: String! +} + +type SeriesActorsConnection { + edges: [SeriesActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type SeriesConnection { + edges: [SeriesEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesEdge { + cursor: String! + node: Series! +} + +enum ProductionImplementation { + Movie + Series +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + role: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + role: String + role_CONTAINS: String + role_ENDS_WITH: String + role_IN: [String!] + role_STARTS_WITH: String +} + +input ActorActedInConnectionSort { + edge: ActedInSort + node: ProductionSort +} + +input ActorActedInConnectionWhere { + AND: [ActorActedInConnectionWhere!] + NOT: ActorActedInConnectionWhere + OR: [ActorActedInConnectionWhere!] + edge: ActedInWhere + node: ProductionWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorActedInConnections match this filter" + actedInConnection_ALL: ActorActedInConnectionWhere + "Return Actors where none of the related ActorActedInConnections match this filter" + actedInConnection_NONE: ActorActedInConnectionWhere + "Return Actors where one of the related ActorActedInConnections match this filter" + actedInConnection_SINGLE: ActorActedInConnectionWhere + "Return Actors where some of the related ActorActedInConnections match this filter" + actedInConnection_SOME: ActorActedInConnectionWhere + "Return Actors where all of the related Productions match this filter" + actedIn_ALL: ProductionWhere + "Return Actors where none of the related Productions match this filter" + actedIn_NONE: ProductionWhere + "Return Actors where one of the related Productions match this filter" + actedIn_SINGLE: ProductionWhere + "Return Actors where some of the related Productions match this filter" + actedIn_SOME: ProductionWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + edge: ActedInSort + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +input SeriesActorsConnectionSort { + edge: ActedInSort + node: ActorSort +} + +input SeriesActorsConnectionWhere { + AND: [SeriesActorsConnectionWhere!] + NOT: SeriesActorsConnectionWhere + OR: [SeriesActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input SeriesOptions { + limit: Int + offset: Int + "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." + sort: [SeriesSort!] +} + +"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." +input SeriesSort { + episodes: SortDirection + title: SortDirection +} + +input SeriesWhere { + AND: [SeriesWhere!] + NOT: SeriesWhere + OR: [SeriesWhere!] + "Return Series where all of the related SeriesActorsConnections match this filter" + actorsConnection_ALL: SeriesActorsConnectionWhere + "Return Series where none of the related SeriesActorsConnections match this filter" + actorsConnection_NONE: SeriesActorsConnectionWhere + "Return Series where one of the related SeriesActorsConnections match this filter" + actorsConnection_SINGLE: SeriesActorsConnectionWhere + "Return Series where some of the related SeriesActorsConnections match this filter" + actorsConnection_SOME: SeriesActorsConnectionWhere + "Return Series where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Series where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Series where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Series where some of the related Actors match this filter" + actors_SOME: ActorWhere + episodes: Int + episodes_GT: Int + episodes_GTE: Int + episodes_IN: [Int!] + episodes_LT: Int + episodes_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +---- + +''' + +== Directives on unions preserved + +.Schema +[source,graphql,schema=true] +---- +union Content = Blog | Post + +type Blog { + title: String + posts: [Post!]! @relationship(type: "HAS_POST", direction: OUT) +} + +type Post { + content: String @deprecated(reason: "Do not use post.content") +} + +type User { + name: String + content: [Content!]! @relationship(type: "HAS_CONTENT", direction: OUT) @deprecated(reason: "Do not use user.content") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Content = Blog | Post + +type Blog { + posts(directed: Boolean = true, options: PostOptions, where: PostWhere): [Post!]! + postsConnection(after: String, directed: Boolean = true, first: Int, sort: [BlogPostsConnectionSort!], where: BlogPostsConnectionWhere): BlogPostsConnection! + title: String +} + +type BlogEdge { + cursor: String! + node: Blog! +} + +type BlogPostsConnection { + edges: [BlogPostsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type BlogPostsRelationship { + cursor: String! + node: Post! +} + +type BlogsConnection { + edges: [BlogEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Post { + content: String @deprecated(reason : "Do not use post.content") +} + +type PostEdge { + cursor: String! + node: Post! +} + +type PostsConnection { + edges: [PostEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + blogs(options: BlogOptions, where: BlogWhere): [Blog!]! + blogsConnection(after: String, first: Int, sort: [BlogSort], where: BlogWhere): BlogsConnection! + contents(options: QueryOptions, where: ContentWhere): [Content!]! + posts(options: PostOptions, where: PostWhere): [Post!]! + postsConnection(after: String, first: Int, sort: [PostSort], where: PostWhere): PostsConnection! + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +type User { + content(directed: Boolean = true, options: QueryOptions, where: ContentWhere): [Content!]! @deprecated(reason : "Do not use user.content") + contentConnection(after: String, directed: Boolean = true, first: Int, where: UserContentConnectionWhere): UserContentConnection! @deprecated(reason : "Do not use user.content") + name: String +} + +type UserContentConnection { + edges: [UserContentRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type UserContentRelationship { + cursor: String! + node: Content! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input BlogOptions { + limit: Int + offset: Int + "Specify one or more BlogSort objects to sort Blogs by. The sorts will be applied in the order in which they are arranged in the array." + sort: [BlogSort!] +} + +input BlogPostsConnectionSort { + node: PostSort +} + +input BlogPostsConnectionWhere { + AND: [BlogPostsConnectionWhere!] + NOT: BlogPostsConnectionWhere + OR: [BlogPostsConnectionWhere!] + node: PostWhere +} + +"Fields to sort Blogs by. The order in which sorts are applied is not guaranteed when specifying many fields in one BlogSort object." +input BlogSort { + title: SortDirection +} + +input BlogWhere { + AND: [BlogWhere!] + NOT: BlogWhere + OR: [BlogWhere!] + "Return Blogs where all of the related BlogPostsConnections match this filter" + postsConnection_ALL: BlogPostsConnectionWhere + "Return Blogs where none of the related BlogPostsConnections match this filter" + postsConnection_NONE: BlogPostsConnectionWhere + "Return Blogs where one of the related BlogPostsConnections match this filter" + postsConnection_SINGLE: BlogPostsConnectionWhere + "Return Blogs where some of the related BlogPostsConnections match this filter" + postsConnection_SOME: BlogPostsConnectionWhere + "Return Blogs where all of the related Posts match this filter" + posts_ALL: PostWhere + "Return Blogs where none of the related Posts match this filter" + posts_NONE: PostWhere + "Return Blogs where one of the related Posts match this filter" + posts_SINGLE: PostWhere + "Return Blogs where some of the related Posts match this filter" + posts_SOME: PostWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input ContentWhere { + Blog: BlogWhere + Post: PostWhere +} + +input PostOptions { + limit: Int + offset: Int + "Specify one or more PostSort objects to sort Posts by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PostSort!] +} + +"Fields to sort Posts by. The order in which sorts are applied is not guaranteed when specifying many fields in one PostSort object." +input PostSort { + content: SortDirection @deprecated(reason : "Do not use post.content") +} + +input PostWhere { + AND: [PostWhere!] + NOT: PostWhere + OR: [PostWhere!] + content: String @deprecated(reason : "Do not use post.content") + content_CONTAINS: String @deprecated(reason : "Do not use post.content") + content_ENDS_WITH: String @deprecated(reason : "Do not use post.content") + content_IN: [String] @deprecated(reason : "Do not use post.content") + content_STARTS_WITH: String @deprecated(reason : "Do not use post.content") +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +input UserContentBlogConnectionWhere { + AND: [UserContentBlogConnectionWhere!] + NOT: UserContentBlogConnectionWhere + OR: [UserContentBlogConnectionWhere!] + node: BlogWhere +} + +input UserContentConnectionWhere { + Blog: UserContentBlogConnectionWhere + Post: UserContentPostConnectionWhere +} + +input UserContentPostConnectionWhere { + AND: [UserContentPostConnectionWhere!] + NOT: UserContentPostConnectionWhere + OR: [UserContentPostConnectionWhere!] + node: PostWhere +} + +input UserOptions { + limit: Int + offset: Int + "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserSort!] +} + +"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." +input UserSort { + name: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + "Return Users where all of the related UserContentConnections match this filter" + contentConnection_ALL: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") + "Return Users where none of the related UserContentConnections match this filter" + contentConnection_NONE: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") + "Return Users where one of the related UserContentConnections match this filter" + contentConnection_SINGLE: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") + "Return Users where some of the related UserContentConnections match this filter" + contentConnection_SOME: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") + "Return Users where all of the related Contents match this filter" + content_ALL: ContentWhere @deprecated(reason : "Do not use user.content") + "Return Users where none of the related Contents match this filter" + content_NONE: ContentWhere @deprecated(reason : "Do not use user.content") + "Return Users where one of the related Contents match this filter" + content_SINGLE: ContentWhere @deprecated(reason : "Do not use user.content") + "Return Users where some of the related Contents match this filter" + content_SOME: ContentWhere @deprecated(reason : "Do not use user.content") + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/custom-directives-preserved.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/custom-directives-preserved.adoc deleted file mode 100644 index f0361be4..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/custom-directives-preserved.adoc +++ /dev/null @@ -1,92 +0,0 @@ -:toc: - -= Directive-preserve -> Custom directives preserved - -== Source schema - -[source,graphql,schema=true] ----- -directive @preservedTopLevel(string: String, int: Int, float: Float, boolean: Boolean) on OBJECT - -directive @preservedFieldLevel(string: String, int: Int, float: Float, boolean: Boolean) on FIELD_DEFINITION - -type Movie @preservedTopLevel { - id: ID @preservedFieldLevel(string: "str", int: 12, float: 1.2, boolean: true) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -directive @preservedFieldLevel(boolean: Boolean, float: Float, int: Int, string: String) on FIELD_DEFINITION - -directive @preservedTopLevel(boolean: Boolean, float: Float, int: Int, string: String) on OBJECT - -type Movie @preservedTopLevel { - id: ID @preservedFieldLevel(boolean : true, float : 1.2, int : 12, string : "str") -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-base-interface-preserved.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-base-interface-preserved.adoc deleted file mode 100644 index a2603428..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-base-interface-preserved.adoc +++ /dev/null @@ -1,403 +0,0 @@ -:toc: - -= Directive-preserve -> Directives on base interface preserved - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! - actors: [Actor!]! @deprecated(reason: "Do not use") -} - -type Movie implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") - runtime: Int! -} - -type Series implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") - episodes: Int! -} - -type ActedIn @relationshipProperties { - role: String! -} - -type Actor { - name: String! - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - actors: [Actor!]! @deprecated(reason : "Do not use") - title: String! -} - -""" -The edge properties for the following fields: -* Movie.actors -* Series.actors -* Actor.actedIn -""" -type ActedIn { - role: String! -} - -type Actor { - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - runtime: Int! - title: String! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [SeriesActorsConnectionSort!], where: SeriesActorsConnectionWhere): SeriesActorsConnection! - episodes: Int! - title: String! -} - -type SeriesActorsConnection { - edges: [SeriesActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - role: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - role: String - role_CONTAINS: String - role_ENDS_WITH: String - role_IN: [String!] - role_STARTS_WITH: String -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - edge: ActedInSort - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesActorsConnectionSort { - edge: ActedInSort - node: ActorSort -} - -input SeriesActorsConnectionWhere { - AND: [SeriesActorsConnectionWhere!] - NOT: SeriesActorsConnectionWhere - OR: [SeriesActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - "Return Series where all of the related SeriesActorsConnections match this filter" - actorsConnection_ALL: SeriesActorsConnectionWhere - "Return Series where none of the related SeriesActorsConnections match this filter" - actorsConnection_NONE: SeriesActorsConnectionWhere - "Return Series where one of the related SeriesActorsConnections match this filter" - actorsConnection_SINGLE: SeriesActorsConnectionWhere - "Return Series where some of the related SeriesActorsConnections match this filter" - actorsConnection_SOME: SeriesActorsConnectionWhere - "Return Series where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Series where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Series where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Series where some of the related Actors match this filter" - actors_SOME: ActorWhere - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-implemented-interface-relations-preserved-field-not-declared-relationship.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-implemented-interface-relations-preserved-field-not-declared-relationship.adoc deleted file mode 100644 index bf83dc05..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-implemented-interface-relations-preserved-field-not-declared-relationship.adoc +++ /dev/null @@ -1,403 +0,0 @@ -:toc: - -= Directive-preserve -> Directives on implemented interface relations preserved - field not declared relationship - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! - actors: [Actor!]! -} - -type Movie implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") @deprecated(reason: "Do not use") - runtime: Int! -} - -type Series implements Production { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") - episodes: Int! -} - -type ActedIn @relationshipProperties { - role: String! -} - -type Actor { - name: String! - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - actors: [Actor!]! - title: String! -} - -""" -The edge properties for the following fields: -* Movie.actors -* Series.actors -* Actor.actedIn -""" -type ActedIn { - role: String! -} - -type Actor { - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! @deprecated(reason : "Do not use") - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! @deprecated(reason : "Do not use") - runtime: Int! - title: String! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [SeriesActorsConnectionSort!], where: SeriesActorsConnectionWhere): SeriesActorsConnection! - episodes: Int! - title: String! -} - -type SeriesActorsConnection { - edges: [SeriesActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - role: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - role: String - role_CONTAINS: String - role_ENDS_WITH: String - role_IN: [String!] - role_STARTS_WITH: String -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - edge: ActedInSort - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere @deprecated(reason : "Do not use") - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere @deprecated(reason : "Do not use") - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere @deprecated(reason : "Do not use") - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere @deprecated(reason : "Do not use") - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesActorsConnectionSort { - edge: ActedInSort - node: ActorSort -} - -input SeriesActorsConnectionWhere { - AND: [SeriesActorsConnectionWhere!] - NOT: SeriesActorsConnectionWhere - OR: [SeriesActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - "Return Series where all of the related SeriesActorsConnections match this filter" - actorsConnection_ALL: SeriesActorsConnectionWhere - "Return Series where none of the related SeriesActorsConnections match this filter" - actorsConnection_NONE: SeriesActorsConnectionWhere - "Return Series where one of the related SeriesActorsConnections match this filter" - actorsConnection_SINGLE: SeriesActorsConnectionWhere - "Return Series where some of the related SeriesActorsConnections match this filter" - actorsConnection_SOME: SeriesActorsConnectionWhere - "Return Series where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Series where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Series where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Series where some of the related Actors match this filter" - actors_SOME: ActorWhere - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-relations-preserved.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-relations-preserved.adoc deleted file mode 100644 index 453fcb83..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-relations-preserved.adoc +++ /dev/null @@ -1,228 +0,0 @@ -:toc: - -= Directive-preserve -> Directives on relations preserved - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - title: String - year: Int - imdbRating: Float - genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT) @deprecated(reason: "Do not use") -} - -type Genre { - name: String - movies: [Movie!]! @relationship(type: "IN_GENRE", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Genre { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [GenreMoviesConnectionSort!], where: GenreMoviesConnectionWhere): GenreMoviesConnection! - name: String -} - -type GenreEdge { - cursor: String! - node: Genre! -} - -type GenreMoviesConnection { - edges: [GenreMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type GenreMoviesRelationship { - cursor: String! - node: Movie! -} - -type GenresConnection { - edges: [GenreEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - genres(directed: Boolean = true, options: GenreOptions, where: GenreWhere): [Genre!]! @deprecated(reason : "Do not use") - genresConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieGenresConnectionSort!], where: MovieGenresConnectionWhere): MovieGenresConnection! @deprecated(reason : "Do not use") - imdbRating: Float - title: String - year: Int -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieGenresConnection { - edges: [MovieGenresRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieGenresRelationship { - cursor: String! - node: Genre! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - genres(options: GenreOptions, where: GenreWhere): [Genre!]! - genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input GenreMoviesConnectionSort { - node: MovieSort -} - -input GenreMoviesConnectionWhere { - AND: [GenreMoviesConnectionWhere!] - NOT: GenreMoviesConnectionWhere - OR: [GenreMoviesConnectionWhere!] - node: MovieWhere -} - -input GenreOptions { - limit: Int - offset: Int - "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." - sort: [GenreSort!] -} - -"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." -input GenreSort { - name: SortDirection -} - -input GenreWhere { - AND: [GenreWhere!] - NOT: GenreWhere - OR: [GenreWhere!] - "Return Genres where all of the related GenreMoviesConnections match this filter" - moviesConnection_ALL: GenreMoviesConnectionWhere - "Return Genres where none of the related GenreMoviesConnections match this filter" - moviesConnection_NONE: GenreMoviesConnectionWhere - "Return Genres where one of the related GenreMoviesConnections match this filter" - moviesConnection_SINGLE: GenreMoviesConnectionWhere - "Return Genres where some of the related GenreMoviesConnections match this filter" - moviesConnection_SOME: GenreMoviesConnectionWhere - "Return Genres where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Genres where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Genres where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Genres where some of the related Movies match this filter" - movies_SOME: MovieWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input MovieGenresConnectionSort { - node: GenreSort -} - -input MovieGenresConnectionWhere { - AND: [MovieGenresConnectionWhere!] - NOT: MovieGenresConnectionWhere - OR: [MovieGenresConnectionWhere!] - node: GenreWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - imdbRating: SortDirection - title: SortDirection - year: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieGenresConnections match this filter" - genresConnection_ALL: MovieGenresConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where none of the related MovieGenresConnections match this filter" - genresConnection_NONE: MovieGenresConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where one of the related MovieGenresConnections match this filter" - genresConnection_SINGLE: MovieGenresConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where some of the related MovieGenresConnections match this filter" - genresConnection_SOME: MovieGenresConnectionWhere @deprecated(reason : "Do not use") - "Return Movies where all of the related Genres match this filter" - genres_ALL: GenreWhere @deprecated(reason : "Do not use") - "Return Movies where none of the related Genres match this filter" - genres_NONE: GenreWhere @deprecated(reason : "Do not use") - "Return Movies where one of the related Genres match this filter" - genres_SINGLE: GenreWhere @deprecated(reason : "Do not use") - "Return Movies where some of the related Genres match this filter" - genres_SOME: GenreWhere @deprecated(reason : "Do not use") - imdbRating: Float - imdbRating_GT: Float - imdbRating_GTE: Float - imdbRating_IN: [Float] - imdbRating_LT: Float - imdbRating_LTE: Float - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String - year: Int - year_GT: Int - year_GTE: Int - year_IN: [Int] - year_LT: Int - year_LTE: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-unions-preserved.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-unions-preserved.adoc deleted file mode 100644 index f2c3920c..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directive-preserve/directives-on-unions-preserved.adoc +++ /dev/null @@ -1,278 +0,0 @@ -:toc: - -= Directive-preserve -> Directives on unions preserved - -== Source schema - -[source,graphql,schema=true] ----- -union Content = Blog | Post - -type Blog { - title: String - posts: [Post!]! @relationship(type: "HAS_POST", direction: OUT) -} - -type Post { - content: String @deprecated(reason: "Do not use post.content") -} - -type User { - name: String - content: [Content!]! @relationship(type: "HAS_CONTENT", direction: OUT) @deprecated(reason: "Do not use user.content") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Content = Blog | Post - -type Blog { - posts(directed: Boolean = true, options: PostOptions, where: PostWhere): [Post!]! - postsConnection(after: String, directed: Boolean = true, first: Int, sort: [BlogPostsConnectionSort!], where: BlogPostsConnectionWhere): BlogPostsConnection! - title: String -} - -type BlogEdge { - cursor: String! - node: Blog! -} - -type BlogPostsConnection { - edges: [BlogPostsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type BlogPostsRelationship { - cursor: String! - node: Post! -} - -type BlogsConnection { - edges: [BlogEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Post { - content: String @deprecated(reason : "Do not use post.content") -} - -type PostEdge { - cursor: String! - node: Post! -} - -type PostsConnection { - edges: [PostEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - blogs(options: BlogOptions, where: BlogWhere): [Blog!]! - blogsConnection(after: String, first: Int, sort: [BlogSort], where: BlogWhere): BlogsConnection! - contents(options: QueryOptions, where: ContentWhere): [Content!]! - posts(options: PostOptions, where: PostWhere): [Post!]! - postsConnection(after: String, first: Int, sort: [PostSort], where: PostWhere): PostsConnection! - users(options: UserOptions, where: UserWhere): [User!]! - usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! -} - -type User { - content(directed: Boolean = true, options: QueryOptions, where: ContentWhere): [Content!]! @deprecated(reason : "Do not use user.content") - contentConnection(after: String, directed: Boolean = true, first: Int, where: UserContentConnectionWhere): UserContentConnection! @deprecated(reason : "Do not use user.content") - name: String -} - -type UserContentConnection { - edges: [UserContentRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type UserContentRelationship { - cursor: String! - node: Content! -} - -type UserEdge { - cursor: String! - node: User! -} - -type UsersConnection { - edges: [UserEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input BlogOptions { - limit: Int - offset: Int - "Specify one or more BlogSort objects to sort Blogs by. The sorts will be applied in the order in which they are arranged in the array." - sort: [BlogSort!] -} - -input BlogPostsConnectionSort { - node: PostSort -} - -input BlogPostsConnectionWhere { - AND: [BlogPostsConnectionWhere!] - NOT: BlogPostsConnectionWhere - OR: [BlogPostsConnectionWhere!] - node: PostWhere -} - -"Fields to sort Blogs by. The order in which sorts are applied is not guaranteed when specifying many fields in one BlogSort object." -input BlogSort { - title: SortDirection -} - -input BlogWhere { - AND: [BlogWhere!] - NOT: BlogWhere - OR: [BlogWhere!] - "Return Blogs where all of the related BlogPostsConnections match this filter" - postsConnection_ALL: BlogPostsConnectionWhere - "Return Blogs where none of the related BlogPostsConnections match this filter" - postsConnection_NONE: BlogPostsConnectionWhere - "Return Blogs where one of the related BlogPostsConnections match this filter" - postsConnection_SINGLE: BlogPostsConnectionWhere - "Return Blogs where some of the related BlogPostsConnections match this filter" - postsConnection_SOME: BlogPostsConnectionWhere - "Return Blogs where all of the related Posts match this filter" - posts_ALL: PostWhere - "Return Blogs where none of the related Posts match this filter" - posts_NONE: PostWhere - "Return Blogs where one of the related Posts match this filter" - posts_SINGLE: PostWhere - "Return Blogs where some of the related Posts match this filter" - posts_SOME: PostWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input ContentWhere { - Blog: BlogWhere - Post: PostWhere -} - -input PostOptions { - limit: Int - offset: Int - "Specify one or more PostSort objects to sort Posts by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PostSort!] -} - -"Fields to sort Posts by. The order in which sorts are applied is not guaranteed when specifying many fields in one PostSort object." -input PostSort { - content: SortDirection @deprecated(reason : "Do not use post.content") -} - -input PostWhere { - AND: [PostWhere!] - NOT: PostWhere - OR: [PostWhere!] - content: String @deprecated(reason : "Do not use post.content") - content_CONTAINS: String @deprecated(reason : "Do not use post.content") - content_ENDS_WITH: String @deprecated(reason : "Do not use post.content") - content_IN: [String] @deprecated(reason : "Do not use post.content") - content_STARTS_WITH: String @deprecated(reason : "Do not use post.content") -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - -input UserContentBlogConnectionWhere { - AND: [UserContentBlogConnectionWhere!] - NOT: UserContentBlogConnectionWhere - OR: [UserContentBlogConnectionWhere!] - node: BlogWhere -} - -input UserContentConnectionWhere { - Blog: UserContentBlogConnectionWhere - Post: UserContentPostConnectionWhere -} - -input UserContentPostConnectionWhere { - AND: [UserContentPostConnectionWhere!] - NOT: UserContentPostConnectionWhere - OR: [UserContentPostConnectionWhere!] - node: PostWhere -} - -input UserOptions { - limit: Int - offset: Int - "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserSort!] -} - -"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." -input UserSort { - name: SortDirection -} - -input UserWhere { - AND: [UserWhere!] - NOT: UserWhere - OR: [UserWhere!] - "Return Users where all of the related UserContentConnections match this filter" - contentConnection_ALL: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") - "Return Users where none of the related UserContentConnections match this filter" - contentConnection_NONE: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") - "Return Users where one of the related UserContentConnections match this filter" - contentConnection_SINGLE: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") - "Return Users where some of the related UserContentConnections match this filter" - contentConnection_SOME: UserContentConnectionWhere @deprecated(reason : "Do not use user.content") - "Return Users where all of the related Contents match this filter" - content_ALL: ContentWhere @deprecated(reason : "Do not use user.content") - "Return Users where none of the related Contents match this filter" - content_NONE: ContentWhere @deprecated(reason : "Do not use user.content") - "Return Users where one of the related Contents match this filter" - content_SINGLE: ContentWhere @deprecated(reason : "Do not use user.content") - "Return Users where some of the related Contents match this filter" - content_SOME: ContentWhere @deprecated(reason : "Do not use user.content") - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/customResolver.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/customResolver.adoc index fafe8248..0a01c85d 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/customResolver.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/customResolver.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= @customResolver directive -> passes fields directly through with no generation += @customResolver directive -== Source schema +== passes fields directly through with no generation +.Schema [source,graphql,schema=true] ---- interface UserInterface { @@ -19,8 +21,6 @@ type User implements UserInterface { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -151,3 +151,4 @@ input UserWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/default.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/default.adoc index 56176826..1b58d09d 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/default.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/default.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= @default directive -> sets default values in schema += @default directive -== Source schema +== sets default values in schema +.Schema [source,graphql,schema=true] ---- interface UserInterface { @@ -30,8 +32,6 @@ enum Location { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -214,3 +214,4 @@ input UserWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable.adoc new file mode 100644 index 00000000..7349858d --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable.adoc @@ -0,0 +1,2094 @@ +:toc: +:toclevels: 42 + += @filterable directive + +== on INTERFACE RELATIONSHIP FIELD, (aggregation are not generated for abstract types) + +=== disable value filters + +.Schema +[source,graphql,schema=true] +---- +type Actor implements Person { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +interface Person { + username: String! +} + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: false) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + username: String! +} + +type Actor implements Person { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +enum PersonImplementation { + Actor +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + username: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + typename_IN: [PersonImplementation!] + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +---- + +''' + +== snapshot tests + +=== on SCALAR + +==== default arguments should disable aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Movie { + title: String @filterable + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +=== on RELATIONSHIP FIELD + +==== default arguments should disable aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Movie { + title: String + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) @filterable +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +==== enable only value filters + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Movie { + title: String + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +=== on INTERFACE RELATIONSHIP FIELD, (aggregation does not exists on abstract types) + +==== default arguments should disable aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor implements Person { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +interface Person { + username: String! +} + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + username: String! +} + +type Actor implements Person { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +enum PersonImplementation { + Actor +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + username: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + typename_IN: [PersonImplementation!] + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +---- + +''' + +==== enable only value filters + +.Schema +[source,graphql,schema=true] +---- +type Actor implements Person { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +interface Person { + username: String! +} + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + username: String! +} + +type Actor implements Person { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +enum PersonImplementation { + Actor +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + username: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + typename_IN: [PersonImplementation!] + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +---- + +''' + +=== on UNION RELATIONSHIP FIELD, (aggregation does not exists on abstract types) + +==== default arguments should disable aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Appearance { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +union Person = Actor | Appearance + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = Actor | Appearance + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Appearance { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [AppearanceMoviesConnectionSort!], where: AppearanceMoviesConnectionWhere): AppearanceMoviesConnection! + password: String! + username: String! +} + +type AppearanceEdge { + cursor: String! + node: Appearance! +} + +type AppearanceMoviesConnection { + edges: [AppearanceMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type AppearanceMoviesRelationship { + cursor: String! + node: Movie! +} + +type AppearancesConnection { + edges: [AppearanceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + appearances(options: AppearanceOptions, where: AppearanceWhere): [Appearance!]! + appearancesConnection(after: String, first: Int, sort: [AppearanceSort], where: AppearanceWhere): AppearancesConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input AppearanceMoviesConnectionSort { + node: MovieSort +} + +input AppearanceMoviesConnectionWhere { + AND: [AppearanceMoviesConnectionWhere!] + NOT: AppearanceMoviesConnectionWhere + OR: [AppearanceMoviesConnectionWhere!] + node: MovieWhere +} + +input AppearanceOptions { + limit: Int + offset: Int + "Specify one or more AppearanceSort objects to sort Appearances by. The sorts will be applied in the order in which they are arranged in the array." + sort: [AppearanceSort!] +} + +"Fields to sort Appearances by. The order in which sorts are applied is not guaranteed when specifying many fields in one AppearanceSort object." +input AppearanceSort { + password: SortDirection + username: SortDirection +} + +input AppearanceWhere { + AND: [AppearanceWhere!] + NOT: AppearanceWhere + OR: [AppearanceWhere!] + "Return Appearances where all of the related AppearanceMoviesConnections match this filter" + moviesConnection_ALL: AppearanceMoviesConnectionWhere + "Return Appearances where none of the related AppearanceMoviesConnections match this filter" + moviesConnection_NONE: AppearanceMoviesConnectionWhere + "Return Appearances where one of the related AppearanceMoviesConnections match this filter" + moviesConnection_SINGLE: AppearanceMoviesConnectionWhere + "Return Appearances where some of the related AppearanceMoviesConnections match this filter" + moviesConnection_SOME: AppearanceMoviesConnectionWhere + "Return Appearances where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Appearances where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Appearances where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Appearances where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsActorConnectionWhere { + AND: [MovieActorsActorConnectionWhere!] + NOT: MovieActorsActorConnectionWhere + OR: [MovieActorsActorConnectionWhere!] + node: ActorWhere +} + +input MovieActorsAppearanceConnectionWhere { + AND: [MovieActorsAppearanceConnectionWhere!] + NOT: MovieActorsAppearanceConnectionWhere + OR: [MovieActorsAppearanceConnectionWhere!] + node: AppearanceWhere +} + +input MovieActorsConnectionWhere { + Actor: MovieActorsActorConnectionWhere + Appearance: MovieActorsAppearanceConnectionWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonWhere { + Actor: ActorWhere + Appearance: AppearanceWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +==== enable only value filters + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Appearance { + username: String! + password: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +union Person = Actor | Appearance + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = Actor | Appearance + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Appearance { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [AppearanceMoviesConnectionSort!], where: AppearanceMoviesConnectionWhere): AppearanceMoviesConnection! + password: String! + username: String! +} + +type AppearanceEdge { + cursor: String! + node: Appearance! +} + +type AppearanceMoviesConnection { + edges: [AppearanceMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type AppearanceMoviesRelationship { + cursor: String! + node: Movie! +} + +type AppearancesConnection { + edges: [AppearanceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + appearances(options: AppearanceOptions, where: AppearanceWhere): [Appearance!]! + appearancesConnection(after: String, first: Int, sort: [AppearanceSort], where: AppearanceWhere): AppearancesConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input AppearanceMoviesConnectionSort { + node: MovieSort +} + +input AppearanceMoviesConnectionWhere { + AND: [AppearanceMoviesConnectionWhere!] + NOT: AppearanceMoviesConnectionWhere + OR: [AppearanceMoviesConnectionWhere!] + node: MovieWhere +} + +input AppearanceOptions { + limit: Int + offset: Int + "Specify one or more AppearanceSort objects to sort Appearances by. The sorts will be applied in the order in which they are arranged in the array." + sort: [AppearanceSort!] +} + +"Fields to sort Appearances by. The order in which sorts are applied is not guaranteed when specifying many fields in one AppearanceSort object." +input AppearanceSort { + password: SortDirection + username: SortDirection +} + +input AppearanceWhere { + AND: [AppearanceWhere!] + NOT: AppearanceWhere + OR: [AppearanceWhere!] + "Return Appearances where all of the related AppearanceMoviesConnections match this filter" + moviesConnection_ALL: AppearanceMoviesConnectionWhere + "Return Appearances where none of the related AppearanceMoviesConnections match this filter" + moviesConnection_NONE: AppearanceMoviesConnectionWhere + "Return Appearances where one of the related AppearanceMoviesConnections match this filter" + moviesConnection_SINGLE: AppearanceMoviesConnectionWhere + "Return Appearances where some of the related AppearanceMoviesConnections match this filter" + moviesConnection_SOME: AppearanceMoviesConnectionWhere + "Return Appearances where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Appearances where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Appearances where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Appearances where some of the related Movies match this filter" + movies_SOME: MovieWhere + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsActorConnectionWhere { + AND: [MovieActorsActorConnectionWhere!] + NOT: MovieActorsActorConnectionWhere + OR: [MovieActorsActorConnectionWhere!] + node: ActorWhere +} + +input MovieActorsAppearanceConnectionWhere { + AND: [MovieActorsAppearanceConnectionWhere!] + NOT: MovieActorsAppearanceConnectionWhere + OR: [MovieActorsAppearanceConnectionWhere!] + node: AppearanceWhere +} + +input MovieActorsConnectionWhere { + Actor: MovieActorsActorConnectionWhere + Appearance: MovieActorsAppearanceConnectionWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonWhere { + Actor: ActorWhere + Appearance: AppearanceWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/on-interface-relationship-field-aggregation-are-not-generated-for-abstract-types-/disable-value-filters.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/on-interface-relationship-field-aggregation-are-not-generated-for-abstract-types-/disable-value-filters.adoc deleted file mode 100644 index 6408ed4f..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/on-interface-relationship-field-aggregation-are-not-generated-for-abstract-types-/disable-value-filters.adoc +++ /dev/null @@ -1,251 +0,0 @@ -:toc: - -= @filterable directive -> on INTERFACE RELATIONSHIP FIELD, (aggregation are not generated for abstract types) -> disable value filters - -== Source schema - -[source,graphql,schema=true] ----- -type Actor implements Person { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -interface Person { - username: String! -} - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: false) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - username: String! -} - -type Actor implements Person { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -enum PersonImplementation { - Actor -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - username: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - typename_IN: [PersonImplementation!] - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc deleted file mode 100644 index 1f07f9eb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on INTERFACE RELATIONSHIP FIELD, (aggregation does not exists on abstract types) -> default arguments should disable aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor implements Person { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -interface Person { - username: String! -} - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - username: String! -} - -type Actor implements Person { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -enum PersonImplementation { - Actor -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - username: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - typename_IN: [PersonImplementation!] - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc deleted file mode 100644 index b75e7fde..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-interface-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on INTERFACE RELATIONSHIP FIELD, (aggregation does not exists on abstract types) -> enable only value filters - -== Source schema - -[source,graphql,schema=true] ----- -type Actor implements Person { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -interface Person { - username: String! -} - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - username: String! -} - -type Actor implements Person { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -enum PersonImplementation { - Actor -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - username: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - typename_IN: [PersonImplementation!] - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-relationship-field/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-relationship-field/default-arguments-should-disable-aggregation.adoc deleted file mode 100644 index 234567fd..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-relationship-field/default-arguments-should-disable-aggregation.adoc +++ /dev/null @@ -1,218 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on RELATIONSHIP FIELD -> default arguments should disable aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Movie { - title: String - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) @filterable -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-relationship-field/enable-only-value-filters.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-relationship-field/enable-only-value-filters.adoc deleted file mode 100644 index 35171cc7..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-relationship-field/enable-only-value-filters.adoc +++ /dev/null @@ -1,218 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on RELATIONSHIP FIELD -> enable only value filters - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Movie { - title: String - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-scalar/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-scalar/default-arguments-should-disable-aggregation.adoc deleted file mode 100644 index 856fe832..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-scalar/default-arguments-should-disable-aggregation.adoc +++ /dev/null @@ -1,218 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on SCALAR -> default arguments should disable aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Movie { - title: String @filterable - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc deleted file mode 100644 index fdb1bfce..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/default-arguments-should-disable-aggregation.adoc +++ /dev/null @@ -1,335 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on UNION RELATIONSHIP FIELD, (aggregation does not exists on abstract types) -> default arguments should disable aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Appearance { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -union Person = Actor | Appearance - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = Actor | Appearance - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Appearance { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [AppearanceMoviesConnectionSort!], where: AppearanceMoviesConnectionWhere): AppearanceMoviesConnection! - password: String! - username: String! -} - -type AppearanceEdge { - cursor: String! - node: Appearance! -} - -type AppearanceMoviesConnection { - edges: [AppearanceMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type AppearanceMoviesRelationship { - cursor: String! - node: Movie! -} - -type AppearancesConnection { - edges: [AppearanceEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - appearances(options: AppearanceOptions, where: AppearanceWhere): [Appearance!]! - appearancesConnection(after: String, first: Int, sort: [AppearanceSort], where: AppearanceWhere): AppearancesConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input AppearanceMoviesConnectionSort { - node: MovieSort -} - -input AppearanceMoviesConnectionWhere { - AND: [AppearanceMoviesConnectionWhere!] - NOT: AppearanceMoviesConnectionWhere - OR: [AppearanceMoviesConnectionWhere!] - node: MovieWhere -} - -input AppearanceOptions { - limit: Int - offset: Int - "Specify one or more AppearanceSort objects to sort Appearances by. The sorts will be applied in the order in which they are arranged in the array." - sort: [AppearanceSort!] -} - -"Fields to sort Appearances by. The order in which sorts are applied is not guaranteed when specifying many fields in one AppearanceSort object." -input AppearanceSort { - password: SortDirection - username: SortDirection -} - -input AppearanceWhere { - AND: [AppearanceWhere!] - NOT: AppearanceWhere - OR: [AppearanceWhere!] - "Return Appearances where all of the related AppearanceMoviesConnections match this filter" - moviesConnection_ALL: AppearanceMoviesConnectionWhere - "Return Appearances where none of the related AppearanceMoviesConnections match this filter" - moviesConnection_NONE: AppearanceMoviesConnectionWhere - "Return Appearances where one of the related AppearanceMoviesConnections match this filter" - moviesConnection_SINGLE: AppearanceMoviesConnectionWhere - "Return Appearances where some of the related AppearanceMoviesConnections match this filter" - moviesConnection_SOME: AppearanceMoviesConnectionWhere - "Return Appearances where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Appearances where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Appearances where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Appearances where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsActorConnectionWhere { - AND: [MovieActorsActorConnectionWhere!] - NOT: MovieActorsActorConnectionWhere - OR: [MovieActorsActorConnectionWhere!] - node: ActorWhere -} - -input MovieActorsAppearanceConnectionWhere { - AND: [MovieActorsAppearanceConnectionWhere!] - NOT: MovieActorsAppearanceConnectionWhere - OR: [MovieActorsAppearanceConnectionWhere!] - node: AppearanceWhere -} - -input MovieActorsConnectionWhere { - Actor: MovieActorsActorConnectionWhere - Appearance: MovieActorsAppearanceConnectionWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonWhere { - Actor: ActorWhere - Appearance: AppearanceWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc deleted file mode 100644 index 0891c828..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/filterable/snapshot-tests/on-union-relationship-field-aggregation-does-not-exists-on-abstract-types-/enable-only-value-filters.adoc +++ /dev/null @@ -1,335 +0,0 @@ -:toc: - -= @filterable directive -> snapshot tests -> on UNION RELATIONSHIP FIELD, (aggregation does not exists on abstract types) -> enable only value filters - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Appearance { - username: String! - password: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -union Person = Actor | Appearance - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) @filterable(byValue: true) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = Actor | Appearance - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Appearance { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [AppearanceMoviesConnectionSort!], where: AppearanceMoviesConnectionWhere): AppearanceMoviesConnection! - password: String! - username: String! -} - -type AppearanceEdge { - cursor: String! - node: Appearance! -} - -type AppearanceMoviesConnection { - edges: [AppearanceMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type AppearanceMoviesRelationship { - cursor: String! - node: Movie! -} - -type AppearancesConnection { - edges: [AppearanceEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - appearances(options: AppearanceOptions, where: AppearanceWhere): [Appearance!]! - appearancesConnection(after: String, first: Int, sort: [AppearanceSort], where: AppearanceWhere): AppearancesConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input AppearanceMoviesConnectionSort { - node: MovieSort -} - -input AppearanceMoviesConnectionWhere { - AND: [AppearanceMoviesConnectionWhere!] - NOT: AppearanceMoviesConnectionWhere - OR: [AppearanceMoviesConnectionWhere!] - node: MovieWhere -} - -input AppearanceOptions { - limit: Int - offset: Int - "Specify one or more AppearanceSort objects to sort Appearances by. The sorts will be applied in the order in which they are arranged in the array." - sort: [AppearanceSort!] -} - -"Fields to sort Appearances by. The order in which sorts are applied is not guaranteed when specifying many fields in one AppearanceSort object." -input AppearanceSort { - password: SortDirection - username: SortDirection -} - -input AppearanceWhere { - AND: [AppearanceWhere!] - NOT: AppearanceWhere - OR: [AppearanceWhere!] - "Return Appearances where all of the related AppearanceMoviesConnections match this filter" - moviesConnection_ALL: AppearanceMoviesConnectionWhere - "Return Appearances where none of the related AppearanceMoviesConnections match this filter" - moviesConnection_NONE: AppearanceMoviesConnectionWhere - "Return Appearances where one of the related AppearanceMoviesConnections match this filter" - moviesConnection_SINGLE: AppearanceMoviesConnectionWhere - "Return Appearances where some of the related AppearanceMoviesConnections match this filter" - moviesConnection_SOME: AppearanceMoviesConnectionWhere - "Return Appearances where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Appearances where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Appearances where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Appearances where some of the related Movies match this filter" - movies_SOME: MovieWhere - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsActorConnectionWhere { - AND: [MovieActorsActorConnectionWhere!] - NOT: MovieActorsActorConnectionWhere - OR: [MovieActorsActorConnectionWhere!] - node: ActorWhere -} - -input MovieActorsAppearanceConnectionWhere { - AND: [MovieActorsAppearanceConnectionWhere!] - NOT: MovieActorsAppearanceConnectionWhere - OR: [MovieActorsAppearanceConnectionWhere!] - node: AppearanceWhere -} - -input MovieActorsConnectionWhere { - Actor: MovieActorsActorConnectionWhere - Appearance: MovieActorsAppearanceConnectionWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonWhere { - Actor: ActorWhere - Appearance: AppearanceWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private/private-is-not-inherited.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private.adoc similarity index 50% rename from core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private/private-is-not-inherited.adoc rename to core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private.adoc index cb13b34f..2e8d0541 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private/private-is-not-inherited.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= @private directive -> private is not inherited += @private directive -== Source schema +== private is not inherited +.Schema [source,graphql,schema=true] ---- interface UserInterface { @@ -18,8 +20,6 @@ type User implements UserInterface { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -141,3 +141,136 @@ input UserWhere { ---- ''' + +== does not add fields to schema + +.Schema +[source,graphql,schema=true] +---- +interface UserInterface { + id: ID + private: String @private +} + +type User implements UserInterface { + id: ID + password: String @private + private: String @private +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface UserInterface { + id: ID +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + userInterfaces(options: UserInterfaceOptions, where: UserInterfaceWhere): [UserInterface!]! + userInterfacesConnection(after: String, first: Int, sort: [UserInterfaceSort], where: UserInterfaceWhere): UserInterfacesConnection! + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +type User implements UserInterface { + id: ID +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserInterfaceEdge { + cursor: String! + node: UserInterface! +} + +type UserInterfacesConnection { + edges: [UserInterfaceEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +enum UserInterfaceImplementation { + User +} + +input UserInterfaceOptions { + limit: Int + offset: Int + "Specify one or more UserInterfaceSort objects to sort UserInterfaces by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserInterfaceSort] +} + +"Fields to sort UserInterfaces by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserInterfaceSort object." +input UserInterfaceSort { + id: SortDirection +} + +input UserInterfaceWhere { + AND: [UserInterfaceWhere!] + NOT: UserInterfaceWhere + OR: [UserInterfaceWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + typename_IN: [UserInterfaceImplementation!] +} + +input UserOptions { + limit: Int + offset: Int + "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserSort!] +} + +"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." +input UserSort { + id: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private/does-not-add-fields-to-schema.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private/does-not-add-fields-to-schema.adoc deleted file mode 100644 index 97f711cc..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/private/does-not-add-fields-to-schema.adoc +++ /dev/null @@ -1,136 +0,0 @@ -:toc: - -= @private directive -> does not add fields to schema - -== Source schema - -[source,graphql,schema=true] ----- -interface UserInterface { - id: ID - private: String @private -} - -type User implements UserInterface { - id: ID - password: String @private - private: String @private -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface UserInterface { - id: ID -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - userInterfaces(options: UserInterfaceOptions, where: UserInterfaceWhere): [UserInterface!]! - userInterfacesConnection(after: String, first: Int, sort: [UserInterfaceSort], where: UserInterfaceWhere): UserInterfacesConnection! - users(options: UserOptions, where: UserWhere): [User!]! - usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! -} - -type User implements UserInterface { - id: ID -} - -type UserEdge { - cursor: String! - node: User! -} - -type UserInterfaceEdge { - cursor: String! - node: UserInterface! -} - -type UserInterfacesConnection { - edges: [UserInterfaceEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type UsersConnection { - edges: [UserEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -enum UserInterfaceImplementation { - User -} - -input UserInterfaceOptions { - limit: Int - offset: Int - "Specify one or more UserInterfaceSort objects to sort UserInterfaces by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserInterfaceSort] -} - -"Fields to sort UserInterfaces by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserInterfaceSort object." -input UserInterfaceSort { - id: SortDirection -} - -input UserInterfaceWhere { - AND: [UserInterfaceWhere!] - NOT: UserInterfaceWhere - OR: [UserInterfaceWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - typename_IN: [UserInterfaceImplementation!] -} - -input UserOptions { - limit: Int - offset: Int - "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserSort!] -} - -"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." -input UserSort { - id: SortDirection -} - -input UserWhere { - AND: [UserWhere!] - NOT: UserWhere - OR: [UserWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate.adoc new file mode 100644 index 00000000..69443bd0 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate.adoc @@ -0,0 +1,828 @@ +:toc: +:toclevels: 42 + += @relationship directive, aggregate argument + +== should disable nested aggregation + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! +} + +type Movie { + title: String + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +== snapshot tests + +=== aggregate argument set as false + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! +} + +type Movie { + title: String + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +=== on INTERFACE + +==== aggregate argument set as false, (no-op as abstract does not support aggregation) + +.Schema +[source,graphql,schema=true] +---- +type Actor implements Person { + username: String! + password: String! +} + +interface Person { + username: String! + password: String! +} + +type Movie { + title: String + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + password: String! + username: String! +} + +type Actor implements Person { + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +enum PersonImplementation { + Actor +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + password: SortDirection + username: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + typename_IN: [PersonImplementation!] + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +---- + +''' + +=== on UNION + +==== aggregate argument set as false, (no-op as abstract does not support aggregation) + +.Schema +[source,graphql,schema=true] +---- +type Actor { + username: String! + password: String! +} + +type Person { + name: String! +} + +union CastMember = Actor | Person + +type Movie { + title: String + actors: [CastMember!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union CastMember = Actor | Person + +type Actor { + password: String! + username: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: CastMemberWhere): [CastMember!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: CastMember! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + castMembers(options: QueryOptions, where: CastMemberWhere): [CastMember!]! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + password: SortDirection + username: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + password: String + password_CONTAINS: String + password_ENDS_WITH: String + password_IN: [String!] + password_STARTS_WITH: String + username: String + username_CONTAINS: String + username_ENDS_WITH: String + username_IN: [String!] + username_STARTS_WITH: String +} + +input CastMemberWhere { + Actor: ActorWhere + Person: PersonWhere +} + +input MovieActorsActorConnectionWhere { + AND: [MovieActorsActorConnectionWhere!] + NOT: MovieActorsActorConnectionWhere + OR: [MovieActorsActorConnectionWhere!] + node: ActorWhere +} + +input MovieActorsConnectionWhere { + Actor: MovieActorsActorConnectionWhere + Person: MovieActorsPersonConnectionWhere +} + +input MovieActorsPersonConnectionWhere { + AND: [MovieActorsPersonConnectionWhere!] + NOT: MovieActorsPersonConnectionWhere + OR: [MovieActorsPersonConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related CastMembers match this filter" + actors_ALL: CastMemberWhere + "Return Movies where none of the related CastMembers match this filter" + actors_NONE: CastMemberWhere + "Return Movies where one of the related CastMembers match this filter" + actors_SINGLE: CastMemberWhere + "Return Movies where some of the related CastMembers match this filter" + actors_SOME: CastMemberWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/should-disable-nested-aggregation.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/should-disable-nested-aggregation.adoc deleted file mode 100644 index 2eea4a3b..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/should-disable-nested-aggregation.adoc +++ /dev/null @@ -1,177 +0,0 @@ -:toc: - -= @relationship directive, aggregate argument -> should disable nested aggregation - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! -} - -type Movie { - title: String - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/snapshot-tests/on-interface/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/snapshot-tests/on-interface/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc deleted file mode 100644 index 55ff1be4..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/snapshot-tests/on-interface/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc +++ /dev/null @@ -1,234 +0,0 @@ -:toc: - -= @relationship directive, aggregate argument -> snapshot tests -> on INTERFACE -> aggregate argument set as false, (no-op as abstract does not support aggregation) - -== Source schema - -[source,graphql,schema=true] ----- -type Actor implements Person { - username: String! - password: String! -} - -interface Person { - username: String! - password: String! -} - -type Movie { - title: String - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - password: String! - username: String! -} - -type Actor implements Person { - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -enum PersonImplementation { - Actor -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - password: SortDirection - username: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - typename_IN: [PersonImplementation!] - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/snapshot-tests/on-union/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/snapshot-tests/on-union/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc deleted file mode 100644 index d3bd802a..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-aggregate/snapshot-tests/on-union/aggregate-argument-set-as-false-no-op-as-abstract-does-not-support-aggregation-.adoc +++ /dev/null @@ -1,245 +0,0 @@ -:toc: - -= @relationship directive, aggregate argument -> snapshot tests -> on UNION -> aggregate argument set as false, (no-op as abstract does not support aggregation) - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - username: String! - password: String! -} - -type Person { - name: String! -} - -union CastMember = Actor | Person - -type Movie { - title: String - actors: [CastMember!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union CastMember = Actor | Person - -type Actor { - password: String! - username: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: CastMemberWhere): [CastMember!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: CastMember! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - castMembers(options: QueryOptions, where: CastMemberWhere): [CastMember!]! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - password: SortDirection - username: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - password: String - password_CONTAINS: String - password_ENDS_WITH: String - password_IN: [String!] - password_STARTS_WITH: String - username: String - username_CONTAINS: String - username_ENDS_WITH: String - username_IN: [String!] - username_STARTS_WITH: String -} - -input CastMemberWhere { - Actor: ActorWhere - Person: PersonWhere -} - -input MovieActorsActorConnectionWhere { - AND: [MovieActorsActorConnectionWhere!] - NOT: MovieActorsActorConnectionWhere - OR: [MovieActorsActorConnectionWhere!] - node: ActorWhere -} - -input MovieActorsConnectionWhere { - Actor: MovieActorsActorConnectionWhere - Person: MovieActorsPersonConnectionWhere -} - -input MovieActorsPersonConnectionWhere { - AND: [MovieActorsPersonConnectionWhere!] - NOT: MovieActorsPersonConnectionWhere - OR: [MovieActorsPersonConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related CastMembers match this filter" - actors_ALL: CastMemberWhere - "Return Movies where none of the related CastMembers match this filter" - actors_NONE: CastMemberWhere - "Return Movies where one of the related CastMembers match this filter" - actors_SINGLE: CastMemberWhere - "Return Movies where some of the related CastMembers match this filter" - actors_SOME: CastMemberWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations.adoc new file mode 100644 index 00000000..5cdc0577 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations.adoc @@ -0,0 +1,5959 @@ +:toc: +:toclevels: 42 + += Relationship nested operations + +== Related to a concrete type + +=== Should not generate UpdateFieldInput input with no nested operations + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation CREATE specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation CONNECT specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation UPDATE specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation DELETE specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Single relationship with nested operation DISCONNECT specified + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Should not generate any nested operations if only CONNECT_OR_CREATE is specified and the related type does not have a unique field + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT_OR_CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Two relationships with nested operations specified on one + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionSort { + node: PersonSort +} + +input MovieProducersConnectionWhere { + AND: [MovieProducersConnectionWhere!] + NOT: MovieProducersConnectionWhere + OR: [MovieProducersConnectionWhere!] + node: PersonWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +=== Two relationships with nested operations specified on both + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionSort { + node: PersonSort +} + +input MovieProducersConnectionWhere { + AND: [MovieProducersConnectionWhere!] + NOT: MovieProducersConnectionWhere + OR: [MovieProducersConnectionWhere!] + node: PersonWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +---- + +''' + +== Related to a union type + +=== Should not generate UpdateFieldInput input with no nested operations + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation CREATE specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation CONNECT specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation UPDATE specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation DELETE specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Single relationship with nested operation DISCONNECT specified + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Should not generate any nested operations if only CONNECT_OR_CREATE is specified and the related type does not have a unique field + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT_OR_CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Two relationships with nested operations specified on one + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionWhere { + PersonOne: MovieProducersPersonOneConnectionWhere + PersonTwo: MovieProducersPersonTwoConnectionWhere +} + +input MovieProducersPersonOneConnectionWhere { + AND: [MovieProducersPersonOneConnectionWhere!] + NOT: MovieProducersPersonOneConnectionWhere + OR: [MovieProducersPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieProducersPersonTwoConnectionWhere { + AND: [MovieProducersPersonTwoConnectionWhere!] + NOT: MovieProducersPersonTwoConnectionWhere + OR: [MovieProducersPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +=== Two relationships with nested operations specified on both + +.Schema +[source,graphql,schema=true] +---- +type PersonOne { + name: String +} + +type PersonTwo { + nameTwo: String +} + +union Person = PersonOne | PersonTwo + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Person = PersonOne | PersonTwo + +type Movie { + actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PersonOne { + name: String +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo { + nameTwo: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: QueryOptions, where: PersonWhere): [Person!]! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionWhere { + PersonOne: MovieActorsPersonOneConnectionWhere + PersonTwo: MovieActorsPersonTwoConnectionWhere +} + +input MovieActorsPersonOneConnectionWhere { + AND: [MovieActorsPersonOneConnectionWhere!] + NOT: MovieActorsPersonOneConnectionWhere + OR: [MovieActorsPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieActorsPersonTwoConnectionWhere { + AND: [MovieActorsPersonTwoConnectionWhere!] + NOT: MovieActorsPersonTwoConnectionWhere + OR: [MovieActorsPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionWhere { + PersonOne: MovieProducersPersonOneConnectionWhere + PersonTwo: MovieProducersPersonTwoConnectionWhere +} + +input MovieProducersPersonOneConnectionWhere { + AND: [MovieProducersPersonOneConnectionWhere!] + NOT: MovieProducersPersonOneConnectionWhere + OR: [MovieProducersPersonOneConnectionWhere!] + node: PersonOneWhere +} + +input MovieProducersPersonTwoConnectionWhere { + AND: [MovieProducersPersonTwoConnectionWhere!] + NOT: MovieProducersPersonTwoConnectionWhere + OR: [MovieProducersPersonTwoConnectionWhere!] + node: PersonTwoWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + nameTwo: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + nameTwo: String + nameTwo_CONTAINS: String + nameTwo_ENDS_WITH: String + nameTwo_IN: [String] + nameTwo_STARTS_WITH: String +} + +input PersonWhere { + PersonOne: PersonOneWhere + PersonTwo: PersonTwoWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +---- + +''' + +== Related to an interface type + +=== Should not generate UpdateFieldInput input with no nested operations + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation CREATE specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation CONNECT specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation UPDATE specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation DELETE specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Single relationship with nested operation DISCONNECT specified + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Two relationships with nested operations specified on one + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionSort { + node: PersonSort +} + +input MovieProducersConnectionWhere { + AND: [MovieProducersConnectionWhere!] + NOT: MovieProducersConnectionWhere + OR: [MovieProducersConnectionWhere!] + node: PersonWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + +=== Two relationships with nested operations specified on both + +.Schema +[source,graphql,schema=true] +---- +interface Person { + name: String +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonTwo implements Person { + name: String +} + +type Movie { + id: ID + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE, DELETE]) + producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Person { + name: String +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID + producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieProducersConnection { + edges: [MovieProducersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieProducersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonOne implements Person { + name: String + someExtraProp: [Int!]! +} + +type PersonOneEdge { + cursor: String! + node: PersonOne! +} + +type PersonOnesConnection { + edges: [PersonOneEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonTwo implements Person { + name: String +} + +type PersonTwoEdge { + cursor: String! + node: PersonTwo! +} + +type PersonTwosConnection { + edges: [PersonTwoEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! + personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! + personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! + personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! +} + +enum PersonImplementation { + PersonOne + PersonTwo +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieActorsConnectionSort { + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieProducersConnectionSort { + node: PersonSort +} + +input MovieProducersConnectionWhere { + AND: [MovieProducersConnectionWhere!] + NOT: MovieProducersConnectionWhere + OR: [MovieProducersConnectionWhere!] + node: PersonWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieProducersConnections match this filter" + producersConnection_ALL: MovieProducersConnectionWhere + "Return Movies where none of the related MovieProducersConnections match this filter" + producersConnection_NONE: MovieProducersConnectionWhere + "Return Movies where one of the related MovieProducersConnections match this filter" + producersConnection_SINGLE: MovieProducersConnectionWhere + "Return Movies where some of the related MovieProducersConnections match this filter" + producersConnection_SOME: MovieProducersConnectionWhere + "Return Movies where all of the related People match this filter" + producers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + producers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + producers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + producers_SOME: PersonWhere +} + +input PersonOneOptions { + limit: Int + offset: Int + "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonOneSort!] +} + +"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." +input PersonOneSort { + name: SortDirection +} + +input PersonOneWhere { + AND: [PersonOneWhere!] + NOT: PersonOneWhere + OR: [PersonOneWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + someExtraProp: [Int!] + someExtraProp_INCLUDES: Int +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonTwoOptions { + limit: Int + offset: Int + "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonTwoSort!] +} + +"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." +input PersonTwoSort { + name: SortDirection +} + +input PersonTwoWhere { + AND: [PersonTwoWhere!] + NOT: PersonTwoWhere + OR: [PersonTwoWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String + typename_IN: [PersonImplementation!] +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc deleted file mode 100644 index 8def6fe4..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Should not generate any nested operations if only CONNECT_OR_CREATE is specified and the related type does not have a unique field - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT_OR_CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc deleted file mode 100644 index 77c0d5da..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Should not generate UpdateFieldInput input with no nested operations - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-connect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-connect-specified.adoc deleted file mode 100644 index 446ab2b8..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-connect-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation CONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-create-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-create-specified.adoc deleted file mode 100644 index a7c13705..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-create-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation CREATE specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-delete-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-delete-specified.adoc deleted file mode 100644 index 25b6ef74..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-delete-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation DELETE specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-disconnect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-disconnect-specified.adoc deleted file mode 100644 index ea81ffbe..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-disconnect-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation DISCONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-update-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-update-specified.adoc deleted file mode 100644 index c65d9b20..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/single-relationship-with-nested-operation-update-specified.adoc +++ /dev/null @@ -1,169 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Single relationship with nested operation UPDATE specified - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-both.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-both.adoc deleted file mode 100644 index 5e07c418..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-both.adoc +++ /dev/null @@ -1,210 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Two relationships with nested operations specified on both - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionSort { - node: PersonSort -} - -input MovieProducersConnectionWhere { - AND: [MovieProducersConnectionWhere!] - NOT: MovieProducersConnectionWhere - OR: [MovieProducersConnectionWhere!] - node: PersonWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-one.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-one.adoc deleted file mode 100644 index c677036e..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-concrete-type/two-relationships-with-nested-operations-specified-on-one.adoc +++ /dev/null @@ -1,210 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a concrete type -> Two relationships with nested operations specified on one - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionSort { - node: PersonSort -} - -input MovieProducersConnectionWhere { - AND: [MovieProducersConnectionWhere!] - NOT: MovieProducersConnectionWhere - OR: [MovieProducersConnectionWhere!] - node: PersonWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc deleted file mode 100644 index e85c734a..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-any-nested-operations-if-only-connect_or_create-is-specified-and-the-related-type-does-not-have-a-unique-field.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Should not generate any nested operations if only CONNECT_OR_CREATE is specified and the related type does not have a unique field - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT_OR_CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc deleted file mode 100644 index 96f0b21d..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Should not generate UpdateFieldInput input with no nested operations - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-connect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-connect-specified.adoc deleted file mode 100644 index bd34f3b6..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-connect-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation CONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-create-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-create-specified.adoc deleted file mode 100644 index 1be16ffc..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-create-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation CREATE specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-delete-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-delete-specified.adoc deleted file mode 100644 index b7121f99..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-delete-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation DELETE specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-disconnect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-disconnect-specified.adoc deleted file mode 100644 index 0c0ef0ab..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-disconnect-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation DISCONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-update-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-update-specified.adoc deleted file mode 100644 index cdf46108..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/single-relationship-with-nested-operation-update-specified.adoc +++ /dev/null @@ -1,237 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Single relationship with nested operation UPDATE specified - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-both.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-both.adoc deleted file mode 100644 index 70cf37f3..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-both.adoc +++ /dev/null @@ -1,286 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Two relationships with nested operations specified on both - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionWhere { - PersonOne: MovieProducersPersonOneConnectionWhere - PersonTwo: MovieProducersPersonTwoConnectionWhere -} - -input MovieProducersPersonOneConnectionWhere { - AND: [MovieProducersPersonOneConnectionWhere!] - NOT: MovieProducersPersonOneConnectionWhere - OR: [MovieProducersPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieProducersPersonTwoConnectionWhere { - AND: [MovieProducersPersonTwoConnectionWhere!] - NOT: MovieProducersPersonTwoConnectionWhere - OR: [MovieProducersPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-one.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-one.adoc deleted file mode 100644 index 73b83e47..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-a-union-type/two-relationships-with-nested-operations-specified-on-one.adoc +++ /dev/null @@ -1,286 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to a union type -> Two relationships with nested operations specified on one - -== Source schema - -[source,graphql,schema=true] ----- -type PersonOne { - name: String -} - -type PersonTwo { - nameTwo: String -} - -union Person = PersonOne | PersonTwo - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Person = PersonOne | PersonTwo - -type Movie { - actors(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: QueryOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PersonOne { - name: String -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo { - nameTwo: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: QueryOptions, where: PersonWhere): [Person!]! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionWhere { - PersonOne: MovieActorsPersonOneConnectionWhere - PersonTwo: MovieActorsPersonTwoConnectionWhere -} - -input MovieActorsPersonOneConnectionWhere { - AND: [MovieActorsPersonOneConnectionWhere!] - NOT: MovieActorsPersonOneConnectionWhere - OR: [MovieActorsPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieActorsPersonTwoConnectionWhere { - AND: [MovieActorsPersonTwoConnectionWhere!] - NOT: MovieActorsPersonTwoConnectionWhere - OR: [MovieActorsPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionWhere { - PersonOne: MovieProducersPersonOneConnectionWhere - PersonTwo: MovieProducersPersonTwoConnectionWhere -} - -input MovieProducersPersonOneConnectionWhere { - AND: [MovieProducersPersonOneConnectionWhere!] - NOT: MovieProducersPersonOneConnectionWhere - OR: [MovieProducersPersonOneConnectionWhere!] - node: PersonOneWhere -} - -input MovieProducersPersonTwoConnectionWhere { - AND: [MovieProducersPersonTwoConnectionWhere!] - NOT: MovieProducersPersonTwoConnectionWhere - OR: [MovieProducersPersonTwoConnectionWhere!] - node: PersonTwoWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - nameTwo: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - nameTwo: String - nameTwo_CONTAINS: String - nameTwo_ENDS_WITH: String - nameTwo_IN: [String] - nameTwo_STARTS_WITH: String -} - -input PersonWhere { - PersonOne: PersonOneWhere - PersonTwo: PersonTwoWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc deleted file mode 100644 index 28cc659b..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/should-not-generate-updatefieldinput-input-with-no-nested-operations.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Should not generate UpdateFieldInput input with no nested operations - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: []) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-connect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-connect-specified.adoc deleted file mode 100644 index 2fd4d4d2..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-connect-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation CONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-create-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-create-specified.adoc deleted file mode 100644 index 4548ff56..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-create-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation CREATE specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-delete-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-delete-specified.adoc deleted file mode 100644 index d0de8701..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-delete-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation DELETE specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DELETE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-disconnect-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-disconnect-specified.adoc deleted file mode 100644 index c1300901..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-disconnect-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation DISCONNECT specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-update-specified.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-update-specified.adoc deleted file mode 100644 index 226df35f..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/single-relationship-with-nested-operation-update-specified.adoc +++ /dev/null @@ -1,267 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Single relationship with nested operation UPDATE specified - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [UPDATE]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-both.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-both.adoc deleted file mode 100644 index baa7bcc6..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-both.adoc +++ /dev/null @@ -1,308 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Two relationships with nested operations specified on both - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, nestedOperations: [CREATE, DELETE]) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionSort { - node: PersonSort -} - -input MovieProducersConnectionWhere { - AND: [MovieProducersConnectionWhere!] - NOT: MovieProducersConnectionWhere - OR: [MovieProducersConnectionWhere!] - node: PersonWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-one.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-one.adoc deleted file mode 100644 index c3cda6d5..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/directives/relationship-nested-operations/related-to-an-interface-type/two-relationships-with-nested-operations-specified-on-one.adoc +++ /dev/null @@ -1,308 +0,0 @@ -:toc: - -= Relationship nested operations -> Related to an interface type -> Two relationships with nested operations specified on one - -== Source schema - -[source,graphql,schema=true] ----- -interface Person { - name: String -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonTwo implements Person { - name: String -} - -type Movie { - id: ID - actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN) - producers: [Person!]! @relationship(type: "PRODUCED", direction: IN, nestedOperations: [DISCONNECT]) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Person { - name: String -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID - producers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - producersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieProducersConnectionSort!], where: MovieProducersConnectionWhere): MovieProducersConnection! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieProducersConnection { - edges: [MovieProducersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieProducersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonOne implements Person { - name: String - someExtraProp: [Int!]! -} - -type PersonOneEdge { - cursor: String! - node: PersonOne! -} - -type PersonOnesConnection { - edges: [PersonOneEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonTwo implements Person { - name: String -} - -type PersonTwoEdge { - cursor: String! - node: PersonTwo! -} - -type PersonTwosConnection { - edges: [PersonTwoEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - personOnes(options: PersonOneOptions, where: PersonOneWhere): [PersonOne!]! - personOnesConnection(after: String, first: Int, sort: [PersonOneSort], where: PersonOneWhere): PersonOnesConnection! - personTwos(options: PersonTwoOptions, where: PersonTwoWhere): [PersonTwo!]! - personTwosConnection(after: String, first: Int, sort: [PersonTwoSort], where: PersonTwoWhere): PersonTwosConnection! -} - -enum PersonImplementation { - PersonOne - PersonTwo -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieActorsConnectionSort { - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieProducersConnectionSort { - node: PersonSort -} - -input MovieProducersConnectionWhere { - AND: [MovieProducersConnectionWhere!] - NOT: MovieProducersConnectionWhere - OR: [MovieProducersConnectionWhere!] - node: PersonWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieProducersConnections match this filter" - producersConnection_ALL: MovieProducersConnectionWhere - "Return Movies where none of the related MovieProducersConnections match this filter" - producersConnection_NONE: MovieProducersConnectionWhere - "Return Movies where one of the related MovieProducersConnections match this filter" - producersConnection_SINGLE: MovieProducersConnectionWhere - "Return Movies where some of the related MovieProducersConnections match this filter" - producersConnection_SOME: MovieProducersConnectionWhere - "Return Movies where all of the related People match this filter" - producers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - producers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - producers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - producers_SOME: PersonWhere -} - -input PersonOneOptions { - limit: Int - offset: Int - "Specify one or more PersonOneSort objects to sort PersonOnes by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonOneSort!] -} - -"Fields to sort PersonOnes by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonOneSort object." -input PersonOneSort { - name: SortDirection -} - -input PersonOneWhere { - AND: [PersonOneWhere!] - NOT: PersonOneWhere - OR: [PersonOneWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - someExtraProp: [Int!] - someExtraProp_INCLUDES: Int -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonTwoOptions { - limit: Int - offset: Int - "Specify one or more PersonTwoSort objects to sort PersonTwos by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonTwoSort!] -} - -"Fields to sort PersonTwos by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonTwoSort object." -input PersonTwoSort { - name: SortDirection -} - -input PersonTwoWhere { - AND: [PersonTwoWhere!] - NOT: PersonTwoWhere - OR: [PersonTwoWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String - typename_IN: [PersonImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interface-relationships.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interface-relationships.adoc index f012586a..788b2efd 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interface-relationships.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interface-relationships.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Interface Relationships -> Interface Relationships - single += Interface Relationships -== Source schema +== Interface Relationships - single +.Schema [source,graphql,schema=true] ---- interface Production { @@ -30,8 +32,6 @@ type Actor { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -310,3 +310,4 @@ input SeriesWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface/should-generate-the-correct-schema.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations.adoc similarity index 70% rename from core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface/should-generate-the-correct-schema.adoc rename to core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations.adoc index 75a601e0..86904e92 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface/should-generate-the-correct-schema.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations.adoc @@ -1,9 +1,167 @@ :toc: +:toclevels: 42 -= nested aggregation on interface -> should generate the correct schema += Interface Top Level Aggregations -== Source schema +== Interfaces +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! + cost: Float! +} + +type Movie implements Production { + title: String! + cost: Float! + runtime: Int! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + cost: Float! + title: String! +} + +type Movie implements Production { + cost: Float! + runtime: Int! + title: String! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! +} + +enum ProductionImplementation { + Movie +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + cost: SortDirection + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + cost: Float + cost_GT: Float + cost_GTE: Float + cost_IN: [Float!] + cost_LT: Float + cost_LTE: Float + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + cost: SortDirection + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + cost: Float + cost_GT: Float + cost_GTE: Float + cost_IN: [Float!] + cost_LT: Float + cost_LTE: Float + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +---- + +''' + +== Interfaces With Relationships + +.Schema [source,graphql,schema=true] ---- interface Production { @@ -33,8 +191,6 @@ type Actor { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -337,3 +493,4 @@ input SeriesWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations/interfaces-with-relationships.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations/interfaces-with-relationships.adoc deleted file mode 100644 index 600fccb3..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations/interfaces-with-relationships.adoc +++ /dev/null @@ -1,339 +0,0 @@ -:toc: - -= Interface Top Level Aggregations -> Interfaces With Relationships - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! - cost: Float! -} - -type Movie implements Production { - title: String! - cost: Float! - runtime: Int! -} - -type Series implements Production { - title: String! - cost: Float! - episodes: Int! -} - -type ActedIn @relationshipProperties { - screenTime: Int! -} - -type Actor { - name: String! - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - cost: Float! - title: String! -} - -""" -The edge properties for the following fields: -* Actor.actedIn -""" -type ActedIn { - screenTime: Int! -} - -type Actor { - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - cost: Float! - runtime: Int! - title: String! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - cost: Float! - episodes: Int! - title: String! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - screenTime: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - screenTime: Int - screenTime_GT: Int - screenTime_GTE: Int - screenTime_IN: [Int!] - screenTime_LT: Int - screenTime_LTE: Int -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - cost: SortDirection - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - cost: Float - cost_GT: Float - cost_GTE: Float - cost_IN: [Float!] - cost_LT: Float - cost_LTE: Float - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - cost: SortDirection - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - cost: Float - cost_GT: Float - cost_GTE: Float - cost_IN: [Float!] - cost_LT: Float - cost_LTE: Float - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - cost: SortDirection - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - cost: Float - cost_GT: Float - cost_GTE: Float - cost_IN: [Float!] - cost_LT: Float - cost_LTE: Float - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations/interfaces.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations/interfaces.adoc deleted file mode 100644 index 781fc2d6..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/aggregations/interfaces.adoc +++ /dev/null @@ -1,160 +0,0 @@ -:toc: - -= Interface Top Level Aggregations -> Interfaces - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! - cost: Float! -} - -type Movie implements Production { - title: String! - cost: Float! - runtime: Int! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - cost: Float! - title: String! -} - -type Movie implements Production { - cost: Float! - runtime: Int! - title: String! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! -} - -enum ProductionImplementation { - Movie -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - cost: SortDirection - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - cost: Float - cost_GT: Float - cost_GTE: Float - cost_IN: [Float!] - cost_LT: Float - cost_LTE: Float - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - cost: SortDirection - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - cost: Float - cost_GT: Float - cost_GTE: Float - cost_IN: [Float!] - cost_LT: Float - cost_LTE: Float - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/typename-in.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/typename-in.adoc index eb939819..520a627c 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/typename-in.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/interfaces/typename-in.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = typename_IN -== Source schema +== typename_IN +.Schema [source,graphql,schema=true] ---- interface Production { @@ -29,8 +31,6 @@ type Actor { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -306,3 +306,4 @@ input SeriesWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math.adoc new file mode 100644 index 00000000..6b011272 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math.adoc @@ -0,0 +1,989 @@ +:toc: +:toclevels: 42 + += Algebraic + +== Int fields should be extended with Increment/Decrement operators + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + viewers: Int! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + id: ID + viewers: Int! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: Int + viewers_GT: Int + viewers_GTE: Int + viewers_IN: [Int!] + viewers_LT: Int + viewers_LTE: Int +} + +---- + +''' + +== BigInt fields should be extended with Increment/Decrement operators + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + viewers: BigInt! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + id: ID + viewers: BigInt! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +"A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string." +scalar BigInt + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: BigInt + viewers_GT: BigInt + viewers_GTE: BigInt + viewers_IN: [BigInt!] + viewers_LT: BigInt + viewers_LTE: BigInt +} + +---- + +''' + +== Float fields should be extended with Add/Subtract/Multiply/Divide operators + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + viewers: Float! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + id: ID + viewers: Float! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: Float + viewers_GT: Float + viewers_GTE: Float + viewers_IN: [Float!] + viewers_LT: Float + viewers_LTE: Float +} + +---- + +''' + +== Operators should be presents in nested updates + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + viewers: Int! + directedBy: Director @relationship(type: "DIRECTS", direction: IN) +} + +type Director { + lastName: String! + directs: [Movie!]! @relationship(type: "DIRECTS", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Director { + directs(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + directsConnection(after: String, directed: Boolean = true, first: Int, sort: [DirectorDirectsConnectionSort!], where: DirectorDirectsConnectionWhere): DirectorDirectsConnection! + lastName: String! +} + +type DirectorDirectsConnection { + edges: [DirectorDirectsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type DirectorDirectsRelationship { + cursor: String! + node: Movie! +} + +type DirectorEdge { + cursor: String! + node: Director! +} + +type DirectorsConnection { + edges: [DirectorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + directedBy(directed: Boolean = true, options: DirectorOptions, where: DirectorWhere): Director + directedByConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieDirectedByConnectionSort!], where: MovieDirectedByConnectionWhere): MovieDirectedByConnection! + id: ID + viewers: Int! +} + +type MovieDirectedByConnection { + edges: [MovieDirectedByRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieDirectedByRelationship { + cursor: String! + node: Director! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + directors(options: DirectorOptions, where: DirectorWhere): [Director!]! + directorsConnection(after: String, first: Int, sort: [DirectorSort], where: DirectorWhere): DirectorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input DirectorDirectsConnectionSort { + node: MovieSort +} + +input DirectorDirectsConnectionWhere { + AND: [DirectorDirectsConnectionWhere!] + NOT: DirectorDirectsConnectionWhere + OR: [DirectorDirectsConnectionWhere!] + node: MovieWhere +} + +input DirectorOptions { + limit: Int + offset: Int + "Specify one or more DirectorSort objects to sort Directors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [DirectorSort!] +} + +"Fields to sort Directors by. The order in which sorts are applied is not guaranteed when specifying many fields in one DirectorSort object." +input DirectorSort { + lastName: SortDirection +} + +input DirectorWhere { + AND: [DirectorWhere!] + NOT: DirectorWhere + OR: [DirectorWhere!] + "Return Directors where all of the related DirectorDirectsConnections match this filter" + directsConnection_ALL: DirectorDirectsConnectionWhere + "Return Directors where none of the related DirectorDirectsConnections match this filter" + directsConnection_NONE: DirectorDirectsConnectionWhere + "Return Directors where one of the related DirectorDirectsConnections match this filter" + directsConnection_SINGLE: DirectorDirectsConnectionWhere + "Return Directors where some of the related DirectorDirectsConnections match this filter" + directsConnection_SOME: DirectorDirectsConnectionWhere + "Return Directors where all of the related Movies match this filter" + directs_ALL: MovieWhere + "Return Directors where none of the related Movies match this filter" + directs_NONE: MovieWhere + "Return Directors where one of the related Movies match this filter" + directs_SINGLE: MovieWhere + "Return Directors where some of the related Movies match this filter" + directs_SOME: MovieWhere + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +input MovieDirectedByConnectionSort { + node: DirectorSort +} + +input MovieDirectedByConnectionWhere { + AND: [MovieDirectedByConnectionWhere!] + NOT: MovieDirectedByConnectionWhere + OR: [MovieDirectedByConnectionWhere!] + node: DirectorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + directedBy: DirectorWhere + directedByConnection: MovieDirectedByConnectionWhere + directedByConnection_NOT: MovieDirectedByConnectionWhere + directedBy_NOT: DirectorWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: Int + viewers_GT: Int + viewers_GTE: Int + viewers_IN: [Int!] + viewers_LT: Int + viewers_LTE: Int +} + +---- + +''' + +== Should be supported in interfaces + +.Schema +[source,graphql,schema=true] +---- +interface Production { + viewers: Int! +} + +type Movie implements Production { + id: ID + viewers: Int! + workers: [Person!]! @relationship(type: "WORKED_IN", direction: IN) +} + +type Person { + name: String! + worksInProduction: [Production!]! @relationship(type: "WORKED_IN", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + viewers: Int! +} + +type Movie implements Production { + id: ID + viewers: Int! + workers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + workersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieWorkersConnectionSort!], where: MovieWorkersConnectionWhere): MovieWorkersConnection! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieWorkersConnection { + edges: [MovieWorkersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieWorkersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String! + worksInProduction(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + worksInProductionConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonWorksInProductionConnectionSort!], where: PersonWorksInProductionConnectionWhere): PersonWorksInProductionConnection! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonWorksInProductionConnection { + edges: [PersonWorksInProductionRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonWorksInProductionRelationship { + cursor: String! + node: Production! +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! +} + +enum ProductionImplementation { + Movie +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: Int + viewers_GT: Int + viewers_GTE: Int + viewers_IN: [Int!] + viewers_LT: Int + viewers_LTE: Int + "Return Movies where all of the related MovieWorkersConnections match this filter" + workersConnection_ALL: MovieWorkersConnectionWhere + "Return Movies where none of the related MovieWorkersConnections match this filter" + workersConnection_NONE: MovieWorkersConnectionWhere + "Return Movies where one of the related MovieWorkersConnections match this filter" + workersConnection_SINGLE: MovieWorkersConnectionWhere + "Return Movies where some of the related MovieWorkersConnections match this filter" + workersConnection_SOME: MovieWorkersConnectionWhere + "Return Movies where all of the related People match this filter" + workers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + workers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + workers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + workers_SOME: PersonWhere +} + +input MovieWorkersConnectionSort { + node: PersonSort +} + +input MovieWorkersConnectionWhere { + AND: [MovieWorkersConnectionWhere!] + NOT: MovieWorkersConnectionWhere + OR: [MovieWorkersConnectionWhere!] + node: PersonWhere +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String + "Return People where all of the related PersonWorksInProductionConnections match this filter" + worksInProductionConnection_ALL: PersonWorksInProductionConnectionWhere + "Return People where none of the related PersonWorksInProductionConnections match this filter" + worksInProductionConnection_NONE: PersonWorksInProductionConnectionWhere + "Return People where one of the related PersonWorksInProductionConnections match this filter" + worksInProductionConnection_SINGLE: PersonWorksInProductionConnectionWhere + "Return People where some of the related PersonWorksInProductionConnections match this filter" + worksInProductionConnection_SOME: PersonWorksInProductionConnectionWhere + "Return People where all of the related Productions match this filter" + worksInProduction_ALL: ProductionWhere + "Return People where none of the related Productions match this filter" + worksInProduction_NONE: ProductionWhere + "Return People where one of the related Productions match this filter" + worksInProduction_SINGLE: ProductionWhere + "Return People where some of the related Productions match this filter" + worksInProduction_SOME: ProductionWhere +} + +input PersonWorksInProductionConnectionSort { + node: ProductionSort +} + +input PersonWorksInProductionConnectionWhere { + AND: [PersonWorksInProductionConnectionWhere!] + NOT: PersonWorksInProductionConnectionWhere + OR: [PersonWorksInProductionConnectionWhere!] + node: ProductionWhere +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + viewers: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + typename_IN: [ProductionImplementation!] + viewers: Int + viewers_GT: Int + viewers_GTE: Int + viewers_IN: [Int!] + viewers_LT: Int + viewers_LTE: Int +} + +---- + +''' + +== Should be supported in Relationship properties + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String! + actedInMovies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) +} + +type Movie { + title: String! + actors: [Person!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) +} + +type ActedIn @relationshipProperties { + roles: [String!] + pay: Float +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +""" +The edge properties for the following fields: +* Person.actedInMovies +* Movie.actors +""" +type ActedIn { + pay: Float + roles: [String!] +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + actedInMovies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + actedInMoviesConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonActedInMoviesConnectionSort!], where: PersonActedInMoviesConnectionWhere): PersonActedInMoviesConnection! + name: String! +} + +type PersonActedInMoviesConnection { + edges: [PersonActedInMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonActedInMoviesRelationship { + cursor: String! + node: Movie! + properties: ActedIn! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + pay: SortDirection + roles: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + pay: Float + pay_GT: Float + pay_GTE: Float + pay_IN: [Float] + pay_LT: Float + pay_LTE: Float + roles: [String!] + roles_INCLUDES: String +} + +input MovieActorsConnectionSort { + edge: ActedInSort + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + edge: ActedInWhere + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input PersonActedInMoviesConnectionSort { + edge: ActedInSort + node: MovieSort +} + +input PersonActedInMoviesConnectionWhere { + AND: [PersonActedInMoviesConnectionWhere!] + NOT: PersonActedInMoviesConnectionWhere + OR: [PersonActedInMoviesConnectionWhere!] + edge: ActedInWhere + node: MovieWhere +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + "Return People where all of the related PersonActedInMoviesConnections match this filter" + actedInMoviesConnection_ALL: PersonActedInMoviesConnectionWhere + "Return People where none of the related PersonActedInMoviesConnections match this filter" + actedInMoviesConnection_NONE: PersonActedInMoviesConnectionWhere + "Return People where one of the related PersonActedInMoviesConnections match this filter" + actedInMoviesConnection_SINGLE: PersonActedInMoviesConnectionWhere + "Return People where some of the related PersonActedInMoviesConnections match this filter" + actedInMoviesConnection_SOME: PersonActedInMoviesConnectionWhere + "Return People where all of the related Movies match this filter" + actedInMovies_ALL: MovieWhere + "Return People where none of the related Movies match this filter" + actedInMovies_NONE: MovieWhere + "Return People where one of the related Movies match this filter" + actedInMovies_SINGLE: MovieWhere + "Return People where some of the related Movies match this filter" + actedInMovies_SOME: MovieWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/bigint-fields-should-be-extended-with-increment/decrement-operators.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/bigint-fields-should-be-extended-with-increment/decrement-operators.adoc deleted file mode 100644 index 067b31cb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/bigint-fields-should-be-extended-with-increment/decrement-operators.adoc +++ /dev/null @@ -1,96 +0,0 @@ -:toc: - -= Algebraic -> BigInt fields should be extended with Increment/Decrement operators - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - viewers: BigInt! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - id: ID - viewers: BigInt! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -"A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string." -scalar BigInt - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: BigInt - viewers_GT: BigInt - viewers_GTE: BigInt - viewers_IN: [BigInt!] - viewers_LT: BigInt - viewers_LTE: BigInt -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/float-fields-should-be-extended-with-add/subtract/multiply/divide-operators.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/float-fields-should-be-extended-with-add/subtract/multiply/divide-operators.adoc deleted file mode 100644 index 03b3dbe8..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/float-fields-should-be-extended-with-add/subtract/multiply/divide-operators.adoc +++ /dev/null @@ -1,93 +0,0 @@ -:toc: - -= Algebraic -> Float fields should be extended with Add/Subtract/Multiply/Divide operators - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - viewers: Float! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - id: ID - viewers: Float! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: Float - viewers_GT: Float - viewers_GTE: Float - viewers_IN: [Float!] - viewers_LT: Float - viewers_LTE: Float -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/operators-should-be-presents-in-nested-updates.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/operators-should-be-presents-in-nested-updates.adoc deleted file mode 100644 index 0a46aaa5..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/operators-should-be-presents-in-nested-updates.adoc +++ /dev/null @@ -1,207 +0,0 @@ -:toc: - -= Algebraic -> Operators should be presents in nested updates - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - viewers: Int! - directedBy: Director @relationship(type: "DIRECTS", direction: IN) -} - -type Director { - lastName: String! - directs: [Movie!]! @relationship(type: "DIRECTS", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Director { - directs(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - directsConnection(after: String, directed: Boolean = true, first: Int, sort: [DirectorDirectsConnectionSort!], where: DirectorDirectsConnectionWhere): DirectorDirectsConnection! - lastName: String! -} - -type DirectorDirectsConnection { - edges: [DirectorDirectsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type DirectorDirectsRelationship { - cursor: String! - node: Movie! -} - -type DirectorEdge { - cursor: String! - node: Director! -} - -type DirectorsConnection { - edges: [DirectorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - directedBy(directed: Boolean = true, options: DirectorOptions, where: DirectorWhere): Director - directedByConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieDirectedByConnectionSort!], where: MovieDirectedByConnectionWhere): MovieDirectedByConnection! - id: ID - viewers: Int! -} - -type MovieDirectedByConnection { - edges: [MovieDirectedByRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieDirectedByRelationship { - cursor: String! - node: Director! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - directors(options: DirectorOptions, where: DirectorWhere): [Director!]! - directorsConnection(after: String, first: Int, sort: [DirectorSort], where: DirectorWhere): DirectorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input DirectorDirectsConnectionSort { - node: MovieSort -} - -input DirectorDirectsConnectionWhere { - AND: [DirectorDirectsConnectionWhere!] - NOT: DirectorDirectsConnectionWhere - OR: [DirectorDirectsConnectionWhere!] - node: MovieWhere -} - -input DirectorOptions { - limit: Int - offset: Int - "Specify one or more DirectorSort objects to sort Directors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [DirectorSort!] -} - -"Fields to sort Directors by. The order in which sorts are applied is not guaranteed when specifying many fields in one DirectorSort object." -input DirectorSort { - lastName: SortDirection -} - -input DirectorWhere { - AND: [DirectorWhere!] - NOT: DirectorWhere - OR: [DirectorWhere!] - "Return Directors where all of the related DirectorDirectsConnections match this filter" - directsConnection_ALL: DirectorDirectsConnectionWhere - "Return Directors where none of the related DirectorDirectsConnections match this filter" - directsConnection_NONE: DirectorDirectsConnectionWhere - "Return Directors where one of the related DirectorDirectsConnections match this filter" - directsConnection_SINGLE: DirectorDirectsConnectionWhere - "Return Directors where some of the related DirectorDirectsConnections match this filter" - directsConnection_SOME: DirectorDirectsConnectionWhere - "Return Directors where all of the related Movies match this filter" - directs_ALL: MovieWhere - "Return Directors where none of the related Movies match this filter" - directs_NONE: MovieWhere - "Return Directors where one of the related Movies match this filter" - directs_SINGLE: MovieWhere - "Return Directors where some of the related Movies match this filter" - directs_SOME: MovieWhere - lastName: String - lastName_CONTAINS: String - lastName_ENDS_WITH: String - lastName_IN: [String!] - lastName_STARTS_WITH: String -} - -input MovieDirectedByConnectionSort { - node: DirectorSort -} - -input MovieDirectedByConnectionWhere { - AND: [MovieDirectedByConnectionWhere!] - NOT: MovieDirectedByConnectionWhere - OR: [MovieDirectedByConnectionWhere!] - node: DirectorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - directedBy: DirectorWhere - directedByConnection: MovieDirectedByConnectionWhere - directedByConnection_NOT: MovieDirectedByConnectionWhere - directedBy_NOT: DirectorWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: Int - viewers_GT: Int - viewers_GTE: Int - viewers_IN: [Int!] - viewers_LT: Int - viewers_LTE: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/should-be-supported-in-interfaces.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/should-be-supported-in-interfaces.adoc deleted file mode 100644 index 8e511ed5..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/should-be-supported-in-interfaces.adoc +++ /dev/null @@ -1,269 +0,0 @@ -:toc: - -= Algebraic -> Should be supported in interfaces - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - viewers: Int! -} - -type Movie implements Production { - id: ID - viewers: Int! - workers: [Person!]! @relationship(type: "WORKED_IN", direction: IN) -} - -type Person { - name: String! - worksInProduction: [Production!]! @relationship(type: "WORKED_IN", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - viewers: Int! -} - -type Movie implements Production { - id: ID - viewers: Int! - workers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - workersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieWorkersConnectionSort!], where: MovieWorkersConnectionWhere): MovieWorkersConnection! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieWorkersConnection { - edges: [MovieWorkersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieWorkersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String! - worksInProduction(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - worksInProductionConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonWorksInProductionConnectionSort!], where: PersonWorksInProductionConnectionWhere): PersonWorksInProductionConnection! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonWorksInProductionConnection { - edges: [PersonWorksInProductionRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonWorksInProductionRelationship { - cursor: String! - node: Production! -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! -} - -enum ProductionImplementation { - Movie -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: Int - viewers_GT: Int - viewers_GTE: Int - viewers_IN: [Int!] - viewers_LT: Int - viewers_LTE: Int - "Return Movies where all of the related MovieWorkersConnections match this filter" - workersConnection_ALL: MovieWorkersConnectionWhere - "Return Movies where none of the related MovieWorkersConnections match this filter" - workersConnection_NONE: MovieWorkersConnectionWhere - "Return Movies where one of the related MovieWorkersConnections match this filter" - workersConnection_SINGLE: MovieWorkersConnectionWhere - "Return Movies where some of the related MovieWorkersConnections match this filter" - workersConnection_SOME: MovieWorkersConnectionWhere - "Return Movies where all of the related People match this filter" - workers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - workers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - workers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - workers_SOME: PersonWhere -} - -input MovieWorkersConnectionSort { - node: PersonSort -} - -input MovieWorkersConnectionWhere { - AND: [MovieWorkersConnectionWhere!] - NOT: MovieWorkersConnectionWhere - OR: [MovieWorkersConnectionWhere!] - node: PersonWhere -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String - "Return People where all of the related PersonWorksInProductionConnections match this filter" - worksInProductionConnection_ALL: PersonWorksInProductionConnectionWhere - "Return People where none of the related PersonWorksInProductionConnections match this filter" - worksInProductionConnection_NONE: PersonWorksInProductionConnectionWhere - "Return People where one of the related PersonWorksInProductionConnections match this filter" - worksInProductionConnection_SINGLE: PersonWorksInProductionConnectionWhere - "Return People where some of the related PersonWorksInProductionConnections match this filter" - worksInProductionConnection_SOME: PersonWorksInProductionConnectionWhere - "Return People where all of the related Productions match this filter" - worksInProduction_ALL: ProductionWhere - "Return People where none of the related Productions match this filter" - worksInProduction_NONE: ProductionWhere - "Return People where one of the related Productions match this filter" - worksInProduction_SINGLE: ProductionWhere - "Return People where some of the related Productions match this filter" - worksInProduction_SOME: ProductionWhere -} - -input PersonWorksInProductionConnectionSort { - node: ProductionSort -} - -input PersonWorksInProductionConnectionWhere { - AND: [PersonWorksInProductionConnectionWhere!] - NOT: PersonWorksInProductionConnectionWhere - OR: [PersonWorksInProductionConnectionWhere!] - node: ProductionWhere -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - viewers: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - typename_IN: [ProductionImplementation!] - viewers: Int - viewers_GT: Int - viewers_GTE: Int - viewers_IN: [Int!] - viewers_LT: Int - viewers_LTE: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/should-be-supported-in-relationship-properties.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/should-be-supported-in-relationship-properties.adoc deleted file mode 100644 index 4ca2543b..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/math/should-be-supported-in-relationship-properties.adoc +++ /dev/null @@ -1,250 +0,0 @@ -:toc: - -= Algebraic -> Should be supported in Relationship properties - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String! - actedInMovies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) -} - -type Movie { - title: String! - actors: [Person!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) -} - -type ActedIn @relationshipProperties { - roles: [String!] - pay: Float -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -""" -The edge properties for the following fields: -* Person.actedInMovies -* Movie.actors -""" -type ActedIn { - pay: Float - roles: [String!] -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! - properties: ActedIn! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - actedInMovies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - actedInMoviesConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonActedInMoviesConnectionSort!], where: PersonActedInMoviesConnectionWhere): PersonActedInMoviesConnection! - name: String! -} - -type PersonActedInMoviesConnection { - edges: [PersonActedInMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonActedInMoviesRelationship { - cursor: String! - node: Movie! - properties: ActedIn! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - pay: SortDirection - roles: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - pay: Float - pay_GT: Float - pay_GTE: Float - pay_IN: [Float] - pay_LT: Float - pay_LTE: Float - roles: [String!] - roles_INCLUDES: String -} - -input MovieActorsConnectionSort { - edge: ActedInSort - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - edge: ActedInWhere - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input PersonActedInMoviesConnectionSort { - edge: ActedInSort - node: MovieSort -} - -input PersonActedInMoviesConnectionWhere { - AND: [PersonActedInMoviesConnectionWhere!] - NOT: PersonActedInMoviesConnectionWhere - OR: [PersonActedInMoviesConnectionWhere!] - edge: ActedInWhere - node: MovieWhere -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - "Return People where all of the related PersonActedInMoviesConnections match this filter" - actedInMoviesConnection_ALL: PersonActedInMoviesConnectionWhere - "Return People where none of the related PersonActedInMoviesConnections match this filter" - actedInMoviesConnection_NONE: PersonActedInMoviesConnectionWhere - "Return People where one of the related PersonActedInMoviesConnections match this filter" - actedInMoviesConnection_SINGLE: PersonActedInMoviesConnectionWhere - "Return People where some of the related PersonActedInMoviesConnections match this filter" - actedInMoviesConnection_SOME: PersonActedInMoviesConnectionWhere - "Return People where all of the related Movies match this filter" - actedInMovies_ALL: MovieWhere - "Return People where none of the related Movies match this filter" - actedInMovies_NONE: MovieWhere - "Return People where one of the related Movies match this filter" - actedInMovies_SINGLE: MovieWhere - "Return People where some of the related Movies match this filter" - actedInMovies_SOME: MovieWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface.adoc index 75a601e0..72baa237 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= nested aggregation on interface -> should generate the correct schema += nested aggregation on interface -== Source schema +== Setup +.Schema [source,graphql,schema=true] ---- interface Production { @@ -33,7 +35,7 @@ type Actor { } ---- -== Augmented schema +== should generate the correct schema .Augmented Schema [source,graphql] @@ -337,3 +339,309 @@ input SeriesWhere { ---- ''' + +== aggregate false should generate the correct schema without aggregations + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + cost: Float! + title: String! +} + +""" +The edge properties for the following fields: +* Actor.actedIn +""" +type ActedIn { + screenTime: Int! +} + +type Actor { + actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! + name: String! +} + +type ActorActedInConnection { + edges: [ActorActedInRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorActedInRelationship { + cursor: String! + node: Production! + properties: ActedIn! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie implements Production { + cost: Float! + runtime: Int! + title: String! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! + series(options: SeriesOptions, where: SeriesWhere): [Series!]! + seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! +} + +type Series implements Production { + cost: Float! + episodes: Int! + title: String! +} + +type SeriesConnection { + edges: [SeriesEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesEdge { + cursor: String! + node: Series! +} + +enum ProductionImplementation { + Movie + Series +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + screenTime: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + screenTime: Int + screenTime_GT: Int + screenTime_GTE: Int + screenTime_IN: [Int!] + screenTime_LT: Int + screenTime_LTE: Int +} + +input ActorActedInConnectionSort { + edge: ActedInSort + node: ProductionSort +} + +input ActorActedInConnectionWhere { + AND: [ActorActedInConnectionWhere!] + NOT: ActorActedInConnectionWhere + OR: [ActorActedInConnectionWhere!] + edge: ActedInWhere + node: ProductionWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorActedInConnections match this filter" + actedInConnection_ALL: ActorActedInConnectionWhere + "Return Actors where none of the related ActorActedInConnections match this filter" + actedInConnection_NONE: ActorActedInConnectionWhere + "Return Actors where one of the related ActorActedInConnections match this filter" + actedInConnection_SINGLE: ActorActedInConnectionWhere + "Return Actors where some of the related ActorActedInConnections match this filter" + actedInConnection_SOME: ActorActedInConnectionWhere + "Return Actors where all of the related Productions match this filter" + actedIn_ALL: ProductionWhere + "Return Actors where none of the related Productions match this filter" + actedIn_NONE: ProductionWhere + "Return Actors where one of the related Productions match this filter" + actedIn_SINGLE: ProductionWhere + "Return Actors where some of the related Productions match this filter" + actedIn_SOME: ProductionWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + cost: SortDirection + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + cost: Float + cost_GT: Float + cost_GTE: Float + cost_IN: [Float!] + cost_LT: Float + cost_LTE: Float + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + cost: SortDirection + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + cost: Float + cost_GT: Float + cost_GTE: Float + cost_IN: [Float!] + cost_LT: Float + cost_LTE: Float + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +input SeriesOptions { + limit: Int + offset: Int + "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." + sort: [SeriesSort!] +} + +"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." +input SeriesSort { + cost: SortDirection + episodes: SortDirection + title: SortDirection +} + +input SeriesWhere { + AND: [SeriesWhere!] + NOT: SeriesWhere + OR: [SeriesWhere!] + cost: Float + cost_GT: Float + cost_GTE: Float + cost_IN: [Float!] + cost_LT: Float + cost_LTE: Float + episodes: Int + episodes_GT: Int + episodes_GTE: Int + episodes_IN: [Int!] + episodes_LT: Int + episodes_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface/aggregate-false-should-generate-the-correct-schema-without-aggregations.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface/aggregate-false-should-generate-the-correct-schema-without-aggregations.adoc deleted file mode 100644 index 09b76706..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/nested-aggregation-on-interface/aggregate-false-should-generate-the-correct-schema-without-aggregations.adoc +++ /dev/null @@ -1,339 +0,0 @@ -:toc: - -= nested aggregation on interface -> aggregate false should generate the correct schema without aggregations - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! - cost: Float! -} - -type Movie implements Production { - title: String! - cost: Float! - runtime: Int! -} - -type Series implements Production { - title: String! - cost: Float! - episodes: Int! -} - -type ActedIn @relationshipProperties { - screenTime: Int! -} - -type Actor { - name: String! - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - cost: Float! - title: String! -} - -""" -The edge properties for the following fields: -* Actor.actedIn -""" -type ActedIn { - screenTime: Int! -} - -type Actor { - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - cost: Float! - runtime: Int! - title: String! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - cost: Float! - episodes: Int! - title: String! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - screenTime: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - screenTime: Int - screenTime_GT: Int - screenTime_GTE: Int - screenTime_IN: [Int!] - screenTime_LT: Int - screenTime_LTE: Int -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - cost: SortDirection - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - cost: Float - cost_GT: Float - cost_GTE: Float - cost_IN: [Float!] - cost_LT: Float - cost_LTE: Float - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - cost: SortDirection - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - cost: Float - cost_GT: Float - cost_GTE: Float - cost_IN: [Float!] - cost_LT: Float - cost_LTE: Float - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - cost: SortDirection - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - cost: Float - cost_GT: Float - cost_GTE: Float - cost_IN: [Float!] - cost_LT: Float - cost_LTE: Float - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/plural.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/plural.adoc index 8da94886..008caf3c 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/plural.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/plural.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Plural option -> Plural on interface and union += Plural option -== Source schema +== Plural on interface and union +.Schema [source,graphql,schema=true] ---- interface Animal @plural(value: "animales") { @@ -22,8 +24,6 @@ type Cat { union Pet @plural(value: "petties") = Dog | Cat ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -199,3 +199,4 @@ input QueryOptions { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions.adoc new file mode 100644 index 00000000..2b74111a --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions.adoc @@ -0,0 +1,955 @@ +:toc: +:toclevels: 42 + += Subscriptions + +== Subscriptions + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + actorCount: Int + averageRating: Float + isActive: Boolean + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + name: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actorCount: Int + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + averageRating: Float + id: ID + isActive: Boolean +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + +== Empty EventPayload type + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + actorCount: Int + averageRating: Float + isActive: Boolean + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actorCount: Int + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + averageRating: Float + id: ID + isActive: Boolean +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + +== Empty EventPayload type on Union type + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + actorCount: Int + averageRating: Float + isActive: Boolean + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +union Actor = Star | Person + +type Star { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Person { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Actor = Person | Star + +type Movie { + actorCount: Int + actors(directed: Boolean = true, options: QueryOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + averageRating: Float + id: ID + isActive: Boolean +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonMoviesConnectionSort!], where: PersonMoviesConnectionWhere): PersonMoviesConnection! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonMoviesConnection { + edges: [PersonMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonMoviesRelationship { + cursor: String! + node: Movie! +} + +type Query { + actors(options: QueryOptions, where: ActorWhere): [Actor!]! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, where: PersonWhere): PeopleConnection! + stars(options: StarOptions, where: StarWhere): [Star!]! + starsConnection(after: String, first: Int, where: StarWhere): StarsConnection! +} + +type Star { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [StarMoviesConnectionSort!], where: StarMoviesConnectionWhere): StarMoviesConnection! +} + +type StarEdge { + cursor: String! + node: Star! +} + +type StarMoviesConnection { + edges: [StarMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type StarMoviesRelationship { + cursor: String! + node: Movie! +} + +type StarsConnection { + edges: [StarEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorWhere { + Person: PersonWhere + Star: StarWhere +} + +input MovieActorsConnectionWhere { + Person: MovieActorsPersonConnectionWhere + Star: MovieActorsStarConnectionWhere +} + +input MovieActorsPersonConnectionWhere { + AND: [MovieActorsPersonConnectionWhere!] + NOT: MovieActorsPersonConnectionWhere + OR: [MovieActorsPersonConnectionWhere!] + node: PersonWhere +} + +input MovieActorsStarConnectionWhere { + AND: [MovieActorsStarConnectionWhere!] + NOT: MovieActorsStarConnectionWhere + OR: [MovieActorsStarConnectionWhere!] + node: StarWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +input PersonMoviesConnectionSort { + node: MovieSort +} + +input PersonMoviesConnectionWhere { + AND: [PersonMoviesConnectionWhere!] + NOT: PersonMoviesConnectionWhere + OR: [PersonMoviesConnectionWhere!] + node: MovieWhere +} + +input PersonOptions { + limit: Int + offset: Int +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + "Return People where all of the related PersonMoviesConnections match this filter" + moviesConnection_ALL: PersonMoviesConnectionWhere + "Return People where none of the related PersonMoviesConnections match this filter" + moviesConnection_NONE: PersonMoviesConnectionWhere + "Return People where one of the related PersonMoviesConnections match this filter" + moviesConnection_SINGLE: PersonMoviesConnectionWhere + "Return People where some of the related PersonMoviesConnections match this filter" + moviesConnection_SOME: PersonMoviesConnectionWhere + "Return People where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return People where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return People where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return People where some of the related Movies match this filter" + movies_SOME: MovieWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +input StarMoviesConnectionSort { + node: MovieSort +} + +input StarMoviesConnectionWhere { + AND: [StarMoviesConnectionWhere!] + NOT: StarMoviesConnectionWhere + OR: [StarMoviesConnectionWhere!] + node: MovieWhere +} + +input StarOptions { + limit: Int + offset: Int +} + +input StarWhere { + AND: [StarWhere!] + NOT: StarWhere + OR: [StarWhere!] + "Return Stars where all of the related StarMoviesConnections match this filter" + moviesConnection_ALL: StarMoviesConnectionWhere + "Return Stars where none of the related StarMoviesConnections match this filter" + moviesConnection_NONE: StarMoviesConnectionWhere + "Return Stars where one of the related StarMoviesConnections match this filter" + moviesConnection_SINGLE: StarMoviesConnectionWhere + "Return Stars where some of the related StarMoviesConnections match this filter" + moviesConnection_SOME: StarMoviesConnectionWhere + "Return Stars where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Stars where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Stars where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Stars where some of the related Movies match this filter" + movies_SOME: MovieWhere +} + +---- + +''' + +== Empty EventPayload type, but @relationshipProperty exists + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + actorCount: Int + averageRating: Float + isActive: Boolean + actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +""" +The edge properties for the following fields: +* Movie.actors +""" +type ActedIn { + screenTime: Int! +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actorCount: Int + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + averageRating: Float + id: ID + isActive: Boolean +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + screenTime: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + screenTime: Int + screenTime_GT: Int + screenTime_GTE: Int + screenTime_IN: [Int!] + screenTime_LT: Int + screenTime_LTE: Int +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere +} + +input MovieActorsConnectionSort { + edge: ActedInSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type-on-union-type.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type-on-union-type.adoc deleted file mode 100644 index 8f2fa6b3..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type-on-union-type.adoc +++ /dev/null @@ -1,313 +0,0 @@ -:toc: - -= Subscriptions -> Empty EventPayload type on Union type - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - actorCount: Int - averageRating: Float - isActive: Boolean - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} - -union Actor = Star | Person - -type Star { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Person { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Actor = Person | Star - -type Movie { - actorCount: Int - actors(directed: Boolean = true, options: QueryOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - averageRating: Float - id: ID - isActive: Boolean -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonMoviesConnectionSort!], where: PersonMoviesConnectionWhere): PersonMoviesConnection! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonMoviesConnection { - edges: [PersonMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonMoviesRelationship { - cursor: String! - node: Movie! -} - -type Query { - actors(options: QueryOptions, where: ActorWhere): [Actor!]! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, where: PersonWhere): PeopleConnection! - stars(options: StarOptions, where: StarWhere): [Star!]! - starsConnection(after: String, first: Int, where: StarWhere): StarsConnection! -} - -type Star { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [StarMoviesConnectionSort!], where: StarMoviesConnectionWhere): StarMoviesConnection! -} - -type StarEdge { - cursor: String! - node: Star! -} - -type StarMoviesConnection { - edges: [StarMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type StarMoviesRelationship { - cursor: String! - node: Movie! -} - -type StarsConnection { - edges: [StarEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorWhere { - Person: PersonWhere - Star: StarWhere -} - -input MovieActorsConnectionWhere { - Person: MovieActorsPersonConnectionWhere - Star: MovieActorsStarConnectionWhere -} - -input MovieActorsPersonConnectionWhere { - AND: [MovieActorsPersonConnectionWhere!] - NOT: MovieActorsPersonConnectionWhere - OR: [MovieActorsPersonConnectionWhere!] - node: PersonWhere -} - -input MovieActorsStarConnectionWhere { - AND: [MovieActorsStarConnectionWhere!] - NOT: MovieActorsStarConnectionWhere - OR: [MovieActorsStarConnectionWhere!] - node: StarWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - -input PersonMoviesConnectionSort { - node: MovieSort -} - -input PersonMoviesConnectionWhere { - AND: [PersonMoviesConnectionWhere!] - NOT: PersonMoviesConnectionWhere - OR: [PersonMoviesConnectionWhere!] - node: MovieWhere -} - -input PersonOptions { - limit: Int - offset: Int -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - "Return People where all of the related PersonMoviesConnections match this filter" - moviesConnection_ALL: PersonMoviesConnectionWhere - "Return People where none of the related PersonMoviesConnections match this filter" - moviesConnection_NONE: PersonMoviesConnectionWhere - "Return People where one of the related PersonMoviesConnections match this filter" - moviesConnection_SINGLE: PersonMoviesConnectionWhere - "Return People where some of the related PersonMoviesConnections match this filter" - moviesConnection_SOME: PersonMoviesConnectionWhere - "Return People where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return People where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return People where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return People where some of the related Movies match this filter" - movies_SOME: MovieWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - -input StarMoviesConnectionSort { - node: MovieSort -} - -input StarMoviesConnectionWhere { - AND: [StarMoviesConnectionWhere!] - NOT: StarMoviesConnectionWhere - OR: [StarMoviesConnectionWhere!] - node: MovieWhere -} - -input StarOptions { - limit: Int - offset: Int -} - -input StarWhere { - AND: [StarWhere!] - NOT: StarWhere - OR: [StarWhere!] - "Return Stars where all of the related StarMoviesConnections match this filter" - moviesConnection_ALL: StarMoviesConnectionWhere - "Return Stars where none of the related StarMoviesConnections match this filter" - moviesConnection_NONE: StarMoviesConnectionWhere - "Return Stars where one of the related StarMoviesConnections match this filter" - moviesConnection_SINGLE: StarMoviesConnectionWhere - "Return Stars where some of the related StarMoviesConnections match this filter" - moviesConnection_SOME: StarMoviesConnectionWhere - "Return Stars where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Stars where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Stars where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Stars where some of the related Movies match this filter" - movies_SOME: MovieWhere -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type.adoc deleted file mode 100644 index eb707ff8..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/empty-eventpayload-type.adoc +++ /dev/null @@ -1,214 +0,0 @@ -:toc: - -= Subscriptions -> Empty EventPayload type - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - actorCount: Int - averageRating: Float - isActive: Boolean - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} - -type Actor { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actorCount: Int - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - averageRating: Float - id: ID - isActive: Boolean -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/subscriptions.adoc b/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/subscriptions.adoc deleted file mode 100644 index be8d297d..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/experimental-schema/subscriptions/subscriptions.adoc +++ /dev/null @@ -1,191 +0,0 @@ -:toc: - -= Subscriptions - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - actorCount: Int - averageRating: Float - isActive: Boolean - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} - -type Actor { - name: String! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - name: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actorCount: Int - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - averageRating: Float - id: ID - isActive: Boolean -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/extend.adoc b/core/src/test/resources/tck-test-files/schema/v2/extend.adoc index c5b49452..7ee7c75c 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/extend.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/extend.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Extend -== Source schema +== Extend +.Schema [source,graphql,schema=true] ---- type Movie { @@ -15,8 +17,6 @@ extend type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -93,3 +93,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/inputs.adoc b/core/src/test/resources/tck-test-files/schema/v2/inputs.adoc index 04cd6f37..b76c9f93 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/inputs.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/inputs.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Inputs -== Source schema +== Inputs +.Schema [source,graphql,schema=true] ---- input NodeInput { @@ -19,8 +21,6 @@ type Query { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -95,3 +95,4 @@ input NodeInput { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/interface-relationships.adoc b/core/src/test/resources/tck-test-files/schema/v2/interface-relationships.adoc index f012586a..788b2efd 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/interface-relationships.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/interface-relationships.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Interface Relationships -> Interface Relationships - single += Interface Relationships -== Source schema +== Interface Relationships - single +.Schema [source,graphql,schema=true] ---- interface Production { @@ -30,8 +32,6 @@ type Actor { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -310,3 +310,4 @@ input SeriesWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/1038.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/1038.adoc index 3750e166..a608cbef 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/1038.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/1038.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= https://github.com/neo4j/graphql/issues/1038 -> AWSAccount and DNSZone should be cased correctly += https://github.com/neo4j/graphql/issues/1038 -== Source schema +== AWSAccount and DNSZone should be cased correctly +.Schema [source,graphql,schema=true] ---- type AWSAccount { @@ -17,8 +19,6 @@ type DNSZone { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -142,3 +142,4 @@ input DNSZoneWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/1614.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/1614.adoc index 94e4feec..1ad2c4ec 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/1614.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/1614.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= https://github.com/neo4j/graphql/issues/1614 -> should include enumFields on relationships += https://github.com/neo4j/graphql/issues/1614 -== Source schema +== should include enumFields on relationships +.Schema [source,graphql,schema=true] ---- enum CrewPositionType { @@ -25,8 +27,6 @@ type CrewMember { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -180,3 +180,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/162.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/162.adoc index 35790230..ca3666b1 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/162.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/162.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= 162 -> 2 instances of DeleteInput type created += 162 -== Source schema +== 2 instances of DeleteInput type created +.Schema [source,graphql,schema=true] ---- type Tiger { @@ -21,8 +23,6 @@ type TigerJawLevel2Part1 { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -229,3 +229,4 @@ input TigerWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/2187.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/2187.adoc index 1f97edf2..ffea1ff6 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/2187.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/2187.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= https://github.com/neo4j/graphql/issues/2187 -> Deprecated directive should be present on genres in generated schema += https://github.com/neo4j/graphql/issues/2187 -== Source schema +== Deprecated directive should be present on genres in generated schema +.Schema [source,graphql,schema=true] ---- type Movie { @@ -19,8 +21,6 @@ type Genre { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -226,3 +226,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/2969.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/2969.adoc index 80d9e239..0977461e 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/2969.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/2969.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= https://github.com/neo4j/graphql/issues/2969 -> authorAggregate should not be generated += https://github.com/neo4j/graphql/issues/2969 -== Source schema +== authorAggregate should not be generated +.Schema [source,graphql,schema=true] ---- type Post { @@ -18,8 +20,6 @@ type User { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -204,3 +204,4 @@ input UserWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/2981.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/2981.adoc index 3cecbd1c..470168be 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/2981.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/2981.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= https://github.com/neo4j/graphql/issues/2981 -> BookTranslatedTitleCreateFieldInput fields should not be of type List += https://github.com/neo4j/graphql/issues/2981 -== Source schema +== BookTranslatedTitleCreateFieldInput fields should not be of type List +.Schema [source,graphql,schema=true] ---- type Book { @@ -25,8 +27,6 @@ type BookTitle_EN { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -289,3 +289,4 @@ input QueryOptions { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/3816.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/3816.adoc new file mode 100644 index 00000000..6c6ccb04 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/3816.adoc @@ -0,0 +1,393 @@ +:toc: +:toclevels: 42 + += https://github.com/neo4j/graphql/issues/3816 + +== Combination of nested operations in reported issue + +.Schema +[source,graphql,schema=true] +---- +type Movie { + name: String! + genre: Genre! @relationship(type: "HAS_GENRE", direction: OUT, nestedOperations: [CONNECT, DISCONNECT]) +} + +type Genre { + name: String! + movies: [Movie!]! @relationship(type: "HAS_GENRE", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Genre { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [GenreMoviesConnectionSort!], where: GenreMoviesConnectionWhere): GenreMoviesConnection! + name: String! +} + +type GenreEdge { + cursor: String! + node: Genre! +} + +type GenreMoviesConnection { + edges: [GenreMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type GenreMoviesRelationship { + cursor: String! + node: Movie! +} + +type GenresConnection { + edges: [GenreEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + genre(directed: Boolean = true, options: GenreOptions, where: GenreWhere): Genre! + genreConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieGenreConnectionSort!], where: MovieGenreConnectionWhere): MovieGenreConnection! + name: String! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieGenreConnection { + edges: [MovieGenreRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieGenreRelationship { + cursor: String! + node: Genre! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + genres(options: GenreOptions, where: GenreWhere): [Genre!]! + genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input GenreMoviesConnectionSort { + node: MovieSort +} + +input GenreMoviesConnectionWhere { + AND: [GenreMoviesConnectionWhere!] + NOT: GenreMoviesConnectionWhere + OR: [GenreMoviesConnectionWhere!] + node: MovieWhere +} + +input GenreOptions { + limit: Int + offset: Int + "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." + sort: [GenreSort!] +} + +"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." +input GenreSort { + name: SortDirection +} + +input GenreWhere { + AND: [GenreWhere!] + NOT: GenreWhere + OR: [GenreWhere!] + "Return Genres where all of the related GenreMoviesConnections match this filter" + moviesConnection_ALL: GenreMoviesConnectionWhere + "Return Genres where none of the related GenreMoviesConnections match this filter" + moviesConnection_NONE: GenreMoviesConnectionWhere + "Return Genres where one of the related GenreMoviesConnections match this filter" + moviesConnection_SINGLE: GenreMoviesConnectionWhere + "Return Genres where some of the related GenreMoviesConnections match this filter" + moviesConnection_SOME: GenreMoviesConnectionWhere + "Return Genres where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Genres where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Genres where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Genres where some of the related Movies match this filter" + movies_SOME: MovieWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieGenreConnectionSort { + node: GenreSort +} + +input MovieGenreConnectionWhere { + AND: [MovieGenreConnectionWhere!] + NOT: MovieGenreConnectionWhere + OR: [MovieGenreConnectionWhere!] + node: GenreWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + name: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + genre: GenreWhere + genreConnection: MovieGenreConnectionWhere + genreConnection_NOT: MovieGenreConnectionWhere + genre_NOT: GenreWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +---- + +''' + +== No nested operations in one type + +.Schema +[source,graphql,schema=true] +---- +type Movie { + name: String! + genre: Genre! @relationship(type: "HAS_GENRE", direction: OUT, nestedOperations: []) +} + +type Genre { + name: String! + movies: [Movie!]! @relationship(type: "HAS_GENRE", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Genre { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [GenreMoviesConnectionSort!], where: GenreMoviesConnectionWhere): GenreMoviesConnection! + name: String! +} + +type GenreEdge { + cursor: String! + node: Genre! +} + +type GenreMoviesConnection { + edges: [GenreMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type GenreMoviesRelationship { + cursor: String! + node: Movie! +} + +type GenresConnection { + edges: [GenreEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + genre(directed: Boolean = true, options: GenreOptions, where: GenreWhere): Genre! + genreConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieGenreConnectionSort!], where: MovieGenreConnectionWhere): MovieGenreConnection! + name: String! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieGenreConnection { + edges: [MovieGenreRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieGenreRelationship { + cursor: String! + node: Genre! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + genres(options: GenreOptions, where: GenreWhere): [Genre!]! + genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input GenreMoviesConnectionSort { + node: MovieSort +} + +input GenreMoviesConnectionWhere { + AND: [GenreMoviesConnectionWhere!] + NOT: GenreMoviesConnectionWhere + OR: [GenreMoviesConnectionWhere!] + node: MovieWhere +} + +input GenreOptions { + limit: Int + offset: Int + "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." + sort: [GenreSort!] +} + +"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." +input GenreSort { + name: SortDirection +} + +input GenreWhere { + AND: [GenreWhere!] + NOT: GenreWhere + OR: [GenreWhere!] + "Return Genres where all of the related GenreMoviesConnections match this filter" + moviesConnection_ALL: GenreMoviesConnectionWhere + "Return Genres where none of the related GenreMoviesConnections match this filter" + moviesConnection_NONE: GenreMoviesConnectionWhere + "Return Genres where one of the related GenreMoviesConnections match this filter" + moviesConnection_SINGLE: GenreMoviesConnectionWhere + "Return Genres where some of the related GenreMoviesConnections match this filter" + moviesConnection_SOME: GenreMoviesConnectionWhere + "Return Genres where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Genres where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Genres where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Genres where some of the related Movies match this filter" + movies_SOME: MovieWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieGenreConnectionSort { + node: GenreSort +} + +input MovieGenreConnectionWhere { + AND: [MovieGenreConnectionWhere!] + NOT: MovieGenreConnectionWhere + OR: [MovieGenreConnectionWhere!] + node: GenreWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + name: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + genre: GenreWhere + genreConnection: MovieGenreConnectionWhere + genreConnection_NOT: MovieGenreConnectionWhere + genre_NOT: GenreWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/3816/combination-of-nested-operations-in-reported-issue.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/3816/combination-of-nested-operations-in-reported-issue.adoc deleted file mode 100644 index 0c15e9d4..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/3816/combination-of-nested-operations-in-reported-issue.adoc +++ /dev/null @@ -1,198 +0,0 @@ -:toc: - -= https://github.com/neo4j/graphql/issues/3816 -> Combination of nested operations in reported issue - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - name: String! - genre: Genre! @relationship(type: "HAS_GENRE", direction: OUT, nestedOperations: [CONNECT, DISCONNECT]) -} - -type Genre { - name: String! - movies: [Movie!]! @relationship(type: "HAS_GENRE", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Genre { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [GenreMoviesConnectionSort!], where: GenreMoviesConnectionWhere): GenreMoviesConnection! - name: String! -} - -type GenreEdge { - cursor: String! - node: Genre! -} - -type GenreMoviesConnection { - edges: [GenreMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type GenreMoviesRelationship { - cursor: String! - node: Movie! -} - -type GenresConnection { - edges: [GenreEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - genre(directed: Boolean = true, options: GenreOptions, where: GenreWhere): Genre! - genreConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieGenreConnectionSort!], where: MovieGenreConnectionWhere): MovieGenreConnection! - name: String! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieGenreConnection { - edges: [MovieGenreRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieGenreRelationship { - cursor: String! - node: Genre! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - genres(options: GenreOptions, where: GenreWhere): [Genre!]! - genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input GenreMoviesConnectionSort { - node: MovieSort -} - -input GenreMoviesConnectionWhere { - AND: [GenreMoviesConnectionWhere!] - NOT: GenreMoviesConnectionWhere - OR: [GenreMoviesConnectionWhere!] - node: MovieWhere -} - -input GenreOptions { - limit: Int - offset: Int - "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." - sort: [GenreSort!] -} - -"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." -input GenreSort { - name: SortDirection -} - -input GenreWhere { - AND: [GenreWhere!] - NOT: GenreWhere - OR: [GenreWhere!] - "Return Genres where all of the related GenreMoviesConnections match this filter" - moviesConnection_ALL: GenreMoviesConnectionWhere - "Return Genres where none of the related GenreMoviesConnections match this filter" - moviesConnection_NONE: GenreMoviesConnectionWhere - "Return Genres where one of the related GenreMoviesConnections match this filter" - moviesConnection_SINGLE: GenreMoviesConnectionWhere - "Return Genres where some of the related GenreMoviesConnections match this filter" - moviesConnection_SOME: GenreMoviesConnectionWhere - "Return Genres where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Genres where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Genres where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Genres where some of the related Movies match this filter" - movies_SOME: MovieWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieGenreConnectionSort { - node: GenreSort -} - -input MovieGenreConnectionWhere { - AND: [MovieGenreConnectionWhere!] - NOT: MovieGenreConnectionWhere - OR: [MovieGenreConnectionWhere!] - node: GenreWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - name: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - genre: GenreWhere - genreConnection: MovieGenreConnectionWhere - genreConnection_NOT: MovieGenreConnectionWhere - genre_NOT: GenreWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/3816/no-nested-operations-in-one-type.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/3816/no-nested-operations-in-one-type.adoc deleted file mode 100644 index 1d147f81..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/3816/no-nested-operations-in-one-type.adoc +++ /dev/null @@ -1,198 +0,0 @@ -:toc: - -= https://github.com/neo4j/graphql/issues/3816 -> No nested operations in one type - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - name: String! - genre: Genre! @relationship(type: "HAS_GENRE", direction: OUT, nestedOperations: []) -} - -type Genre { - name: String! - movies: [Movie!]! @relationship(type: "HAS_GENRE", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Genre { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [GenreMoviesConnectionSort!], where: GenreMoviesConnectionWhere): GenreMoviesConnection! - name: String! -} - -type GenreEdge { - cursor: String! - node: Genre! -} - -type GenreMoviesConnection { - edges: [GenreMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type GenreMoviesRelationship { - cursor: String! - node: Movie! -} - -type GenresConnection { - edges: [GenreEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - genre(directed: Boolean = true, options: GenreOptions, where: GenreWhere): Genre! - genreConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieGenreConnectionSort!], where: MovieGenreConnectionWhere): MovieGenreConnection! - name: String! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieGenreConnection { - edges: [MovieGenreRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieGenreRelationship { - cursor: String! - node: Genre! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - genres(options: GenreOptions, where: GenreWhere): [Genre!]! - genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input GenreMoviesConnectionSort { - node: MovieSort -} - -input GenreMoviesConnectionWhere { - AND: [GenreMoviesConnectionWhere!] - NOT: GenreMoviesConnectionWhere - OR: [GenreMoviesConnectionWhere!] - node: MovieWhere -} - -input GenreOptions { - limit: Int - offset: Int - "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." - sort: [GenreSort!] -} - -"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." -input GenreSort { - name: SortDirection -} - -input GenreWhere { - AND: [GenreWhere!] - NOT: GenreWhere - OR: [GenreWhere!] - "Return Genres where all of the related GenreMoviesConnections match this filter" - moviesConnection_ALL: GenreMoviesConnectionWhere - "Return Genres where none of the related GenreMoviesConnections match this filter" - moviesConnection_NONE: GenreMoviesConnectionWhere - "Return Genres where one of the related GenreMoviesConnections match this filter" - moviesConnection_SINGLE: GenreMoviesConnectionWhere - "Return Genres where some of the related GenreMoviesConnections match this filter" - moviesConnection_SOME: GenreMoviesConnectionWhere - "Return Genres where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Genres where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Genres where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Genres where some of the related Movies match this filter" - movies_SOME: MovieWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieGenreConnectionSort { - node: GenreSort -} - -input MovieGenreConnectionWhere { - AND: [MovieGenreConnectionWhere!] - NOT: MovieGenreConnectionWhere - OR: [MovieGenreConnectionWhere!] - node: GenreWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - name: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - genre: GenreWhere - genreConnection: MovieGenreConnectionWhere - genreConnection_NOT: MovieGenreConnectionWhere - genre_NOT: GenreWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/5428.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/5428.adoc index 9c1c6364..fb512852 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/5428.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/5428.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= https://github.com/neo4j/graphql/issues/5428 -> Non plural value in should not be pluralized += https://github.com/neo4j/graphql/issues/5428 -== Source schema +== Non plural value in should not be pluralized +.Schema [source,graphql,schema=true] ---- type Test @plural(value: "Test") { @@ -11,8 +13,6 @@ type Test @plural(value: "Test") { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -82,3 +82,4 @@ input TestWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/issues/609.adoc b/core/src/test/resources/tck-test-files/schema/v2/issues/609.adoc index 54cec79a..589d2a2f 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/issues/609.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/issues/609.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= 609 -> @deprecated directive should remain in output += 609 -== Source schema +== @deprecated directive should remain in output +.Schema [source,graphql,schema=true] ---- type Deprecated { @@ -11,8 +13,6 @@ type Deprecated { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -82,3 +82,4 @@ input DeprecatedWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/lowercase-type-names.adoc b/core/src/test/resources/tck-test-files/schema/v2/lowercase-type-names.adoc index 94d88af3..0638647b 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/lowercase-type-names.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/lowercase-type-names.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= lower case type names -> should generate a valid schema += lower case type names -== Source schema +== should generate a valid schema +.Schema [source,graphql,schema=true] ---- type movie { @@ -22,8 +24,6 @@ type actor { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -255,3 +255,4 @@ input movieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/math.adoc b/core/src/test/resources/tck-test-files/schema/v2/math.adoc new file mode 100644 index 00000000..6b011272 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/math.adoc @@ -0,0 +1,989 @@ +:toc: +:toclevels: 42 + += Algebraic + +== Int fields should be extended with Increment/Decrement operators + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + viewers: Int! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + id: ID + viewers: Int! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: Int + viewers_GT: Int + viewers_GTE: Int + viewers_IN: [Int!] + viewers_LT: Int + viewers_LTE: Int +} + +---- + +''' + +== BigInt fields should be extended with Increment/Decrement operators + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + viewers: BigInt! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + id: ID + viewers: BigInt! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +"A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string." +scalar BigInt + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: BigInt + viewers_GT: BigInt + viewers_GTE: BigInt + viewers_IN: [BigInt!] + viewers_LT: BigInt + viewers_LTE: BigInt +} + +---- + +''' + +== Float fields should be extended with Add/Subtract/Multiply/Divide operators + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + viewers: Float! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + id: ID + viewers: Float! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: Float + viewers_GT: Float + viewers_GTE: Float + viewers_IN: [Float!] + viewers_LT: Float + viewers_LTE: Float +} + +---- + +''' + +== Operators should be presents in nested updates + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + viewers: Int! + directedBy: Director @relationship(type: "DIRECTS", direction: IN) +} + +type Director { + lastName: String! + directs: [Movie!]! @relationship(type: "DIRECTS", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Director { + directs(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + directsConnection(after: String, directed: Boolean = true, first: Int, sort: [DirectorDirectsConnectionSort!], where: DirectorDirectsConnectionWhere): DirectorDirectsConnection! + lastName: String! +} + +type DirectorDirectsConnection { + edges: [DirectorDirectsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type DirectorDirectsRelationship { + cursor: String! + node: Movie! +} + +type DirectorEdge { + cursor: String! + node: Director! +} + +type DirectorsConnection { + edges: [DirectorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + directedBy(directed: Boolean = true, options: DirectorOptions, where: DirectorWhere): Director + directedByConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieDirectedByConnectionSort!], where: MovieDirectedByConnectionWhere): MovieDirectedByConnection! + id: ID + viewers: Int! +} + +type MovieDirectedByConnection { + edges: [MovieDirectedByRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieDirectedByRelationship { + cursor: String! + node: Director! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + directors(options: DirectorOptions, where: DirectorWhere): [Director!]! + directorsConnection(after: String, first: Int, sort: [DirectorSort], where: DirectorWhere): DirectorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input DirectorDirectsConnectionSort { + node: MovieSort +} + +input DirectorDirectsConnectionWhere { + AND: [DirectorDirectsConnectionWhere!] + NOT: DirectorDirectsConnectionWhere + OR: [DirectorDirectsConnectionWhere!] + node: MovieWhere +} + +input DirectorOptions { + limit: Int + offset: Int + "Specify one or more DirectorSort objects to sort Directors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [DirectorSort!] +} + +"Fields to sort Directors by. The order in which sorts are applied is not guaranteed when specifying many fields in one DirectorSort object." +input DirectorSort { + lastName: SortDirection +} + +input DirectorWhere { + AND: [DirectorWhere!] + NOT: DirectorWhere + OR: [DirectorWhere!] + "Return Directors where all of the related DirectorDirectsConnections match this filter" + directsConnection_ALL: DirectorDirectsConnectionWhere + "Return Directors where none of the related DirectorDirectsConnections match this filter" + directsConnection_NONE: DirectorDirectsConnectionWhere + "Return Directors where one of the related DirectorDirectsConnections match this filter" + directsConnection_SINGLE: DirectorDirectsConnectionWhere + "Return Directors where some of the related DirectorDirectsConnections match this filter" + directsConnection_SOME: DirectorDirectsConnectionWhere + "Return Directors where all of the related Movies match this filter" + directs_ALL: MovieWhere + "Return Directors where none of the related Movies match this filter" + directs_NONE: MovieWhere + "Return Directors where one of the related Movies match this filter" + directs_SINGLE: MovieWhere + "Return Directors where some of the related Movies match this filter" + directs_SOME: MovieWhere + lastName: String + lastName_CONTAINS: String + lastName_ENDS_WITH: String + lastName_IN: [String!] + lastName_STARTS_WITH: String +} + +input MovieDirectedByConnectionSort { + node: DirectorSort +} + +input MovieDirectedByConnectionWhere { + AND: [MovieDirectedByConnectionWhere!] + NOT: MovieDirectedByConnectionWhere + OR: [MovieDirectedByConnectionWhere!] + node: DirectorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + directedBy: DirectorWhere + directedByConnection: MovieDirectedByConnectionWhere + directedByConnection_NOT: MovieDirectedByConnectionWhere + directedBy_NOT: DirectorWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: Int + viewers_GT: Int + viewers_GTE: Int + viewers_IN: [Int!] + viewers_LT: Int + viewers_LTE: Int +} + +---- + +''' + +== Should be supported in interfaces + +.Schema +[source,graphql,schema=true] +---- +interface Production { + viewers: Int! +} + +type Movie implements Production { + id: ID + viewers: Int! + workers: [Person!]! @relationship(type: "WORKED_IN", direction: IN) +} + +type Person { + name: String! + worksInProduction: [Production!]! @relationship(type: "WORKED_IN", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + viewers: Int! +} + +type Movie implements Production { + id: ID + viewers: Int! + workers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + workersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieWorkersConnectionSort!], where: MovieWorkersConnectionWhere): MovieWorkersConnection! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieWorkersConnection { + edges: [MovieWorkersRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieWorkersRelationship { + cursor: String! + node: Person! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + name: String! + worksInProduction(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + worksInProductionConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonWorksInProductionConnectionSort!], where: PersonWorksInProductionConnectionWhere): PersonWorksInProductionConnection! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonWorksInProductionConnection { + edges: [PersonWorksInProductionRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonWorksInProductionRelationship { + cursor: String! + node: Production! +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! +} + +enum ProductionImplementation { + Movie +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection + viewers: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + viewers: Int + viewers_GT: Int + viewers_GTE: Int + viewers_IN: [Int!] + viewers_LT: Int + viewers_LTE: Int + "Return Movies where all of the related MovieWorkersConnections match this filter" + workersConnection_ALL: MovieWorkersConnectionWhere + "Return Movies where none of the related MovieWorkersConnections match this filter" + workersConnection_NONE: MovieWorkersConnectionWhere + "Return Movies where one of the related MovieWorkersConnections match this filter" + workersConnection_SINGLE: MovieWorkersConnectionWhere + "Return Movies where some of the related MovieWorkersConnections match this filter" + workersConnection_SOME: MovieWorkersConnectionWhere + "Return Movies where all of the related People match this filter" + workers_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + workers_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + workers_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + workers_SOME: PersonWhere +} + +input MovieWorkersConnectionSort { + node: PersonSort +} + +input MovieWorkersConnectionWhere { + AND: [MovieWorkersConnectionWhere!] + NOT: MovieWorkersConnectionWhere + OR: [MovieWorkersConnectionWhere!] + node: PersonWhere +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String + "Return People where all of the related PersonWorksInProductionConnections match this filter" + worksInProductionConnection_ALL: PersonWorksInProductionConnectionWhere + "Return People where none of the related PersonWorksInProductionConnections match this filter" + worksInProductionConnection_NONE: PersonWorksInProductionConnectionWhere + "Return People where one of the related PersonWorksInProductionConnections match this filter" + worksInProductionConnection_SINGLE: PersonWorksInProductionConnectionWhere + "Return People where some of the related PersonWorksInProductionConnections match this filter" + worksInProductionConnection_SOME: PersonWorksInProductionConnectionWhere + "Return People where all of the related Productions match this filter" + worksInProduction_ALL: ProductionWhere + "Return People where none of the related Productions match this filter" + worksInProduction_NONE: ProductionWhere + "Return People where one of the related Productions match this filter" + worksInProduction_SINGLE: ProductionWhere + "Return People where some of the related Productions match this filter" + worksInProduction_SOME: ProductionWhere +} + +input PersonWorksInProductionConnectionSort { + node: ProductionSort +} + +input PersonWorksInProductionConnectionWhere { + AND: [PersonWorksInProductionConnectionWhere!] + NOT: PersonWorksInProductionConnectionWhere + OR: [PersonWorksInProductionConnectionWhere!] + node: ProductionWhere +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + viewers: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + typename_IN: [ProductionImplementation!] + viewers: Int + viewers_GT: Int + viewers_GTE: Int + viewers_IN: [Int!] + viewers_LT: Int + viewers_LTE: Int +} + +---- + +''' + +== Should be supported in Relationship properties + +.Schema +[source,graphql,schema=true] +---- +type Person { + name: String! + actedInMovies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) +} + +type Movie { + title: String! + actors: [Person!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) +} + +type ActedIn @relationshipProperties { + roles: [String!] + pay: Float +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +""" +The edge properties for the following fields: +* Person.actedInMovies +* Movie.actors +""" +type ActedIn { + pay: Float + roles: [String!] +} + +type Movie { + actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + title: String! +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Person! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + actedInMovies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + actedInMoviesConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonActedInMoviesConnectionSort!], where: PersonActedInMoviesConnectionWhere): PersonActedInMoviesConnection! + name: String! +} + +type PersonActedInMoviesConnection { + edges: [PersonActedInMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonActedInMoviesRelationship { + cursor: String! + node: Movie! + properties: ActedIn! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + pay: SortDirection + roles: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + pay: Float + pay_GT: Float + pay_GTE: Float + pay_IN: [Float] + pay_LT: Float + pay_LTE: Float + roles: [String!] + roles_INCLUDES: String +} + +input MovieActorsConnectionSort { + edge: ActedInSort + node: PersonSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + edge: ActedInWhere + node: PersonWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related People match this filter" + actors_ALL: PersonWhere + "Return Movies where none of the related People match this filter" + actors_NONE: PersonWhere + "Return Movies where one of the related People match this filter" + actors_SINGLE: PersonWhere + "Return Movies where some of the related People match this filter" + actors_SOME: PersonWhere + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input PersonActedInMoviesConnectionSort { + edge: ActedInSort + node: MovieSort +} + +input PersonActedInMoviesConnectionWhere { + AND: [PersonActedInMoviesConnectionWhere!] + NOT: PersonActedInMoviesConnectionWhere + OR: [PersonActedInMoviesConnectionWhere!] + edge: ActedInWhere + node: MovieWhere +} + +input PersonOptions { + limit: Int + offset: Int + "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." + sort: [PersonSort!] +} + +"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." +input PersonSort { + name: SortDirection +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + "Return People where all of the related PersonActedInMoviesConnections match this filter" + actedInMoviesConnection_ALL: PersonActedInMoviesConnectionWhere + "Return People where none of the related PersonActedInMoviesConnections match this filter" + actedInMoviesConnection_NONE: PersonActedInMoviesConnectionWhere + "Return People where one of the related PersonActedInMoviesConnections match this filter" + actedInMoviesConnection_SINGLE: PersonActedInMoviesConnectionWhere + "Return People where some of the related PersonActedInMoviesConnections match this filter" + actedInMoviesConnection_SOME: PersonActedInMoviesConnectionWhere + "Return People where all of the related Movies match this filter" + actedInMovies_ALL: MovieWhere + "Return People where none of the related Movies match this filter" + actedInMovies_NONE: MovieWhere + "Return People where one of the related Movies match this filter" + actedInMovies_SINGLE: MovieWhere + "Return People where some of the related Movies match this filter" + actedInMovies_SOME: MovieWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/math/bigint-fields-should-be-extended-with-increment/decrement-operators.adoc b/core/src/test/resources/tck-test-files/schema/v2/math/bigint-fields-should-be-extended-with-increment/decrement-operators.adoc deleted file mode 100644 index 067b31cb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/math/bigint-fields-should-be-extended-with-increment/decrement-operators.adoc +++ /dev/null @@ -1,96 +0,0 @@ -:toc: - -= Algebraic -> BigInt fields should be extended with Increment/Decrement operators - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - viewers: BigInt! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - id: ID - viewers: BigInt! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -"A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string." -scalar BigInt - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: BigInt - viewers_GT: BigInt - viewers_GTE: BigInt - viewers_IN: [BigInt!] - viewers_LT: BigInt - viewers_LTE: BigInt -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/math/float-fields-should-be-extended-with-add/subtract/multiply/divide-operators.adoc b/core/src/test/resources/tck-test-files/schema/v2/math/float-fields-should-be-extended-with-add/subtract/multiply/divide-operators.adoc deleted file mode 100644 index 03b3dbe8..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/math/float-fields-should-be-extended-with-add/subtract/multiply/divide-operators.adoc +++ /dev/null @@ -1,93 +0,0 @@ -:toc: - -= Algebraic -> Float fields should be extended with Add/Subtract/Multiply/Divide operators - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - viewers: Float! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - id: ID - viewers: Float! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: Float - viewers_GT: Float - viewers_GTE: Float - viewers_IN: [Float!] - viewers_LT: Float - viewers_LTE: Float -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/math/int-fields-should-be-extended-with-increment/decrement-operators.adoc b/core/src/test/resources/tck-test-files/schema/v2/math/int-fields-should-be-extended-with-increment/decrement-operators.adoc deleted file mode 100644 index 34385306..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/math/int-fields-should-be-extended-with-increment/decrement-operators.adoc +++ /dev/null @@ -1,93 +0,0 @@ -:toc: - -= Algebraic -> Int fields should be extended with Increment/Decrement operators - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - viewers: Int! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - id: ID - viewers: Int! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: Int - viewers_GT: Int - viewers_GTE: Int - viewers_IN: [Int!] - viewers_LT: Int - viewers_LTE: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/math/operators-should-be-presents-in-nested-updates.adoc b/core/src/test/resources/tck-test-files/schema/v2/math/operators-should-be-presents-in-nested-updates.adoc deleted file mode 100644 index 0a46aaa5..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/math/operators-should-be-presents-in-nested-updates.adoc +++ /dev/null @@ -1,207 +0,0 @@ -:toc: - -= Algebraic -> Operators should be presents in nested updates - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - viewers: Int! - directedBy: Director @relationship(type: "DIRECTS", direction: IN) -} - -type Director { - lastName: String! - directs: [Movie!]! @relationship(type: "DIRECTS", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Director { - directs(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - directsConnection(after: String, directed: Boolean = true, first: Int, sort: [DirectorDirectsConnectionSort!], where: DirectorDirectsConnectionWhere): DirectorDirectsConnection! - lastName: String! -} - -type DirectorDirectsConnection { - edges: [DirectorDirectsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type DirectorDirectsRelationship { - cursor: String! - node: Movie! -} - -type DirectorEdge { - cursor: String! - node: Director! -} - -type DirectorsConnection { - edges: [DirectorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - directedBy(directed: Boolean = true, options: DirectorOptions, where: DirectorWhere): Director - directedByConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieDirectedByConnectionSort!], where: MovieDirectedByConnectionWhere): MovieDirectedByConnection! - id: ID - viewers: Int! -} - -type MovieDirectedByConnection { - edges: [MovieDirectedByRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieDirectedByRelationship { - cursor: String! - node: Director! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - directors(options: DirectorOptions, where: DirectorWhere): [Director!]! - directorsConnection(after: String, first: Int, sort: [DirectorSort], where: DirectorWhere): DirectorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input DirectorDirectsConnectionSort { - node: MovieSort -} - -input DirectorDirectsConnectionWhere { - AND: [DirectorDirectsConnectionWhere!] - NOT: DirectorDirectsConnectionWhere - OR: [DirectorDirectsConnectionWhere!] - node: MovieWhere -} - -input DirectorOptions { - limit: Int - offset: Int - "Specify one or more DirectorSort objects to sort Directors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [DirectorSort!] -} - -"Fields to sort Directors by. The order in which sorts are applied is not guaranteed when specifying many fields in one DirectorSort object." -input DirectorSort { - lastName: SortDirection -} - -input DirectorWhere { - AND: [DirectorWhere!] - NOT: DirectorWhere - OR: [DirectorWhere!] - "Return Directors where all of the related DirectorDirectsConnections match this filter" - directsConnection_ALL: DirectorDirectsConnectionWhere - "Return Directors where none of the related DirectorDirectsConnections match this filter" - directsConnection_NONE: DirectorDirectsConnectionWhere - "Return Directors where one of the related DirectorDirectsConnections match this filter" - directsConnection_SINGLE: DirectorDirectsConnectionWhere - "Return Directors where some of the related DirectorDirectsConnections match this filter" - directsConnection_SOME: DirectorDirectsConnectionWhere - "Return Directors where all of the related Movies match this filter" - directs_ALL: MovieWhere - "Return Directors where none of the related Movies match this filter" - directs_NONE: MovieWhere - "Return Directors where one of the related Movies match this filter" - directs_SINGLE: MovieWhere - "Return Directors where some of the related Movies match this filter" - directs_SOME: MovieWhere - lastName: String - lastName_CONTAINS: String - lastName_ENDS_WITH: String - lastName_IN: [String!] - lastName_STARTS_WITH: String -} - -input MovieDirectedByConnectionSort { - node: DirectorSort -} - -input MovieDirectedByConnectionWhere { - AND: [MovieDirectedByConnectionWhere!] - NOT: MovieDirectedByConnectionWhere - OR: [MovieDirectedByConnectionWhere!] - node: DirectorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - directedBy: DirectorWhere - directedByConnection: MovieDirectedByConnectionWhere - directedByConnection_NOT: MovieDirectedByConnectionWhere - directedBy_NOT: DirectorWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: Int - viewers_GT: Int - viewers_GTE: Int - viewers_IN: [Int!] - viewers_LT: Int - viewers_LTE: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/math/should-be-supported-in-interfaces.adoc b/core/src/test/resources/tck-test-files/schema/v2/math/should-be-supported-in-interfaces.adoc deleted file mode 100644 index 8e511ed5..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/math/should-be-supported-in-interfaces.adoc +++ /dev/null @@ -1,269 +0,0 @@ -:toc: - -= Algebraic -> Should be supported in interfaces - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - viewers: Int! -} - -type Movie implements Production { - id: ID - viewers: Int! - workers: [Person!]! @relationship(type: "WORKED_IN", direction: IN) -} - -type Person { - name: String! - worksInProduction: [Production!]! @relationship(type: "WORKED_IN", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - viewers: Int! -} - -type Movie implements Production { - id: ID - viewers: Int! - workers(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - workersConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieWorkersConnectionSort!], where: MovieWorkersConnectionWhere): MovieWorkersConnection! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieWorkersConnection { - edges: [MovieWorkersRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieWorkersRelationship { - cursor: String! - node: Person! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - name: String! - worksInProduction(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - worksInProductionConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonWorksInProductionConnectionSort!], where: PersonWorksInProductionConnectionWhere): PersonWorksInProductionConnection! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonWorksInProductionConnection { - edges: [PersonWorksInProductionRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonWorksInProductionRelationship { - cursor: String! - node: Production! -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! -} - -enum ProductionImplementation { - Movie -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection - viewers: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - viewers: Int - viewers_GT: Int - viewers_GTE: Int - viewers_IN: [Int!] - viewers_LT: Int - viewers_LTE: Int - "Return Movies where all of the related MovieWorkersConnections match this filter" - workersConnection_ALL: MovieWorkersConnectionWhere - "Return Movies where none of the related MovieWorkersConnections match this filter" - workersConnection_NONE: MovieWorkersConnectionWhere - "Return Movies where one of the related MovieWorkersConnections match this filter" - workersConnection_SINGLE: MovieWorkersConnectionWhere - "Return Movies where some of the related MovieWorkersConnections match this filter" - workersConnection_SOME: MovieWorkersConnectionWhere - "Return Movies where all of the related People match this filter" - workers_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - workers_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - workers_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - workers_SOME: PersonWhere -} - -input MovieWorkersConnectionSort { - node: PersonSort -} - -input MovieWorkersConnectionWhere { - AND: [MovieWorkersConnectionWhere!] - NOT: MovieWorkersConnectionWhere - OR: [MovieWorkersConnectionWhere!] - node: PersonWhere -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String - "Return People where all of the related PersonWorksInProductionConnections match this filter" - worksInProductionConnection_ALL: PersonWorksInProductionConnectionWhere - "Return People where none of the related PersonWorksInProductionConnections match this filter" - worksInProductionConnection_NONE: PersonWorksInProductionConnectionWhere - "Return People where one of the related PersonWorksInProductionConnections match this filter" - worksInProductionConnection_SINGLE: PersonWorksInProductionConnectionWhere - "Return People where some of the related PersonWorksInProductionConnections match this filter" - worksInProductionConnection_SOME: PersonWorksInProductionConnectionWhere - "Return People where all of the related Productions match this filter" - worksInProduction_ALL: ProductionWhere - "Return People where none of the related Productions match this filter" - worksInProduction_NONE: ProductionWhere - "Return People where one of the related Productions match this filter" - worksInProduction_SINGLE: ProductionWhere - "Return People where some of the related Productions match this filter" - worksInProduction_SOME: ProductionWhere -} - -input PersonWorksInProductionConnectionSort { - node: ProductionSort -} - -input PersonWorksInProductionConnectionWhere { - AND: [PersonWorksInProductionConnectionWhere!] - NOT: PersonWorksInProductionConnectionWhere - OR: [PersonWorksInProductionConnectionWhere!] - node: ProductionWhere -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - viewers: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - typename_IN: [ProductionImplementation!] - viewers: Int - viewers_GT: Int - viewers_GTE: Int - viewers_IN: [Int!] - viewers_LT: Int - viewers_LTE: Int -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/math/should-be-supported-in-relationship-properties.adoc b/core/src/test/resources/tck-test-files/schema/v2/math/should-be-supported-in-relationship-properties.adoc deleted file mode 100644 index 4ca2543b..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/math/should-be-supported-in-relationship-properties.adoc +++ /dev/null @@ -1,250 +0,0 @@ -:toc: - -= Algebraic -> Should be supported in Relationship properties - -== Source schema - -[source,graphql,schema=true] ----- -type Person { - name: String! - actedInMovies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) -} - -type Movie { - title: String! - actors: [Person!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) -} - -type ActedIn @relationshipProperties { - roles: [String!] - pay: Float -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -""" -The edge properties for the following fields: -* Person.actedInMovies -* Movie.actors -""" -type ActedIn { - pay: Float - roles: [String!] -} - -type Movie { - actors(directed: Boolean = true, options: PersonOptions, where: PersonWhere): [Person!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - title: String! -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Person! - properties: ActedIn! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - actedInMovies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - actedInMoviesConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonActedInMoviesConnectionSort!], where: PersonActedInMoviesConnectionWhere): PersonActedInMoviesConnection! - name: String! -} - -type PersonActedInMoviesConnection { - edges: [PersonActedInMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonActedInMoviesRelationship { - cursor: String! - node: Movie! - properties: ActedIn! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, sort: [PersonSort], where: PersonWhere): PeopleConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - pay: SortDirection - roles: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - pay: Float - pay_GT: Float - pay_GTE: Float - pay_IN: [Float] - pay_LT: Float - pay_LTE: Float - roles: [String!] - roles_INCLUDES: String -} - -input MovieActorsConnectionSort { - edge: ActedInSort - node: PersonSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - edge: ActedInWhere - node: PersonWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related People match this filter" - actors_ALL: PersonWhere - "Return Movies where none of the related People match this filter" - actors_NONE: PersonWhere - "Return Movies where one of the related People match this filter" - actors_SINGLE: PersonWhere - "Return Movies where some of the related People match this filter" - actors_SOME: PersonWhere - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input PersonActedInMoviesConnectionSort { - edge: ActedInSort - node: MovieSort -} - -input PersonActedInMoviesConnectionWhere { - AND: [PersonActedInMoviesConnectionWhere!] - NOT: PersonActedInMoviesConnectionWhere - OR: [PersonActedInMoviesConnectionWhere!] - edge: ActedInWhere - node: MovieWhere -} - -input PersonOptions { - limit: Int - offset: Int - "Specify one or more PersonSort objects to sort People by. The sorts will be applied in the order in which they are arranged in the array." - sort: [PersonSort!] -} - -"Fields to sort People by. The order in which sorts are applied is not guaranteed when specifying many fields in one PersonSort object." -input PersonSort { - name: SortDirection -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - "Return People where all of the related PersonActedInMoviesConnections match this filter" - actedInMoviesConnection_ALL: PersonActedInMoviesConnectionWhere - "Return People where none of the related PersonActedInMoviesConnections match this filter" - actedInMoviesConnection_NONE: PersonActedInMoviesConnectionWhere - "Return People where one of the related PersonActedInMoviesConnections match this filter" - actedInMoviesConnection_SINGLE: PersonActedInMoviesConnectionWhere - "Return People where some of the related PersonActedInMoviesConnections match this filter" - actedInMoviesConnection_SOME: PersonActedInMoviesConnectionWhere - "Return People where all of the related Movies match this filter" - actedInMovies_ALL: MovieWhere - "Return People where none of the related Movies match this filter" - actedInMovies_NONE: MovieWhere - "Return People where one of the related Movies match this filter" - actedInMovies_SINGLE: MovieWhere - "Return People where some of the related Movies match this filter" - actedInMovies_SOME: MovieWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/nested-aggregation-on-type.adoc b/core/src/test/resources/tck-test-files/schema/v2/nested-aggregation-on-type.adoc index 0bdedf2d..2163bfae 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/nested-aggregation-on-type.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/nested-aggregation-on-type.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= nested aggregation on interface -> should generate the correct schema += nested aggregation on interface -== Source schema +== should generate the correct schema +.Schema [source,graphql,schema=true] ---- type Movie { @@ -22,8 +24,6 @@ type Actor { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -216,3 +216,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/null.adoc b/core/src/test/resources/tck-test-files/schema/v2/null.adoc index aed2b6d8..01c8a577 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/null.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/null.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Null -> Simple += Null -== Source schema +== Simple +.Schema [source,graphql,schema=true] ---- type Movie { @@ -23,8 +25,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -211,3 +211,4 @@ input PointInput { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/pluralize-consistency.adoc b/core/src/test/resources/tck-test-files/schema/v2/pluralize-consistency.adoc index af8fe89e..a638645f 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/pluralize-consistency.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/pluralize-consistency.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Pluralize consistency -> Schema with underscore types += Pluralize consistency -== Source schema +== Schema with underscore types +.Schema [source,graphql,schema=true] ---- type super_user { @@ -16,8 +18,6 @@ type super_friend { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -167,3 +167,4 @@ input super_userWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/query-direction.adoc b/core/src/test/resources/tck-test-files/schema/v2/query-direction.adoc new file mode 100644 index 00000000..c7d36117 --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/query-direction.adoc @@ -0,0 +1,368 @@ +:toc: +:toclevels: 42 + += Query Direction + +== DEFAULT_UNDIRECTED + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DEFAULT_UNDIRECTED) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +type User { + friends(directed: Boolean = false, options: UserOptions, where: UserWhere): [User!]! + friendsConnection(after: String, directed: Boolean = false, first: Int, sort: [UserFriendsConnectionSort!], where: UserFriendsConnectionWhere): UserFriendsConnection! + name: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserFriendsConnection { + edges: [UserFriendsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type UserFriendsRelationship { + cursor: String! + node: User! +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input UserFriendsConnectionSort { + node: UserSort +} + +input UserFriendsConnectionWhere { + AND: [UserFriendsConnectionWhere!] + NOT: UserFriendsConnectionWhere + OR: [UserFriendsConnectionWhere!] + node: UserWhere +} + +input UserOptions { + limit: Int + offset: Int + "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserSort!] +} + +"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." +input UserSort { + name: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + "Return Users where all of the related UserFriendsConnections match this filter" + friendsConnection_ALL: UserFriendsConnectionWhere + "Return Users where none of the related UserFriendsConnections match this filter" + friendsConnection_NONE: UserFriendsConnectionWhere + "Return Users where one of the related UserFriendsConnections match this filter" + friendsConnection_SINGLE: UserFriendsConnectionWhere + "Return Users where some of the related UserFriendsConnections match this filter" + friendsConnection_SOME: UserFriendsConnectionWhere + "Return Users where all of the related Users match this filter" + friends_ALL: UserWhere + "Return Users where none of the related Users match this filter" + friends_NONE: UserWhere + "Return Users where one of the related Users match this filter" + friends_SINGLE: UserWhere + "Return Users where some of the related Users match this filter" + friends_SOME: UserWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +---- + +''' + +== DIRECTED_ONLY + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DIRECTED_ONLY) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +type User { + friends(options: UserOptions, where: UserWhere): [User!]! + friendsConnection(after: String, first: Int, sort: [UserFriendsConnectionSort!], where: UserFriendsConnectionWhere): UserFriendsConnection! + name: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserFriendsConnection { + edges: [UserFriendsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type UserFriendsRelationship { + cursor: String! + node: User! +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input UserFriendsConnectionSort { + node: UserSort +} + +input UserFriendsConnectionWhere { + AND: [UserFriendsConnectionWhere!] + NOT: UserFriendsConnectionWhere + OR: [UserFriendsConnectionWhere!] + node: UserWhere +} + +input UserOptions { + limit: Int + offset: Int + "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserSort!] +} + +"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." +input UserSort { + name: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + "Return Users where all of the related UserFriendsConnections match this filter" + friendsConnection_ALL: UserFriendsConnectionWhere + "Return Users where none of the related UserFriendsConnections match this filter" + friendsConnection_NONE: UserFriendsConnectionWhere + "Return Users where one of the related UserFriendsConnections match this filter" + friendsConnection_SINGLE: UserFriendsConnectionWhere + "Return Users where some of the related UserFriendsConnections match this filter" + friendsConnection_SOME: UserFriendsConnectionWhere + "Return Users where all of the related Users match this filter" + friends_ALL: UserWhere + "Return Users where none of the related Users match this filter" + friends_NONE: UserWhere + "Return Users where one of the related Users match this filter" + friends_SINGLE: UserWhere + "Return Users where some of the related Users match this filter" + friends_SOME: UserWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +---- + +''' + +== UNDIRECTED_ONLY + +.Schema +[source,graphql,schema=true] +---- +type User { + name: String! + friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: UNDIRECTED_ONLY) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + users(options: UserOptions, where: UserWhere): [User!]! + usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! +} + +type User { + friends(options: UserOptions, where: UserWhere): [User!]! + friendsConnection(after: String, first: Int, sort: [UserFriendsConnectionSort!], where: UserFriendsConnectionWhere): UserFriendsConnection! + name: String! +} + +type UserEdge { + cursor: String! + node: User! +} + +type UserFriendsConnection { + edges: [UserFriendsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type UserFriendsRelationship { + cursor: String! + node: User! +} + +type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input UserFriendsConnectionSort { + node: UserSort +} + +input UserFriendsConnectionWhere { + AND: [UserFriendsConnectionWhere!] + NOT: UserFriendsConnectionWhere + OR: [UserFriendsConnectionWhere!] + node: UserWhere +} + +input UserOptions { + limit: Int + offset: Int + "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." + sort: [UserSort!] +} + +"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." +input UserSort { + name: SortDirection +} + +input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + "Return Users where all of the related UserFriendsConnections match this filter" + friendsConnection_ALL: UserFriendsConnectionWhere + "Return Users where none of the related UserFriendsConnections match this filter" + friendsConnection_NONE: UserFriendsConnectionWhere + "Return Users where one of the related UserFriendsConnections match this filter" + friendsConnection_SINGLE: UserFriendsConnectionWhere + "Return Users where some of the related UserFriendsConnections match this filter" + friendsConnection_SOME: UserFriendsConnectionWhere + "Return Users where all of the related Users match this filter" + friends_ALL: UserWhere + "Return Users where none of the related Users match this filter" + friends_NONE: UserWhere + "Return Users where one of the related Users match this filter" + friends_SINGLE: UserWhere + "Return Users where some of the related Users match this filter" + friends_SOME: UserWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/query-direction/default_undirected.adoc b/core/src/test/resources/tck-test-files/schema/v2/query-direction/default_undirected.adoc deleted file mode 100644 index 6f41fc68..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/query-direction/default_undirected.adoc +++ /dev/null @@ -1,125 +0,0 @@ -:toc: - -= Query Direction -> DEFAULT_UNDIRECTED - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DEFAULT_UNDIRECTED) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - users(options: UserOptions, where: UserWhere): [User!]! - usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! -} - -type User { - friends(directed: Boolean = false, options: UserOptions, where: UserWhere): [User!]! - friendsConnection(after: String, directed: Boolean = false, first: Int, sort: [UserFriendsConnectionSort!], where: UserFriendsConnectionWhere): UserFriendsConnection! - name: String! -} - -type UserEdge { - cursor: String! - node: User! -} - -type UserFriendsConnection { - edges: [UserFriendsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type UserFriendsRelationship { - cursor: String! - node: User! -} - -type UsersConnection { - edges: [UserEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input UserFriendsConnectionSort { - node: UserSort -} - -input UserFriendsConnectionWhere { - AND: [UserFriendsConnectionWhere!] - NOT: UserFriendsConnectionWhere - OR: [UserFriendsConnectionWhere!] - node: UserWhere -} - -input UserOptions { - limit: Int - offset: Int - "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserSort!] -} - -"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." -input UserSort { - name: SortDirection -} - -input UserWhere { - AND: [UserWhere!] - NOT: UserWhere - OR: [UserWhere!] - "Return Users where all of the related UserFriendsConnections match this filter" - friendsConnection_ALL: UserFriendsConnectionWhere - "Return Users where none of the related UserFriendsConnections match this filter" - friendsConnection_NONE: UserFriendsConnectionWhere - "Return Users where one of the related UserFriendsConnections match this filter" - friendsConnection_SINGLE: UserFriendsConnectionWhere - "Return Users where some of the related UserFriendsConnections match this filter" - friendsConnection_SOME: UserFriendsConnectionWhere - "Return Users where all of the related Users match this filter" - friends_ALL: UserWhere - "Return Users where none of the related Users match this filter" - friends_NONE: UserWhere - "Return Users where one of the related Users match this filter" - friends_SINGLE: UserWhere - "Return Users where some of the related Users match this filter" - friends_SOME: UserWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/query-direction/directed_only.adoc b/core/src/test/resources/tck-test-files/schema/v2/query-direction/directed_only.adoc deleted file mode 100644 index d0a3f85b..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/query-direction/directed_only.adoc +++ /dev/null @@ -1,125 +0,0 @@ -:toc: - -= Query Direction -> DIRECTED_ONLY - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: DIRECTED_ONLY) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - users(options: UserOptions, where: UserWhere): [User!]! - usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! -} - -type User { - friends(options: UserOptions, where: UserWhere): [User!]! - friendsConnection(after: String, first: Int, sort: [UserFriendsConnectionSort!], where: UserFriendsConnectionWhere): UserFriendsConnection! - name: String! -} - -type UserEdge { - cursor: String! - node: User! -} - -type UserFriendsConnection { - edges: [UserFriendsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type UserFriendsRelationship { - cursor: String! - node: User! -} - -type UsersConnection { - edges: [UserEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input UserFriendsConnectionSort { - node: UserSort -} - -input UserFriendsConnectionWhere { - AND: [UserFriendsConnectionWhere!] - NOT: UserFriendsConnectionWhere - OR: [UserFriendsConnectionWhere!] - node: UserWhere -} - -input UserOptions { - limit: Int - offset: Int - "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserSort!] -} - -"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." -input UserSort { - name: SortDirection -} - -input UserWhere { - AND: [UserWhere!] - NOT: UserWhere - OR: [UserWhere!] - "Return Users where all of the related UserFriendsConnections match this filter" - friendsConnection_ALL: UserFriendsConnectionWhere - "Return Users where none of the related UserFriendsConnections match this filter" - friendsConnection_NONE: UserFriendsConnectionWhere - "Return Users where one of the related UserFriendsConnections match this filter" - friendsConnection_SINGLE: UserFriendsConnectionWhere - "Return Users where some of the related UserFriendsConnections match this filter" - friendsConnection_SOME: UserFriendsConnectionWhere - "Return Users where all of the related Users match this filter" - friends_ALL: UserWhere - "Return Users where none of the related Users match this filter" - friends_NONE: UserWhere - "Return Users where one of the related Users match this filter" - friends_SINGLE: UserWhere - "Return Users where some of the related Users match this filter" - friends_SOME: UserWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/query-direction/undirected_only.adoc b/core/src/test/resources/tck-test-files/schema/v2/query-direction/undirected_only.adoc deleted file mode 100644 index 5989cb14..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/query-direction/undirected_only.adoc +++ /dev/null @@ -1,125 +0,0 @@ -:toc: - -= Query Direction -> UNDIRECTED_ONLY - -== Source schema - -[source,graphql,schema=true] ----- -type User { - name: String! - friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT, queryDirection: UNDIRECTED_ONLY) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - users(options: UserOptions, where: UserWhere): [User!]! - usersConnection(after: String, first: Int, sort: [UserSort], where: UserWhere): UsersConnection! -} - -type User { - friends(options: UserOptions, where: UserWhere): [User!]! - friendsConnection(after: String, first: Int, sort: [UserFriendsConnectionSort!], where: UserFriendsConnectionWhere): UserFriendsConnection! - name: String! -} - -type UserEdge { - cursor: String! - node: User! -} - -type UserFriendsConnection { - edges: [UserFriendsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type UserFriendsRelationship { - cursor: String! - node: User! -} - -type UsersConnection { - edges: [UserEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input UserFriendsConnectionSort { - node: UserSort -} - -input UserFriendsConnectionWhere { - AND: [UserFriendsConnectionWhere!] - NOT: UserFriendsConnectionWhere - OR: [UserFriendsConnectionWhere!] - node: UserWhere -} - -input UserOptions { - limit: Int - offset: Int - "Specify one or more UserSort objects to sort Users by. The sorts will be applied in the order in which they are arranged in the array." - sort: [UserSort!] -} - -"Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object." -input UserSort { - name: SortDirection -} - -input UserWhere { - AND: [UserWhere!] - NOT: UserWhere - OR: [UserWhere!] - "Return Users where all of the related UserFriendsConnections match this filter" - friendsConnection_ALL: UserFriendsConnectionWhere - "Return Users where none of the related UserFriendsConnections match this filter" - friendsConnection_NONE: UserFriendsConnectionWhere - "Return Users where one of the related UserFriendsConnections match this filter" - friendsConnection_SINGLE: UserFriendsConnectionWhere - "Return Users where some of the related UserFriendsConnections match this filter" - friendsConnection_SOME: UserFriendsConnectionWhere - "Return Users where all of the related Users match this filter" - friends_ALL: UserWhere - "Return Users where none of the related Users match this filter" - friends_NONE: UserWhere - "Return Users where one of the related Users match this filter" - friends_SINGLE: UserWhere - "Return Users where some of the related Users match this filter" - friends_SOME: UserWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations/where-level-aggregations.adoc b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations.adoc similarity index 68% rename from core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations/where-level-aggregations.adoc rename to core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations.adoc index 691c0b42..cebc5e7e 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations/where-level-aggregations.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations.adoc @@ -1,9 +1,197 @@ :toc: +:toclevels: 42 -= Remove deprecated fields for aggregations -> Where Level Aggregations += Remove deprecated fields for aggregations -== Source schema +== Top Level Aggregations +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + isbn: String! + title: String + createdAt: DateTime + someTime: Time + someLocalTime: LocalTime + someLocalDateTime: LocalDateTime + imdbRating: Float + someInt: Int + someBigInt: BigInt + screenTime: Duration +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + createdAt: DateTime + id: ID + imdbRating: Float + isbn: String! + screenTime: Duration + someBigInt: BigInt + someInt: Int + someLocalDateTime: LocalDateTime + someLocalTime: LocalTime + someTime: Time + title: String +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +"A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string." +scalar BigInt + +"A date and time, represented as an ISO-8601 string" +scalar DateTime + +"A duration, represented as an ISO 8601 duration string" +scalar Duration + +"A local datetime, represented as 'YYYY-MM-DDTHH:MM:SS'" +scalar LocalDateTime + +"A local time, represented as a time string without timezone information" +scalar LocalTime + +"A time, represented as an RFC3339 time string" +scalar Time + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + createdAt: SortDirection + id: SortDirection + imdbRating: SortDirection + isbn: SortDirection + screenTime: SortDirection + someBigInt: SortDirection + someInt: SortDirection + someLocalDateTime: SortDirection + someLocalTime: SortDirection + someTime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + createdAt: DateTime + createdAt_GT: DateTime + createdAt_GTE: DateTime + createdAt_IN: [DateTime] + createdAt_LT: DateTime + createdAt_LTE: DateTime + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + imdbRating: Float + imdbRating_GT: Float + imdbRating_GTE: Float + imdbRating_IN: [Float] + imdbRating_LT: Float + imdbRating_LTE: Float + isbn: String + isbn_CONTAINS: String + isbn_ENDS_WITH: String + isbn_IN: [String!] + isbn_STARTS_WITH: String + screenTime: Duration + screenTime_GT: Duration + screenTime_GTE: Duration + screenTime_IN: [Duration] + screenTime_LT: Duration + screenTime_LTE: Duration + someBigInt: BigInt + someBigInt_GT: BigInt + someBigInt_GTE: BigInt + someBigInt_IN: [BigInt] + someBigInt_LT: BigInt + someBigInt_LTE: BigInt + someInt: Int + someInt_GT: Int + someInt_GTE: Int + someInt_IN: [Int] + someInt_LT: Int + someInt_LTE: Int + someLocalDateTime: LocalDateTime + someLocalDateTime_GT: LocalDateTime + someLocalDateTime_GTE: LocalDateTime + someLocalDateTime_IN: [LocalDateTime] + someLocalDateTime_LT: LocalDateTime + someLocalDateTime_LTE: LocalDateTime + someLocalTime: LocalTime + someLocalTime_GT: LocalTime + someLocalTime_GTE: LocalTime + someLocalTime_IN: [LocalTime] + someLocalTime_LT: LocalTime + someLocalTime_LTE: LocalTime + someTime: Time + someTime_GT: Time + someTime_GTE: Time + someTime_IN: [Time] + someTime_LT: Time + someTime_LTE: Time + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +== Where Level Aggregations + +.Schema [source,graphql,schema=true] ---- type User { @@ -38,8 +226,6 @@ type Likes @relationshipProperties { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -375,3 +561,4 @@ input UserWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations/top-level-aggregations.adoc b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations/top-level-aggregations.adoc deleted file mode 100644 index 9e6d19e7..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/aggregations/top-level-aggregations.adoc +++ /dev/null @@ -1,190 +0,0 @@ -:toc: - -= Remove deprecated fields for aggregations -> Top Level Aggregations - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - isbn: String! - title: String - createdAt: DateTime - someTime: Time - someLocalTime: LocalTime - someLocalDateTime: LocalDateTime - imdbRating: Float - someInt: Int - someBigInt: BigInt - screenTime: Duration -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - createdAt: DateTime - id: ID - imdbRating: Float - isbn: String! - screenTime: Duration - someBigInt: BigInt - someInt: Int - someLocalDateTime: LocalDateTime - someLocalTime: LocalTime - someTime: Time - title: String -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -"A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string." -scalar BigInt - -"A date and time, represented as an ISO-8601 string" -scalar DateTime - -"A duration, represented as an ISO 8601 duration string" -scalar Duration - -"A local datetime, represented as 'YYYY-MM-DDTHH:MM:SS'" -scalar LocalDateTime - -"A local time, represented as a time string without timezone information" -scalar LocalTime - -"A time, represented as an RFC3339 time string" -scalar Time - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - createdAt: SortDirection - id: SortDirection - imdbRating: SortDirection - isbn: SortDirection - screenTime: SortDirection - someBigInt: SortDirection - someInt: SortDirection - someLocalDateTime: SortDirection - someLocalTime: SortDirection - someTime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - createdAt: DateTime - createdAt_GT: DateTime - createdAt_GTE: DateTime - createdAt_IN: [DateTime] - createdAt_LT: DateTime - createdAt_LTE: DateTime - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - imdbRating: Float - imdbRating_GT: Float - imdbRating_GTE: Float - imdbRating_IN: [Float] - imdbRating_LT: Float - imdbRating_LTE: Float - isbn: String - isbn_CONTAINS: String - isbn_ENDS_WITH: String - isbn_IN: [String!] - isbn_STARTS_WITH: String - screenTime: Duration - screenTime_GT: Duration - screenTime_GTE: Duration - screenTime_IN: [Duration] - screenTime_LT: Duration - screenTime_LTE: Duration - someBigInt: BigInt - someBigInt_GT: BigInt - someBigInt_GTE: BigInt - someBigInt_IN: [BigInt] - someBigInt_LT: BigInt - someBigInt_LTE: BigInt - someInt: Int - someInt_GT: Int - someInt_GTE: Int - someInt_IN: [Int] - someInt_LT: Int - someInt_LTE: Int - someLocalDateTime: LocalDateTime - someLocalDateTime_GT: LocalDateTime - someLocalDateTime_GTE: LocalDateTime - someLocalDateTime_IN: [LocalDateTime] - someLocalDateTime_LT: LocalDateTime - someLocalDateTime_LTE: LocalDateTime - someLocalTime: LocalTime - someLocalTime_GT: LocalTime - someLocalTime_GTE: LocalTime - someLocalTime_IN: [LocalTime] - someLocalTime_LT: LocalTime - someLocalTime_LTE: LocalTime - someTime: Time - someTime_GT: Time - someTime_GTE: Time - someTime_IN: [Time] - someTime_LT: Time - someTime_LTE: Time - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/array-methods.adoc b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/array-methods.adoc index 69498258..5e496779 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/array-methods.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/array-methods.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Arrays Methods -> Array of Float and Array of Actor relationships += Arrays Methods -== Source schema +== Array of Float and Array of Actor relationships +.Schema [source,graphql,schema=true] ---- type Actor { @@ -23,8 +25,6 @@ type ActedIn @relationshipProperties { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -252,3 +252,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments.adoc b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments.adoc new file mode 100644 index 00000000..50ec009b --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments.adoc @@ -0,0 +1,823 @@ +:toc: +:toclevels: 42 + += Comments + +== Simple + +.Schema +[source,graphql,schema=true] +---- +"A custom scalar." +scalar CustomScalar + +"An enumeration of movie genres." +enum Genre { + ACTION + DRAMA + ROMANCE +} + +"""A type describing a movie.""" +type Movie { + id: ID + "The number of actors who acted in the movie." + actorCount: Int + """The average rating for the movie.""" + averageRating: Float + """ + Is the movie active? + + This is measured based on annual profit. + """ + isActive: Boolean + genre: Genre + customScalar: CustomScalar +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"A type describing a movie." +type Movie { + "The number of actors who acted in the movie." + actorCount: Int + "The average rating for the movie." + averageRating: Float + customScalar: CustomScalar + genre: Genre + id: ID + """ + Is the movie active? + + This is measured based on annual profit. + """ + isActive: Boolean +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enumeration of movie genres." +enum Genre { + ACTION + DRAMA + ROMANCE +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +"A custom scalar." +scalar CustomScalar + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + customScalar: SortDirection + genre: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + customScalar: CustomScalar + customScalar_IN: [CustomScalar] + genre: Genre + genre_IN: [Genre] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + +== Relationship + +=== Simple + +.Schema +[source,graphql,schema=true] +---- +type Actor { + name: String +} + +type Movie { + id: ID + "Actors in Movie" + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + name: String +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + "Actors in Movie" + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + id: ID +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +---- + +''' + +=== Interface + +.Schema +[source,graphql,schema=true] +---- +interface Production { + title: String! +} + +type Movie implements Production { + title: String! + runtime: Int! +} + +type Series implements Production { + title: String! + episodes: Int! +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + name: String! + "Acted in Production" + actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +interface Production { + title: String! +} + +""" +The edge properties for the following fields: +* Actor.actedIn +""" +type ActedIn { + screenTime: Int! +} + +type Actor { + "Acted in Production" + actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! + actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! + name: String! +} + +type ActorActedInConnection { + edges: [ActorActedInRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorActedInRelationship { + cursor: String! + node: Production! + properties: ActedIn! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie implements Production { + runtime: Int! + title: String! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type ProductionEdge { + cursor: String! + node: Production! +} + +type ProductionsConnection { + edges: [ProductionEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + productions(options: ProductionOptions, where: ProductionWhere): [Production!]! + productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! + series(options: SeriesOptions, where: SeriesWhere): [Series!]! + seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! +} + +type Series implements Production { + episodes: Int! + title: String! +} + +type SeriesConnection { + edges: [SeriesEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type SeriesEdge { + cursor: String! + node: Series! +} + +enum ProductionImplementation { + Movie + Series +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + screenTime: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + screenTime: Int + screenTime_GT: Int + screenTime_GTE: Int + screenTime_IN: [Int!] + screenTime_LT: Int + screenTime_LTE: Int +} + +input ActorActedInConnectionSort { + edge: ActedInSort + node: ProductionSort +} + +input ActorActedInConnectionWhere { + AND: [ActorActedInConnectionWhere!] + NOT: ActorActedInConnectionWhere + OR: [ActorActedInConnectionWhere!] + edge: ActedInWhere + node: ProductionWhere +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorActedInConnections match this filter" + actedInConnection_ALL: ActorActedInConnectionWhere + "Return Actors where none of the related ActorActedInConnections match this filter" + actedInConnection_NONE: ActorActedInConnectionWhere + "Return Actors where one of the related ActorActedInConnections match this filter" + actedInConnection_SINGLE: ActorActedInConnectionWhere + "Return Actors where some of the related ActorActedInConnections match this filter" + actedInConnection_SOME: ActorActedInConnectionWhere + "Return Actors where all of the related Productions match this filter" + actedIn_ALL: ProductionWhere + "Return Actors where none of the related Productions match this filter" + actedIn_NONE: ProductionWhere + "Return Actors where one of the related Productions match this filter" + actedIn_SINGLE: ProductionWhere + "Return Actors where some of the related Productions match this filter" + actedIn_SOME: ProductionWhere + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + runtime: SortDirection + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + runtime: Int + runtime_GT: Int + runtime_GTE: Int + runtime_IN: [Int!] + runtime_LT: Int + runtime_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +input ProductionOptions { + limit: Int + offset: Int + "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ProductionSort] +} + +"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." +input ProductionSort { + title: SortDirection +} + +input ProductionWhere { + AND: [ProductionWhere!] + NOT: ProductionWhere + OR: [ProductionWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String + typename_IN: [ProductionImplementation!] +} + +input SeriesOptions { + limit: Int + offset: Int + "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." + sort: [SeriesSort!] +} + +"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." +input SeriesSort { + episodes: SortDirection + title: SortDirection +} + +input SeriesWhere { + AND: [SeriesWhere!] + NOT: SeriesWhere + OR: [SeriesWhere!] + episodes: Int + episodes_GT: Int + episodes_GTE: Int + episodes_IN: [Int!] + episodes_LT: Int + episodes_LTE: Int + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String!] + title_STARTS_WITH: String +} + +---- + +''' + +=== Unions + +.Schema +[source,graphql,schema=true] +---- +union Search = Movie | Genre + +type Genre { + id: ID +} + +type Movie { + id: ID + search: [Search!]! @relationship(type: "SEARCH", direction: OUT) + searchNoDirective: Search +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Search = Genre | Movie + +type Genre { + id: ID +} + +type GenreEdge { + cursor: String! + node: Genre! +} + +type GenresConnection { + edges: [GenreEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + id: ID + search(directed: Boolean = true, options: QueryOptions, where: SearchWhere): [Search!]! + searchConnection(after: String, directed: Boolean = true, first: Int, where: MovieSearchConnectionWhere): MovieSearchConnection! + searchNoDirective: Search +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MovieSearchConnection { + edges: [MovieSearchRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieSearchRelationship { + cursor: String! + node: Search! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + genres(options: GenreOptions, where: GenreWhere): [Genre!]! + genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + searches(options: QueryOptions, where: SearchWhere): [Search!]! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input GenreOptions { + limit: Int + offset: Int + "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." + sort: [GenreSort!] +} + +"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." +input GenreSort { + id: SortDirection +} + +input GenreWhere { + AND: [GenreWhere!] + NOT: GenreWhere + OR: [GenreWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +input MovieSearchConnectionWhere { + Genre: MovieSearchGenreConnectionWhere + Movie: MovieSearchMovieConnectionWhere +} + +input MovieSearchGenreConnectionWhere { + AND: [MovieSearchGenreConnectionWhere!] + NOT: MovieSearchGenreConnectionWhere + OR: [MovieSearchGenreConnectionWhere!] + node: GenreWhere +} + +input MovieSearchMovieConnectionWhere { + AND: [MovieSearchMovieConnectionWhere!] + NOT: MovieSearchMovieConnectionWhere + OR: [MovieSearchMovieConnectionWhere!] + node: MovieWhere +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + id: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + "Return Movies where all of the related MovieSearchConnections match this filter" + searchConnection_ALL: MovieSearchConnectionWhere + "Return Movies where none of the related MovieSearchConnections match this filter" + searchConnection_NONE: MovieSearchConnectionWhere + "Return Movies where one of the related MovieSearchConnections match this filter" + searchConnection_SINGLE: MovieSearchConnectionWhere + "Return Movies where some of the related MovieSearchConnections match this filter" + searchConnection_SOME: MovieSearchConnectionWhere + "Return Movies where all of the related Searches match this filter" + search_ALL: SearchWhere + "Return Movies where none of the related Searches match this filter" + search_NONE: SearchWhere + "Return Movies where one of the related Searches match this filter" + search_SINGLE: SearchWhere + "Return Movies where some of the related Searches match this filter" + search_SOME: SearchWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +input SearchWhere { + Genre: GenreWhere + Movie: MovieWhere +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/interface.adoc b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/interface.adoc deleted file mode 100644 index 48a10862..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/interface.adoc +++ /dev/null @@ -1,314 +0,0 @@ -:toc: - -= Comments -> Relationship -> Interface - -== Source schema - -[source,graphql,schema=true] ----- -interface Production { - title: String! -} - -type Movie implements Production { - title: String! - runtime: Int! -} - -type Series implements Production { - title: String! - episodes: Int! -} - -type ActedIn @relationshipProperties { - screenTime: Int! -} - -type Actor { - name: String! - "Acted in Production" - actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -interface Production { - title: String! -} - -""" -The edge properties for the following fields: -* Actor.actedIn -""" -type ActedIn { - screenTime: Int! -} - -type Actor { - "Acted in Production" - actedIn(directed: Boolean = true, options: ProductionOptions, where: ProductionWhere): [Production!]! - actedInConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorActedInConnectionSort!], where: ActorActedInConnectionWhere): ActorActedInConnection! - name: String! -} - -type ActorActedInConnection { - edges: [ActorActedInRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorActedInRelationship { - cursor: String! - node: Production! - properties: ActedIn! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie implements Production { - runtime: Int! - title: String! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type ProductionEdge { - cursor: String! - node: Production! -} - -type ProductionsConnection { - edges: [ProductionEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - productions(options: ProductionOptions, where: ProductionWhere): [Production!]! - productionsConnection(after: String, first: Int, sort: [ProductionSort], where: ProductionWhere): ProductionsConnection! - series(options: SeriesOptions, where: SeriesWhere): [Series!]! - seriesConnection(after: String, first: Int, sort: [SeriesSort], where: SeriesWhere): SeriesConnection! -} - -type Series implements Production { - episodes: Int! - title: String! -} - -type SeriesConnection { - edges: [SeriesEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type SeriesEdge { - cursor: String! - node: Series! -} - -enum ProductionImplementation { - Movie - Series -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - screenTime: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - screenTime: Int - screenTime_GT: Int - screenTime_GTE: Int - screenTime_IN: [Int!] - screenTime_LT: Int - screenTime_LTE: Int -} - -input ActorActedInConnectionSort { - edge: ActedInSort - node: ProductionSort -} - -input ActorActedInConnectionWhere { - AND: [ActorActedInConnectionWhere!] - NOT: ActorActedInConnectionWhere - OR: [ActorActedInConnectionWhere!] - edge: ActedInWhere - node: ProductionWhere -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorActedInConnections match this filter" - actedInConnection_ALL: ActorActedInConnectionWhere - "Return Actors where none of the related ActorActedInConnections match this filter" - actedInConnection_NONE: ActorActedInConnectionWhere - "Return Actors where one of the related ActorActedInConnections match this filter" - actedInConnection_SINGLE: ActorActedInConnectionWhere - "Return Actors where some of the related ActorActedInConnections match this filter" - actedInConnection_SOME: ActorActedInConnectionWhere - "Return Actors where all of the related Productions match this filter" - actedIn_ALL: ProductionWhere - "Return Actors where none of the related Productions match this filter" - actedIn_NONE: ProductionWhere - "Return Actors where one of the related Productions match this filter" - actedIn_SINGLE: ProductionWhere - "Return Actors where some of the related Productions match this filter" - actedIn_SOME: ProductionWhere - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - runtime: SortDirection - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - runtime: Int - runtime_GT: Int - runtime_GTE: Int - runtime_IN: [Int!] - runtime_LT: Int - runtime_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - -input ProductionOptions { - limit: Int - offset: Int - "Specify one or more ProductionSort objects to sort Productions by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ProductionSort] -} - -"Fields to sort Productions by. The order in which sorts are applied is not guaranteed when specifying many fields in one ProductionSort object." -input ProductionSort { - title: SortDirection -} - -input ProductionWhere { - AND: [ProductionWhere!] - NOT: ProductionWhere - OR: [ProductionWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String - typename_IN: [ProductionImplementation!] -} - -input SeriesOptions { - limit: Int - offset: Int - "Specify one or more SeriesSort objects to sort Series by. The sorts will be applied in the order in which they are arranged in the array." - sort: [SeriesSort!] -} - -"Fields to sort Series by. The order in which sorts are applied is not guaranteed when specifying many fields in one SeriesSort object." -input SeriesSort { - episodes: SortDirection - title: SortDirection -} - -input SeriesWhere { - AND: [SeriesWhere!] - NOT: SeriesWhere - OR: [SeriesWhere!] - episodes: Int - episodes_GT: Int - episodes_GTE: Int - episodes_IN: [Int!] - episodes_LT: Int - episodes_LTE: Int - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_IN: [String!] - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/simple.adoc b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/simple.adoc deleted file mode 100644 index 425759eb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/simple.adoc +++ /dev/null @@ -1,171 +0,0 @@ -:toc: - -= Comments -> Relationship -> Simple - -== Source schema - -[source,graphql,schema=true] ----- -type Actor { - name: String -} - -type Movie { - id: ID - "Actors in Movie" - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - name: String -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - "Actors in Movie" - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - id: ID -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/unions.adoc b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/unions.adoc deleted file mode 100644 index 4c507a11..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/relationship/unions.adoc +++ /dev/null @@ -1,195 +0,0 @@ -:toc: - -= Comments -> Relationship -> Unions - -== Source schema - -[source,graphql,schema=true] ----- -union Search = Movie | Genre - -type Genre { - id: ID -} - -type Movie { - id: ID - search: [Search!]! @relationship(type: "SEARCH", direction: OUT) - searchNoDirective: Search -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Search = Genre | Movie - -type Genre { - id: ID -} - -type GenreEdge { - cursor: String! - node: Genre! -} - -type GenresConnection { - edges: [GenreEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - id: ID - search(directed: Boolean = true, options: QueryOptions, where: SearchWhere): [Search!]! - searchConnection(after: String, directed: Boolean = true, first: Int, where: MovieSearchConnectionWhere): MovieSearchConnection! - searchNoDirective: Search -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MovieSearchConnection { - edges: [MovieSearchRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieSearchRelationship { - cursor: String! - node: Search! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - genres(options: GenreOptions, where: GenreWhere): [Genre!]! - genresConnection(after: String, first: Int, sort: [GenreSort], where: GenreWhere): GenresConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - searches(options: QueryOptions, where: SearchWhere): [Search!]! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input GenreOptions { - limit: Int - offset: Int - "Specify one or more GenreSort objects to sort Genres by. The sorts will be applied in the order in which they are arranged in the array." - sort: [GenreSort!] -} - -"Fields to sort Genres by. The order in which sorts are applied is not guaranteed when specifying many fields in one GenreSort object." -input GenreSort { - id: SortDirection -} - -input GenreWhere { - AND: [GenreWhere!] - NOT: GenreWhere - OR: [GenreWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -input MovieSearchConnectionWhere { - Genre: MovieSearchGenreConnectionWhere - Movie: MovieSearchMovieConnectionWhere -} - -input MovieSearchGenreConnectionWhere { - AND: [MovieSearchGenreConnectionWhere!] - NOT: MovieSearchGenreConnectionWhere - OR: [MovieSearchGenreConnectionWhere!] - node: GenreWhere -} - -input MovieSearchMovieConnectionWhere { - AND: [MovieSearchMovieConnectionWhere!] - NOT: MovieSearchMovieConnectionWhere - OR: [MovieSearchMovieConnectionWhere!] - node: MovieWhere -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - id: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - "Return Movies where all of the related MovieSearchConnections match this filter" - searchConnection_ALL: MovieSearchConnectionWhere - "Return Movies where none of the related MovieSearchConnections match this filter" - searchConnection_NONE: MovieSearchConnectionWhere - "Return Movies where one of the related MovieSearchConnections match this filter" - searchConnection_SINGLE: MovieSearchConnectionWhere - "Return Movies where some of the related MovieSearchConnections match this filter" - searchConnection_SOME: MovieSearchConnectionWhere - "Return Movies where all of the related Searches match this filter" - search_ALL: SearchWhere - "Return Movies where none of the related Searches match this filter" - search_NONE: SearchWhere - "Return Movies where one of the related Searches match this filter" - search_SINGLE: SearchWhere - "Return Movies where some of the related Searches match this filter" - search_SOME: SearchWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - -input SearchWhere { - Genre: GenreWhere - Movie: MovieWhere -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/simple.adoc b/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/simple.adoc deleted file mode 100644 index 5d62d1cb..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/remove-deprecated/comments/simple.adoc +++ /dev/null @@ -1,152 +0,0 @@ -:toc: - -= Comments -> Simple - -== Source schema - -[source,graphql,schema=true] ----- -"A custom scalar." -scalar CustomScalar - -"An enumeration of movie genres." -enum Genre { - ACTION - DRAMA - ROMANCE -} - -"""A type describing a movie.""" -type Movie { - id: ID - "The number of actors who acted in the movie." - actorCount: Int - """The average rating for the movie.""" - averageRating: Float - """ - Is the movie active? - - This is measured based on annual profit. - """ - isActive: Boolean - genre: Genre - customScalar: CustomScalar -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -"A type describing a movie." -type Movie { - "The number of actors who acted in the movie." - actorCount: Int - "The average rating for the movie." - averageRating: Float - customScalar: CustomScalar - genre: Genre - id: ID - """ - Is the movie active? - - This is measured based on annual profit. - """ - isActive: Boolean -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enumeration of movie genres." -enum Genre { - ACTION - DRAMA - ROMANCE -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -"A custom scalar." -scalar CustomScalar - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - customScalar: SortDirection - genre: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - customScalar: CustomScalar - customScalar_IN: [CustomScalar] - genre: Genre - genre_IN: [Genre] - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/scalar.adoc b/core/src/test/resources/tck-test-files/schema/v2/scalar.adoc index f2ff27a2..1e25bb1e 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/scalar.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/scalar.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Scalar -> Scalars += Scalar -== Source schema +== Scalars +.Schema [source,graphql,schema=true] ---- scalar CustomScalar @@ -16,8 +18,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -99,3 +99,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/simple.adoc b/core/src/test/resources/tck-test-files/schema/v2/simple.adoc index 32f2cf50..715d3f86 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/simple.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/simple.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Simple -== Source schema +== Simple +.Schema [source,graphql,schema=true] ---- type Movie { @@ -14,8 +16,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -104,3 +104,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/string-comparators/string-comparator-relationship-and-relationship-properties.adoc b/core/src/test/resources/tck-test-files/schema/v2/string-comparators.adoc similarity index 56% rename from core/src/test/resources/tck-test-files/schema/v2/string-comparators/string-comparator-relationship-and-relationship-properties.adoc rename to core/src/test/resources/tck-test-files/schema/v2/string-comparators.adoc index d63cb669..c78e0ffd 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/string-comparators/string-comparator-relationship-and-relationship-properties.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/string-comparators.adoc @@ -1,9 +1,290 @@ :toc: +:toclevels: 42 -= String Comparators -> string comparator relationship and relationship properties += String Comparators -== Source schema +== String comparators should be present if explicitly defined in the configuration +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String +} +---- + +.Configuration +[source,json,schema-config=true] +---- +{ + "features": { + "filters": { + "String": { + "LT": true, + "GT": true, + "GTE": true, + "LTE": true + } + } + } +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + title: String +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_GT: String + title_GTE: String + title_IN: [String] + title_LT: String + title_LTE: String + title_STARTS_WITH: String +} + +---- + +''' + +== String comparators should not be present if not explicitly defined in the configuration + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + title: String +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_IN: [String] + title_STARTS_WITH: String +} + +---- + +''' + +== If String comparators are partially defined, then only the defined ones should be present + +.Schema +[source,graphql,schema=true] +---- +type Movie { + title: String +} +---- + +.Configuration +[source,json,schema-config=true] +---- +{ + "features": { + "filters": { + "String": { + "LT": true, + "GT": true, + "LTE": false + } + } + } +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + title: String +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + title: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + title: String + title_CONTAINS: String + title_ENDS_WITH: String + title_GT: String + title_IN: [String] + title_LT: String + title_STARTS_WITH: String +} + +---- + +''' + +== string comparator relationship and relationship properties + +.Schema [source,graphql,schema=true] ---- type Movie { @@ -21,8 +302,6 @@ type Actor { } ---- -== Configuration - .Configuration [source,json,schema-config=true] ---- @@ -40,8 +319,6 @@ type Actor { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -273,3 +550,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/string-comparators/if-string-comparators-are-partially-defined-then-only-the-defined-ones-should-be-present.adoc b/core/src/test/resources/tck-test-files/schema/v2/string-comparators/if-string-comparators-are-partially-defined-then-only-the-defined-ones-should-be-present.adoc deleted file mode 100644 index 2afefd81..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/string-comparators/if-string-comparators-are-partially-defined-then-only-the-defined-ones-should-be-present.adoc +++ /dev/null @@ -1,107 +0,0 @@ -:toc: - -= String Comparators -> If String comparators are partially defined, then only the defined ones should be present - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - title: String -} ----- - -== Configuration - -.Configuration -[source,json,schema-config=true] ----- -{ - "features": { - "filters": { - "String": { - "LT": true, - "GT": true, - "GTE": true, - "LTE": true - } - } - } -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - title: String -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - title: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - title: String - title_CONTAINS: String - title_ENDS_WITH: String - title_GT: String - title_GTE: String - title_IN: [String] - title_LT: String - title_LTE: String - title_STARTS_WITH: String -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/subscriptions.adoc b/core/src/test/resources/tck-test-files/schema/v2/subscriptions.adoc new file mode 100644 index 00000000..2b74111a --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/subscriptions.adoc @@ -0,0 +1,955 @@ +:toc: +:toclevels: 42 + += Subscriptions + +== Subscriptions + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + actorCount: Int + averageRating: Float + isActive: Boolean + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + name: String! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + name: String! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actorCount: Int + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + averageRating: Float + id: ID + isActive: Boolean +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorOptions { + limit: Int + offset: Int + "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." + sort: [ActorSort!] +} + +"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." +input ActorSort { + name: SortDirection +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + name: String + name_CONTAINS: String + name_ENDS_WITH: String + name_IN: [String!] + name_STARTS_WITH: String +} + +input MovieActorsConnectionSort { + node: ActorSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + +== Empty EventPayload type + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + actorCount: Int + averageRating: Float + isActive: Boolean + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +type Actor { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actorCount: Int + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + averageRating: Float + id: ID + isActive: Boolean +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + +== Empty EventPayload type on Union type + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + actorCount: Int + averageRating: Float + isActive: Boolean + actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) +} + +union Actor = Star | Person + +type Star { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} + +type Person { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +union Actor = Person | Star + +type Movie { + actorCount: Int + actors(directed: Boolean = true, options: QueryOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! + averageRating: Float + id: ID + isActive: Boolean +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type PeopleConnection { + edges: [PersonEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Person { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonMoviesConnectionSort!], where: PersonMoviesConnectionWhere): PersonMoviesConnection! +} + +type PersonEdge { + cursor: String! + node: Person! +} + +type PersonMoviesConnection { + edges: [PersonMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type PersonMoviesRelationship { + cursor: String! + node: Movie! +} + +type Query { + actors(options: QueryOptions, where: ActorWhere): [Actor!]! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! + people(options: PersonOptions, where: PersonWhere): [Person!]! + peopleConnection(after: String, first: Int, where: PersonWhere): PeopleConnection! + stars(options: StarOptions, where: StarWhere): [Star!]! + starsConnection(after: String, first: Int, where: StarWhere): StarsConnection! +} + +type Star { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [StarMoviesConnectionSort!], where: StarMoviesConnectionWhere): StarMoviesConnection! +} + +type StarEdge { + cursor: String! + node: Star! +} + +type StarMoviesConnection { + edges: [StarMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type StarMoviesRelationship { + cursor: String! + node: Movie! +} + +type StarsConnection { + edges: [StarEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActorWhere { + Person: PersonWhere + Star: StarWhere +} + +input MovieActorsConnectionWhere { + Person: MovieActorsPersonConnectionWhere + Star: MovieActorsStarConnectionWhere +} + +input MovieActorsPersonConnectionWhere { + AND: [MovieActorsPersonConnectionWhere!] + NOT: MovieActorsPersonConnectionWhere + OR: [MovieActorsPersonConnectionWhere!] + node: PersonWhere +} + +input MovieActorsStarConnectionWhere { + AND: [MovieActorsStarConnectionWhere!] + NOT: MovieActorsStarConnectionWhere + OR: [MovieActorsStarConnectionWhere!] + node: StarWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +input PersonMoviesConnectionSort { + node: MovieSort +} + +input PersonMoviesConnectionWhere { + AND: [PersonMoviesConnectionWhere!] + NOT: PersonMoviesConnectionWhere + OR: [PersonMoviesConnectionWhere!] + node: MovieWhere +} + +input PersonOptions { + limit: Int + offset: Int +} + +input PersonWhere { + AND: [PersonWhere!] + NOT: PersonWhere + OR: [PersonWhere!] + "Return People where all of the related PersonMoviesConnections match this filter" + moviesConnection_ALL: PersonMoviesConnectionWhere + "Return People where none of the related PersonMoviesConnections match this filter" + moviesConnection_NONE: PersonMoviesConnectionWhere + "Return People where one of the related PersonMoviesConnections match this filter" + moviesConnection_SINGLE: PersonMoviesConnectionWhere + "Return People where some of the related PersonMoviesConnections match this filter" + moviesConnection_SOME: PersonMoviesConnectionWhere + "Return People where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return People where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return People where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return People where some of the related Movies match this filter" + movies_SOME: MovieWhere +} + +"Input type for options that can be specified on a query operation." +input QueryOptions { + limit: Int + offset: Int +} + +input StarMoviesConnectionSort { + node: MovieSort +} + +input StarMoviesConnectionWhere { + AND: [StarMoviesConnectionWhere!] + NOT: StarMoviesConnectionWhere + OR: [StarMoviesConnectionWhere!] + node: MovieWhere +} + +input StarOptions { + limit: Int + offset: Int +} + +input StarWhere { + AND: [StarWhere!] + NOT: StarWhere + OR: [StarWhere!] + "Return Stars where all of the related StarMoviesConnections match this filter" + moviesConnection_ALL: StarMoviesConnectionWhere + "Return Stars where none of the related StarMoviesConnections match this filter" + moviesConnection_NONE: StarMoviesConnectionWhere + "Return Stars where one of the related StarMoviesConnections match this filter" + moviesConnection_SINGLE: StarMoviesConnectionWhere + "Return Stars where some of the related StarMoviesConnections match this filter" + moviesConnection_SOME: StarMoviesConnectionWhere + "Return Stars where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Stars where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Stars where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Stars where some of the related Movies match this filter" + movies_SOME: MovieWhere +} + +---- + +''' + +== Empty EventPayload type, but @relationshipProperty exists + +.Schema +[source,graphql,schema=true] +---- +type Movie { + id: ID + actorCount: Int + averageRating: Float + isActive: Boolean + actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) +} + +type ActedIn @relationshipProperties { + screenTime: Int! +} + +type Actor { + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +""" +The edge properties for the following fields: +* Movie.actors +""" +type ActedIn { + screenTime: Int! +} + +type Actor { + movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! +} + +type ActorEdge { + cursor: String! + node: Actor! +} + +type ActorMoviesConnection { + edges: [ActorMoviesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type ActorMoviesRelationship { + cursor: String! + node: Movie! +} + +type ActorsConnection { + edges: [ActorEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type Movie { + actorCount: Int + actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! + averageRating: Float + id: ID + isActive: Boolean +} + +type MovieActorsConnection { + edges: [MovieActorsRelationship!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type MovieActorsRelationship { + cursor: String! + node: Actor! + properties: ActedIn! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + actors(options: ActorOptions, where: ActorWhere): [Actor!]! + actorsConnection(after: String, first: Int, where: ActorWhere): ActorsConnection! + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input ActedInSort { + screenTime: SortDirection +} + +input ActedInWhere { + AND: [ActedInWhere!] + NOT: ActedInWhere + OR: [ActedInWhere!] + screenTime: Int + screenTime_GT: Int + screenTime_GTE: Int + screenTime_IN: [Int!] + screenTime_LT: Int + screenTime_LTE: Int +} + +input ActorMoviesConnectionSort { + node: MovieSort +} + +input ActorMoviesConnectionWhere { + AND: [ActorMoviesConnectionWhere!] + NOT: ActorMoviesConnectionWhere + OR: [ActorMoviesConnectionWhere!] + node: MovieWhere +} + +input ActorOptions { + limit: Int + offset: Int +} + +input ActorWhere { + AND: [ActorWhere!] + NOT: ActorWhere + OR: [ActorWhere!] + "Return Actors where all of the related ActorMoviesConnections match this filter" + moviesConnection_ALL: ActorMoviesConnectionWhere + "Return Actors where none of the related ActorMoviesConnections match this filter" + moviesConnection_NONE: ActorMoviesConnectionWhere + "Return Actors where one of the related ActorMoviesConnections match this filter" + moviesConnection_SINGLE: ActorMoviesConnectionWhere + "Return Actors where some of the related ActorMoviesConnections match this filter" + moviesConnection_SOME: ActorMoviesConnectionWhere + "Return Actors where all of the related Movies match this filter" + movies_ALL: MovieWhere + "Return Actors where none of the related Movies match this filter" + movies_NONE: MovieWhere + "Return Actors where one of the related Movies match this filter" + movies_SINGLE: MovieWhere + "Return Actors where some of the related Movies match this filter" + movies_SOME: MovieWhere +} + +input MovieActorsConnectionSort { + edge: ActedInSort +} + +input MovieActorsConnectionWhere { + AND: [MovieActorsConnectionWhere!] + NOT: MovieActorsConnectionWhere + OR: [MovieActorsConnectionWhere!] + edge: ActedInWhere + node: ActorWhere +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + actorCount: SortDirection + averageRating: SortDirection + id: SortDirection + isActive: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + actorCount: Int + actorCount_GT: Int + actorCount_GTE: Int + actorCount_IN: [Int] + actorCount_LT: Int + actorCount_LTE: Int + "Return Movies where all of the related MovieActorsConnections match this filter" + actorsConnection_ALL: MovieActorsConnectionWhere + "Return Movies where none of the related MovieActorsConnections match this filter" + actorsConnection_NONE: MovieActorsConnectionWhere + "Return Movies where one of the related MovieActorsConnections match this filter" + actorsConnection_SINGLE: MovieActorsConnectionWhere + "Return Movies where some of the related MovieActorsConnections match this filter" + actorsConnection_SOME: MovieActorsConnectionWhere + "Return Movies where all of the related Actors match this filter" + actors_ALL: ActorWhere + "Return Movies where none of the related Actors match this filter" + actors_NONE: ActorWhere + "Return Movies where one of the related Actors match this filter" + actors_SINGLE: ActorWhere + "Return Movies where some of the related Actors match this filter" + actors_SOME: ActorWhere + averageRating: Float + averageRating_GT: Float + averageRating_GTE: Float + averageRating_IN: [Float] + averageRating_LT: Float + averageRating_LTE: Float + id: ID + id_CONTAINS: ID + id_ENDS_WITH: ID + id_IN: [ID] + id_STARTS_WITH: ID + isActive: Boolean +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type-but-relationshipproperty-exists.adoc b/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type-but-relationshipproperty-exists.adoc deleted file mode 100644 index 93edf300..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type-but-relationshipproperty-exists.adoc +++ /dev/null @@ -1,248 +0,0 @@ -:toc: - -= Subscriptions -> Empty EventPayload type, but @relationshipProperty exists - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - actorCount: Int - averageRating: Float - isActive: Boolean - actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) -} - -type ActedIn @relationshipProperties { - screenTime: Int! -} - -type Actor { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -""" -The edge properties for the following fields: -* Movie.actors -""" -type ActedIn { - screenTime: Int! -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actorCount: Int - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - averageRating: Float - id: ID - isActive: Boolean -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! - properties: ActedIn! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActedInSort { - screenTime: SortDirection -} - -input ActedInWhere { - AND: [ActedInWhere!] - NOT: ActedInWhere - OR: [ActedInWhere!] - screenTime: Int - screenTime_GT: Int - screenTime_GTE: Int - screenTime_IN: [Int!] - screenTime_LT: Int - screenTime_LTE: Int -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere -} - -input MovieActorsConnectionSort { - edge: ActedInSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - edge: ActedInWhere - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type-on-union-type.adoc b/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type-on-union-type.adoc deleted file mode 100644 index 8f2fa6b3..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type-on-union-type.adoc +++ /dev/null @@ -1,313 +0,0 @@ -:toc: - -= Subscriptions -> Empty EventPayload type on Union type - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - actorCount: Int - averageRating: Float - isActive: Boolean - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} - -union Actor = Star | Person - -type Star { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} - -type Person { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -union Actor = Person | Star - -type Movie { - actorCount: Int - actors(directed: Boolean = true, options: QueryOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - averageRating: Float - id: ID - isActive: Boolean -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type PeopleConnection { - edges: [PersonEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Person { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [PersonMoviesConnectionSort!], where: PersonMoviesConnectionWhere): PersonMoviesConnection! -} - -type PersonEdge { - cursor: String! - node: Person! -} - -type PersonMoviesConnection { - edges: [PersonMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type PersonMoviesRelationship { - cursor: String! - node: Movie! -} - -type Query { - actors(options: QueryOptions, where: ActorWhere): [Actor!]! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! - people(options: PersonOptions, where: PersonWhere): [Person!]! - peopleConnection(after: String, first: Int, where: PersonWhere): PeopleConnection! - stars(options: StarOptions, where: StarWhere): [Star!]! - starsConnection(after: String, first: Int, where: StarWhere): StarsConnection! -} - -type Star { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [StarMoviesConnectionSort!], where: StarMoviesConnectionWhere): StarMoviesConnection! -} - -type StarEdge { - cursor: String! - node: Star! -} - -type StarMoviesConnection { - edges: [StarMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type StarMoviesRelationship { - cursor: String! - node: Movie! -} - -type StarsConnection { - edges: [StarEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorWhere { - Person: PersonWhere - Star: StarWhere -} - -input MovieActorsConnectionWhere { - Person: MovieActorsPersonConnectionWhere - Star: MovieActorsStarConnectionWhere -} - -input MovieActorsPersonConnectionWhere { - AND: [MovieActorsPersonConnectionWhere!] - NOT: MovieActorsPersonConnectionWhere - OR: [MovieActorsPersonConnectionWhere!] - node: PersonWhere -} - -input MovieActorsStarConnectionWhere { - AND: [MovieActorsStarConnectionWhere!] - NOT: MovieActorsStarConnectionWhere - OR: [MovieActorsStarConnectionWhere!] - node: StarWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - -input PersonMoviesConnectionSort { - node: MovieSort -} - -input PersonMoviesConnectionWhere { - AND: [PersonMoviesConnectionWhere!] - NOT: PersonMoviesConnectionWhere - OR: [PersonMoviesConnectionWhere!] - node: MovieWhere -} - -input PersonOptions { - limit: Int - offset: Int -} - -input PersonWhere { - AND: [PersonWhere!] - NOT: PersonWhere - OR: [PersonWhere!] - "Return People where all of the related PersonMoviesConnections match this filter" - moviesConnection_ALL: PersonMoviesConnectionWhere - "Return People where none of the related PersonMoviesConnections match this filter" - moviesConnection_NONE: PersonMoviesConnectionWhere - "Return People where one of the related PersonMoviesConnections match this filter" - moviesConnection_SINGLE: PersonMoviesConnectionWhere - "Return People where some of the related PersonMoviesConnections match this filter" - moviesConnection_SOME: PersonMoviesConnectionWhere - "Return People where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return People where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return People where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return People where some of the related Movies match this filter" - movies_SOME: MovieWhere -} - -"Input type for options that can be specified on a query operation." -input QueryOptions { - limit: Int - offset: Int -} - -input StarMoviesConnectionSort { - node: MovieSort -} - -input StarMoviesConnectionWhere { - AND: [StarMoviesConnectionWhere!] - NOT: StarMoviesConnectionWhere - OR: [StarMoviesConnectionWhere!] - node: MovieWhere -} - -input StarOptions { - limit: Int - offset: Int -} - -input StarWhere { - AND: [StarWhere!] - NOT: StarWhere - OR: [StarWhere!] - "Return Stars where all of the related StarMoviesConnections match this filter" - moviesConnection_ALL: StarMoviesConnectionWhere - "Return Stars where none of the related StarMoviesConnections match this filter" - moviesConnection_NONE: StarMoviesConnectionWhere - "Return Stars where one of the related StarMoviesConnections match this filter" - moviesConnection_SINGLE: StarMoviesConnectionWhere - "Return Stars where some of the related StarMoviesConnections match this filter" - moviesConnection_SOME: StarMoviesConnectionWhere - "Return Stars where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Stars where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Stars where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Stars where some of the related Movies match this filter" - movies_SOME: MovieWhere -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type.adoc b/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type.adoc deleted file mode 100644 index eb707ff8..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/subscriptions/empty-eventpayload-type.adoc +++ /dev/null @@ -1,214 +0,0 @@ -:toc: - -= Subscriptions -> Empty EventPayload type - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - actorCount: Int - averageRating: Float - isActive: Boolean - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} - -type Actor { - movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT) -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - movies(directed: Boolean = true, options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, directed: Boolean = true, first: Int, sort: [ActorMoviesConnectionSort!], where: ActorMoviesConnectionWhere): ActorMoviesConnection! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorMoviesConnection { - edges: [ActorMoviesRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type ActorMoviesRelationship { - cursor: String! - node: Movie! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actorCount: Int - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! - averageRating: Float - id: ID - isActive: Boolean -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorMoviesConnectionSort { - node: MovieSort -} - -input ActorMoviesConnectionWhere { - AND: [ActorMoviesConnectionWhere!] - NOT: ActorMoviesConnectionWhere - OR: [ActorMoviesConnectionWhere!] - node: MovieWhere -} - -input ActorOptions { - limit: Int - offset: Int -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - "Return Actors where all of the related ActorMoviesConnections match this filter" - moviesConnection_ALL: ActorMoviesConnectionWhere - "Return Actors where none of the related ActorMoviesConnections match this filter" - moviesConnection_NONE: ActorMoviesConnectionWhere - "Return Actors where one of the related ActorMoviesConnections match this filter" - moviesConnection_SINGLE: ActorMoviesConnectionWhere - "Return Actors where some of the related ActorMoviesConnections match this filter" - moviesConnection_SOME: ActorMoviesConnectionWhere - "Return Actors where all of the related Movies match this filter" - movies_ALL: MovieWhere - "Return Actors where none of the related Movies match this filter" - movies_NONE: MovieWhere - "Return Actors where one of the related Movies match this filter" - movies_SINGLE: MovieWhere - "Return Actors where some of the related Movies match this filter" - movies_SOME: MovieWhere -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/subscriptions/subscriptions.adoc b/core/src/test/resources/tck-test-files/schema/v2/subscriptions/subscriptions.adoc deleted file mode 100644 index be8d297d..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/subscriptions/subscriptions.adoc +++ /dev/null @@ -1,191 +0,0 @@ -:toc: - -= Subscriptions - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - id: ID - actorCount: Int - averageRating: Float - isActive: Boolean - actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) -} - -type Actor { - name: String! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Actor { - name: String! -} - -type ActorEdge { - cursor: String! - node: Actor! -} - -type ActorsConnection { - edges: [ActorEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type Movie { - actorCount: Int - actors(directed: Boolean = true, options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, directed: Boolean = true, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! - averageRating: Float - id: ID - isActive: Boolean -} - -type MovieActorsConnection { - edges: [MovieActorsRelationship!]! - pageInfo: PageInfo! - totalCount: Int! -} - -type MovieActorsRelationship { - cursor: String! - node: Actor! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - actors(options: ActorOptions, where: ActorWhere): [Actor!]! - actorsConnection(after: String, first: Int, sort: [ActorSort], where: ActorWhere): ActorsConnection! - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input ActorOptions { - limit: Int - offset: Int - "Specify one or more ActorSort objects to sort Actors by. The sorts will be applied in the order in which they are arranged in the array." - sort: [ActorSort!] -} - -"Fields to sort Actors by. The order in which sorts are applied is not guaranteed when specifying many fields in one ActorSort object." -input ActorSort { - name: SortDirection -} - -input ActorWhere { - AND: [ActorWhere!] - NOT: ActorWhere - OR: [ActorWhere!] - name: String - name_CONTAINS: String - name_ENDS_WITH: String - name_IN: [String!] - name_STARTS_WITH: String -} - -input MovieActorsConnectionSort { - node: ActorSort -} - -input MovieActorsConnectionWhere { - AND: [MovieActorsConnectionWhere!] - NOT: MovieActorsConnectionWhere - OR: [MovieActorsConnectionWhere!] - node: ActorWhere -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - actorCount: SortDirection - averageRating: SortDirection - id: SortDirection - isActive: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - actorCount: Int - actorCount_GT: Int - actorCount_GTE: Int - actorCount_IN: [Int] - actorCount_LT: Int - actorCount_LTE: Int - "Return Movies where all of the related MovieActorsConnections match this filter" - actorsConnection_ALL: MovieActorsConnectionWhere - "Return Movies where none of the related MovieActorsConnections match this filter" - actorsConnection_NONE: MovieActorsConnectionWhere - "Return Movies where one of the related MovieActorsConnections match this filter" - actorsConnection_SINGLE: MovieActorsConnectionWhere - "Return Movies where some of the related MovieActorsConnections match this filter" - actorsConnection_SOME: MovieActorsConnectionWhere - "Return Movies where all of the related Actors match this filter" - actors_ALL: ActorWhere - "Return Movies where none of the related Actors match this filter" - actors_NONE: ActorWhere - "Return Movies where one of the related Actors match this filter" - actors_SINGLE: ActorWhere - "Return Movies where some of the related Actors match this filter" - actors_SOME: ActorWhere - averageRating: Float - averageRating_GT: Float - averageRating_GTE: Float - averageRating_IN: [Float] - averageRating_LT: Float - averageRating_LTE: Float - id: ID - id_CONTAINS: ID - id_ENDS_WITH: ID - id_IN: [ID] - id_STARTS_WITH: ID - isActive: Boolean -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/bigint.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/bigint.adoc index 4c2f305c..d5c9661f 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/types/bigint.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/types/bigint.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Bigint -> BigInt += Bigint -== Source schema +== BigInt +.Schema [source,graphql,schema=true] ---- type File { @@ -12,8 +14,6 @@ type File { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -94,3 +94,4 @@ input FileWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/date.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/date.adoc index 7994c627..4f7d1c01 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/types/date.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/types/date.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Date -== Source schema +== Date +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,8 +14,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -94,3 +94,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/datetime.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/datetime.adoc index d15d6469..60c29c78 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/types/datetime.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/types/datetime.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Datetime -> DateTime += Datetime -== Source schema +== DateTime +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,8 +14,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -94,3 +94,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/duration.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/duration.adoc index 3ba298d2..15810f73 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/types/duration.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/types/duration.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Duration -== Source schema +== Duration +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,8 +14,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -94,3 +94,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/localdatetime.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/localdatetime.adoc index 36e65fc1..53a327da 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/types/localdatetime.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/types/localdatetime.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Localdatetime -> LocalDateTime += Localdatetime -== Source schema +== LocalDateTime +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,8 +14,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -94,3 +94,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/localtime.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/localtime.adoc index af5bfc06..12d3d212 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/types/localtime.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/types/localtime.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 -= Localtime -> LocalTime += Localtime -== Source schema +== LocalTime +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,8 +14,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -94,3 +94,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/point.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/point.adoc new file mode 100644 index 00000000..077d9c5e --- /dev/null +++ b/core/src/test/resources/tck-test-files/schema/v2/types/point.adoc @@ -0,0 +1,458 @@ +:toc: +:toclevels: 42 + += Point + +== Point + +.Schema +[source,graphql,schema=true] +---- +type Movie { + filmedAt: Point! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + filmedAt: Point! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +"A point in a coordinate system." +type Point { + """ + The coordinate reference systems (CRS) + ------------------------------------- + possible values: + * `wgs-84`: A 2D geographic point in the WGS 84 CRS is specified by: longitude and latitude + * `wgs-84-3d`: A 3D geographic point in the WGS 84 CRS is specified by longitude, latitude and height + """ + crs: String! + "The third element of the Coordinate for geographic CRS, meters above the ellipsoid defined by the datum (WGS-84)" + height: Float + """ + The second element of the Coordinate for geographic CRS, degrees North of the equator + Range -90.0 to 90.0 + """ + latitude: Float! + """ + The first element of the Coordinate for geographic CRS, degrees East of the prime meridian + Range -180.0 to 180.0 + """ + longitude: Float! + """ + The internal Neo4j ID for the CRS + One of: + * `4326`: represents CRS `wgs-84` + * `4979`: represents CRS `wgs-84-3d` + """ + srid: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +input MovieOptions { + limit: Int + offset: Int + "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MovieSort!] +} + +"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." +input MovieSort { + filmedAt: SortDirection +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + filmedAt: PointInput + filmedAt_DISTANCE: PointDistance + filmedAt_GT: PointDistance + filmedAt_GTE: PointDistance + filmedAt_IN: [PointInput!] + filmedAt_LT: PointDistance + filmedAt_LTE: PointDistance +} + +"Input type for a point with a distance" +input PointDistance { + "The distance in metres to be used when comparing two points" + distance: Float! + point: PointInput! +} + +"Input type for a point" +input PointInput { + "The third element of the Coordinate for geographic CRS, meters above the ellipsoid defined by the datum (WGS-84)" + height: Float + """ + The second element of the Coordinate for geographic CRS, degrees North of the equator + Range -90.0 to 90.0 + """ + latitude: Float! + """ + The first element of the Coordinate for geographic CRS, degrees East of the prime meridian + Range -180.0 to 180.0 + """ + longitude: Float! +} + +---- + +''' + +== CartesianPoint + +.Schema +[source,graphql,schema=true] +---- +type Machine { + partLocation: CartesianPoint! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"A point in a two- or three-dimensional Cartesian coordinate system or in a three-dimensional cylindrical coordinate system." +type CartesianPoint { + """ + The coordinate reference systems (CRS) + ------------------------------------- + possible values: + * `cartesian`: A 2D point in the Cartesian CRS is specified with a map containing x and y coordinate values + * `cartesian-3d`: A 3D point in the Cartesian CRS is specified with a map containing x, y and z coordinate values + """ + crs: String! + """ + The internal Neo4j ID for the CRS + One of: + * `7203`: represents CRS `cartesian` + * `9157`: represents CRS `cartesian-3d` + """ + srid: Int! + x: Float! + y: Float! + z: Float +} + +type Machine { + partLocation: CartesianPoint! +} + +type MachineEdge { + cursor: String! + node: Machine! +} + +type MachinesConnection { + edges: [MachineEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + machines(options: MachineOptions, where: MachineWhere): [Machine!]! + machinesConnection(after: String, first: Int, sort: [MachineSort], where: MachineWhere): MachinesConnection! +} + +"An enum for sorting in either ascending or descending order." +enum SortDirection { + "Sort by field values in ascending order." + ASC + "Sort by field values in descending order." + DESC +} + +"Input type for a cartesian point with a distance" +input CartesianPointDistance { + distance: Float! + point: CartesianPointInput! +} + +"Input type for a cartesian point" +input CartesianPointInput { + x: Float! + y: Float! + z: Float +} + +input MachineOptions { + limit: Int + offset: Int + "Specify one or more MachineSort objects to sort Machines by. The sorts will be applied in the order in which they are arranged in the array." + sort: [MachineSort!] +} + +"Fields to sort Machines by. The order in which sorts are applied is not guaranteed when specifying many fields in one MachineSort object." +input MachineSort { + partLocation: SortDirection +} + +input MachineWhere { + AND: [MachineWhere!] + NOT: MachineWhere + OR: [MachineWhere!] + partLocation: CartesianPointInput + partLocation_DISTANCE: CartesianPointDistance + partLocation_GT: CartesianPointDistance + partLocation_GTE: CartesianPointDistance + partLocation_IN: [CartesianPointInput!] + partLocation_LT: CartesianPointDistance + partLocation_LTE: CartesianPointDistance +} + +---- + +''' + +== Points + +.Schema +[source,graphql,schema=true] +---- +type Movie { + filmedAt: [Point!]! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +type Movie { + filmedAt: [Point!]! +} + +type MovieEdge { + cursor: String! + node: Movie! +} + +type MoviesConnection { + edges: [MovieEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +"A point in a coordinate system." +type Point { + """ + The coordinate reference systems (CRS) + ------------------------------------- + possible values: + * `wgs-84`: A 2D geographic point in the WGS 84 CRS is specified by: longitude and latitude + * `wgs-84-3d`: A 3D geographic point in the WGS 84 CRS is specified by longitude, latitude and height + """ + crs: String! + "The third element of the Coordinate for geographic CRS, meters above the ellipsoid defined by the datum (WGS-84)" + height: Float + """ + The second element of the Coordinate for geographic CRS, degrees North of the equator + Range -90.0 to 90.0 + """ + latitude: Float! + """ + The first element of the Coordinate for geographic CRS, degrees East of the prime meridian + Range -180.0 to 180.0 + """ + longitude: Float! + """ + The internal Neo4j ID for the CRS + One of: + * `4326`: represents CRS `wgs-84` + * `4979`: represents CRS `wgs-84-3d` + """ + srid: Int! +} + +type Query { + movies(options: MovieOptions, where: MovieWhere): [Movie!]! + moviesConnection(after: String, first: Int, where: MovieWhere): MoviesConnection! +} + +input MovieOptions { + limit: Int + offset: Int +} + +input MovieWhere { + AND: [MovieWhere!] + NOT: MovieWhere + OR: [MovieWhere!] + filmedAt: [PointInput!] + filmedAt_INCLUDES: PointInput +} + +"Input type for a point" +input PointInput { + "The third element of the Coordinate for geographic CRS, meters above the ellipsoid defined by the datum (WGS-84)" + height: Float + """ + The second element of the Coordinate for geographic CRS, degrees North of the equator + Range -90.0 to 90.0 + """ + latitude: Float! + """ + The first element of the Coordinate for geographic CRS, degrees East of the prime meridian + Range -180.0 to 180.0 + """ + longitude: Float! +} + +---- + +''' + +== CartesianPoints + +.Schema +[source,graphql,schema=true] +---- +type Machine { + partLocations: [CartesianPoint!]! +} +---- + +.Augmented Schema +[source,graphql] +---- +schema { + query: Query +} + +"A point in a two- or three-dimensional Cartesian coordinate system or in a three-dimensional cylindrical coordinate system." +type CartesianPoint { + """ + The coordinate reference systems (CRS) + ------------------------------------- + possible values: + * `cartesian`: A 2D point in the Cartesian CRS is specified with a map containing x and y coordinate values + * `cartesian-3d`: A 3D point in the Cartesian CRS is specified with a map containing x, y and z coordinate values + """ + crs: String! + """ + The internal Neo4j ID for the CRS + One of: + * `7203`: represents CRS `cartesian` + * `9157`: represents CRS `cartesian-3d` + """ + srid: Int! + x: Float! + y: Float! + z: Float +} + +type Machine { + partLocations: [CartesianPoint!]! +} + +type MachineEdge { + cursor: String! + node: Machine! +} + +type MachinesConnection { + edges: [MachineEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +"Pagination information (Relay)" +type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String +} + +type Query { + machines(options: MachineOptions, where: MachineWhere): [Machine!]! + machinesConnection(after: String, first: Int, where: MachineWhere): MachinesConnection! +} + +"Input type for a cartesian point" +input CartesianPointInput { + x: Float! + y: Float! + z: Float +} + +input MachineOptions { + limit: Int + offset: Int +} + +input MachineWhere { + AND: [MachineWhere!] + NOT: MachineWhere + OR: [MachineWhere!] + partLocations: [CartesianPointInput!] + partLocations_INCLUDES: CartesianPointInput +} + +---- + +''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/point/cartesianpoint.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/point/cartesianpoint.adoc deleted file mode 100644 index 73f2539e..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/types/point/cartesianpoint.adoc +++ /dev/null @@ -1,121 +0,0 @@ -:toc: - -= Point -> CartesianPoint - -== Source schema - -[source,graphql,schema=true] ----- -type Machine { - partLocation: CartesianPoint! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -"A point in a two- or three-dimensional Cartesian coordinate system or in a three-dimensional cylindrical coordinate system." -type CartesianPoint { - """ - The coordinate reference systems (CRS) - ------------------------------------- - possible values: - * `cartesian`: A 2D point in the Cartesian CRS is specified with a map containing x and y coordinate values - * `cartesian-3d`: A 3D point in the Cartesian CRS is specified with a map containing x, y and z coordinate values - """ - crs: String! - """ - The internal Neo4j ID for the CRS - One of: - * `7203`: represents CRS `cartesian` - * `9157`: represents CRS `cartesian-3d` - """ - srid: Int! - x: Float! - y: Float! - z: Float -} - -type Machine { - partLocation: CartesianPoint! -} - -type MachineEdge { - cursor: String! - node: Machine! -} - -type MachinesConnection { - edges: [MachineEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - machines(options: MachineOptions, where: MachineWhere): [Machine!]! - machinesConnection(after: String, first: Int, sort: [MachineSort], where: MachineWhere): MachinesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -"Input type for a cartesian point with a distance" -input CartesianPointDistance { - distance: Float! - point: CartesianPointInput! -} - -"Input type for a cartesian point" -input CartesianPointInput { - x: Float! - y: Float! - z: Float -} - -input MachineOptions { - limit: Int - offset: Int - "Specify one or more MachineSort objects to sort Machines by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MachineSort!] -} - -"Fields to sort Machines by. The order in which sorts are applied is not guaranteed when specifying many fields in one MachineSort object." -input MachineSort { - partLocation: SortDirection -} - -input MachineWhere { - AND: [MachineWhere!] - NOT: MachineWhere - OR: [MachineWhere!] - partLocation: CartesianPointInput - partLocation_DISTANCE: CartesianPointDistance - partLocation_GT: CartesianPointDistance - partLocation_GTE: CartesianPointDistance - partLocation_IN: [CartesianPointInput!] - partLocation_LT: CartesianPointDistance - partLocation_LTE: CartesianPointDistance -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/point/cartesianpoints.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/point/cartesianpoints.adoc deleted file mode 100644 index 33f5e1c3..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/types/point/cartesianpoints.adoc +++ /dev/null @@ -1,95 +0,0 @@ -:toc: - -= Point -> CartesianPoints - -== Source schema - -[source,graphql,schema=true] ----- -type Machine { - partLocations: [CartesianPoint!]! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -"A point in a two- or three-dimensional Cartesian coordinate system or in a three-dimensional cylindrical coordinate system." -type CartesianPoint { - """ - The coordinate reference systems (CRS) - ------------------------------------- - possible values: - * `cartesian`: A 2D point in the Cartesian CRS is specified with a map containing x and y coordinate values - * `cartesian-3d`: A 3D point in the Cartesian CRS is specified with a map containing x, y and z coordinate values - """ - crs: String! - """ - The internal Neo4j ID for the CRS - One of: - * `7203`: represents CRS `cartesian` - * `9157`: represents CRS `cartesian-3d` - """ - srid: Int! - x: Float! - y: Float! - z: Float -} - -type Machine { - partLocations: [CartesianPoint!]! -} - -type MachineEdge { - cursor: String! - node: Machine! -} - -type MachinesConnection { - edges: [MachineEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -type Query { - machines(options: MachineOptions, where: MachineWhere): [Machine!]! - machinesConnection(after: String, first: Int, where: MachineWhere): MachinesConnection! -} - -"Input type for a cartesian point" -input CartesianPointInput { - x: Float! - y: Float! - z: Float -} - -input MachineOptions { - limit: Int - offset: Int -} - -input MachineWhere { - AND: [MachineWhere!] - NOT: MachineWhere - OR: [MachineWhere!] - partLocations: [CartesianPointInput!] - partLocations_INCLUDES: CartesianPointInput -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/point/point.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/point/point.adoc deleted file mode 100644 index 8904458e..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/types/point/point.adoc +++ /dev/null @@ -1,140 +0,0 @@ -:toc: - -= Point - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - filmedAt: Point! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - filmedAt: Point! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -"A point in a coordinate system." -type Point { - """ - The coordinate reference systems (CRS) - ------------------------------------- - possible values: - * `wgs-84`: A 2D geographic point in the WGS 84 CRS is specified by: longitude and latitude - * `wgs-84-3d`: A 3D geographic point in the WGS 84 CRS is specified by longitude, latitude and height - """ - crs: String! - "The third element of the Coordinate for geographic CRS, meters above the ellipsoid defined by the datum (WGS-84)" - height: Float - """ - The second element of the Coordinate for geographic CRS, degrees North of the equator - Range -90.0 to 90.0 - """ - latitude: Float! - """ - The first element of the Coordinate for geographic CRS, degrees East of the prime meridian - Range -180.0 to 180.0 - """ - longitude: Float! - """ - The internal Neo4j ID for the CRS - One of: - * `4326`: represents CRS `wgs-84` - * `4979`: represents CRS `wgs-84-3d` - """ - srid: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, sort: [MovieSort], where: MovieWhere): MoviesConnection! -} - -"An enum for sorting in either ascending or descending order." -enum SortDirection { - "Sort by field values in ascending order." - ASC - "Sort by field values in descending order." - DESC -} - -input MovieOptions { - limit: Int - offset: Int - "Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array." - sort: [MovieSort!] -} - -"Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object." -input MovieSort { - filmedAt: SortDirection -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - filmedAt: PointInput - filmedAt_DISTANCE: PointDistance - filmedAt_GT: PointDistance - filmedAt_GTE: PointDistance - filmedAt_IN: [PointInput!] - filmedAt_LT: PointDistance - filmedAt_LTE: PointDistance -} - -"Input type for a point with a distance" -input PointDistance { - "The distance in metres to be used when comparing two points" - distance: Float! - point: PointInput! -} - -"Input type for a point" -input PointInput { - "The third element of the Coordinate for geographic CRS, meters above the ellipsoid defined by the datum (WGS-84)" - height: Float - """ - The second element of the Coordinate for geographic CRS, degrees North of the equator - Range -90.0 to 90.0 - """ - latitude: Float! - """ - The first element of the Coordinate for geographic CRS, degrees East of the prime meridian - Range -180.0 to 180.0 - """ - longitude: Float! -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/point/points.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/point/points.adoc deleted file mode 100644 index eb46eebd..00000000 --- a/core/src/test/resources/tck-test-files/schema/v2/types/point/points.adoc +++ /dev/null @@ -1,113 +0,0 @@ -:toc: - -= Point -> Points - -== Source schema - -[source,graphql,schema=true] ----- -type Movie { - filmedAt: [Point!]! -} ----- - -== Augmented schema - -.Augmented Schema -[source,graphql] ----- -schema { - query: Query -} - -type Movie { - filmedAt: [Point!]! -} - -type MovieEdge { - cursor: String! - node: Movie! -} - -type MoviesConnection { - edges: [MovieEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -"Pagination information (Relay)" -type PageInfo { - endCursor: String - hasNextPage: Boolean! - hasPreviousPage: Boolean! - startCursor: String -} - -"A point in a coordinate system." -type Point { - """ - The coordinate reference systems (CRS) - ------------------------------------- - possible values: - * `wgs-84`: A 2D geographic point in the WGS 84 CRS is specified by: longitude and latitude - * `wgs-84-3d`: A 3D geographic point in the WGS 84 CRS is specified by longitude, latitude and height - """ - crs: String! - "The third element of the Coordinate for geographic CRS, meters above the ellipsoid defined by the datum (WGS-84)" - height: Float - """ - The second element of the Coordinate for geographic CRS, degrees North of the equator - Range -90.0 to 90.0 - """ - latitude: Float! - """ - The first element of the Coordinate for geographic CRS, degrees East of the prime meridian - Range -180.0 to 180.0 - """ - longitude: Float! - """ - The internal Neo4j ID for the CRS - One of: - * `4326`: represents CRS `wgs-84` - * `4979`: represents CRS `wgs-84-3d` - """ - srid: Int! -} - -type Query { - movies(options: MovieOptions, where: MovieWhere): [Movie!]! - moviesConnection(after: String, first: Int, where: MovieWhere): MoviesConnection! -} - -input MovieOptions { - limit: Int - offset: Int -} - -input MovieWhere { - AND: [MovieWhere!] - NOT: MovieWhere - OR: [MovieWhere!] - filmedAt: [PointInput!] - filmedAt_INCLUDES: PointInput -} - -"Input type for a point" -input PointInput { - "The third element of the Coordinate for geographic CRS, meters above the ellipsoid defined by the datum (WGS-84)" - height: Float - """ - The second element of the Coordinate for geographic CRS, degrees North of the equator - Range -90.0 to 90.0 - """ - latitude: Float! - """ - The first element of the Coordinate for geographic CRS, degrees East of the prime meridian - Range -180.0 to 180.0 - """ - longitude: Float! -} - ----- - -''' diff --git a/core/src/test/resources/tck-test-files/schema/v2/types/time.adoc b/core/src/test/resources/tck-test-files/schema/v2/types/time.adoc index 7d56c048..20bc01d5 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/types/time.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/types/time.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Time -== Source schema +== Time +.Schema [source,graphql,schema=true] ---- type Movie { @@ -12,8 +14,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -94,3 +94,4 @@ input MovieWhere { ---- ''' + diff --git a/core/src/test/resources/tck-test-files/schema/v2/unions.adoc b/core/src/test/resources/tck-test-files/schema/v2/unions.adoc index 0269b139..2213668f 100644 --- a/core/src/test/resources/tck-test-files/schema/v2/unions.adoc +++ b/core/src/test/resources/tck-test-files/schema/v2/unions.adoc @@ -1,9 +1,11 @@ :toc: +:toclevels: 42 = Unions -== Source schema +== Unions +.Schema [source,graphql,schema=true] ---- union Search = Movie | Genre @@ -19,8 +21,6 @@ type Movie { } ---- -== Augmented schema - .Augmented Schema [source,graphql] ---- @@ -193,3 +193,4 @@ input SearchWhere { ---- ''' + diff --git a/examples/dgs-spring-boot/pom.xml b/examples/dgs-spring-boot/pom.xml index 628dc431..8cd51fae 100644 --- a/examples/dgs-spring-boot/pom.xml +++ b/examples/dgs-spring-boot/pom.xml @@ -46,7 +46,7 @@ org.neo4j.driver neo4j-java-driver - 5.23.0 + 5.24.0 org.neo4j diff --git a/examples/dgs-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/dgsspringboot/datafetcher/AdditionalDataFetcherTest.kt b/examples/dgs-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/dgsspringboot/datafetcher/AdditionalDataFetcherTest.kt index 3ebb40af..20456cc1 100644 --- a/examples/dgs-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/dgsspringboot/datafetcher/AdditionalDataFetcherTest.kt +++ b/examples/dgs-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/dgsspringboot/datafetcher/AdditionalDataFetcherTest.kt @@ -145,6 +145,6 @@ internal class AdditionalDataFetcherTest( companion object { @Container - private val neo4jServer = Neo4jContainer("neo4j:5.23.0") + private val neo4jServer = Neo4jContainer("neo4j:5.24.0") } } diff --git a/examples/graphql-kotlin-spring-boot/pom.xml b/examples/graphql-kotlin-spring-boot/pom.xml index e6a91380..b34f302c 100644 --- a/examples/graphql-kotlin-spring-boot/pom.xml +++ b/examples/graphql-kotlin-spring-boot/pom.xml @@ -32,7 +32,7 @@ org.neo4j.driver neo4j-java-driver - 5.23.0 + 5.24.0 org.neo4j diff --git a/examples/graphql-kotlin-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/QueriesIT.kt b/examples/graphql-kotlin-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/QueriesIT.kt index 93538598..d19453b7 100644 --- a/examples/graphql-kotlin-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/QueriesIT.kt +++ b/examples/graphql-kotlin-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/QueriesIT.kt @@ -111,7 +111,7 @@ internal class QueriesIT( companion object { @Container - private val neo4jServer = Neo4jContainer("neo4j:5.23.0") + private val neo4jServer = Neo4jContainer("neo4j:5.24.0") } diff --git a/examples/graphql-spring-boot/pom.xml b/examples/graphql-spring-boot/pom.xml index ec7e1d2d..5ad478a7 100644 --- a/examples/graphql-spring-boot/pom.xml +++ b/examples/graphql-spring-boot/pom.xml @@ -50,7 +50,7 @@ org.neo4j.driver neo4j-java-driver - 5.23.0 + 5.24.0 org.neo4j diff --git a/examples/graphql-spring-boot/src/test/java/org/neo4j/graphql/examples/graphqlspringboot/datafetcher/AdditionalDataFetcherTest.java b/examples/graphql-spring-boot/src/test/java/org/neo4j/graphql/examples/graphqlspringboot/datafetcher/AdditionalDataFetcherTest.java index bd14d2bd..32fdd6d6 100644 --- a/examples/graphql-spring-boot/src/test/java/org/neo4j/graphql/examples/graphqlspringboot/datafetcher/AdditionalDataFetcherTest.java +++ b/examples/graphql-spring-boot/src/test/java/org/neo4j/graphql/examples/graphqlspringboot/datafetcher/AdditionalDataFetcherTest.java @@ -33,7 +33,7 @@ class AdditionalDataFetcherTest { private Driver driver; @Container - private static final Neo4jContainer neo4jServer = new Neo4jContainer<>("neo4j:5.23.0"); + private static final Neo4jContainer neo4jServer = new Neo4jContainer<>("neo4j:5.24.0"); @BeforeEach diff --git a/neo4j-graphql-neo4j-driver-adapter/src/main/kotlin/org/neo4j/graphql/driver/adapter/Neo4jDriverAdapter.kt b/neo4j-graphql-neo4j-driver-adapter/src/main/kotlin/org/neo4j/graphql/driver/adapter/Neo4jDriverAdapter.kt index 6e824ac3..f1715ae5 100644 --- a/neo4j-graphql-neo4j-driver-adapter/src/main/kotlin/org/neo4j/graphql/driver/adapter/Neo4jDriverAdapter.kt +++ b/neo4j-graphql-neo4j-driver-adapter/src/main/kotlin/org/neo4j/graphql/driver/adapter/Neo4jDriverAdapter.kt @@ -1,8 +1,14 @@ package org.neo4j.graphql.driver.adapter import org.neo4j.driver.SessionConfig +import org.neo4j.driver.internal.InternalIsoDuration +import org.neo4j.driver.types.IsoDuration import java.math.BigDecimal import java.math.BigInteger +import java.time.Duration +import java.time.Period +import java.time.temporal.ChronoUnit +import java.time.temporal.TemporalAmount class Neo4jDriverAdapter @JvmOverloads constructor( @@ -22,10 +28,41 @@ class Neo4jDriverAdapter @JvmOverloads constructor( } companion object { - private fun toBoltValue(value: Any?) = when (value) { + fun toBoltValue(value: Any?): Any? = when (value) { is BigInteger -> value.longValueExact() is BigDecimal -> value.toDouble() + is TemporalAmount -> when (value) { + is Duration, is Period, is IsoDuration -> value + else -> temporalAmountToIsoDuration(value) + } + is Iterable<*> -> value.map { toBoltValue(it) } + is Map<*, *> -> value.mapValues { toBoltValue(it.value) } else -> value } + + private fun temporalAmountToIsoDuration(value: TemporalAmount): InternalIsoDuration { + var months = 0L + var days = 0L + var seconds = 0L + var nanoseconds = 0 + value.units.forEach { unit -> + val amount = value.get(unit) + when (unit as? ChronoUnit ?: TODO("Unsupported TemporalAmount unit: $unit")) { + ChronoUnit.NANOS -> nanoseconds += amount.toInt() + ChronoUnit.MICROS -> nanoseconds += amount.toInt() * 1000 + ChronoUnit.MILLIS -> nanoseconds += amount.toInt() * 1000000 + ChronoUnit.SECONDS -> seconds += amount + ChronoUnit.MINUTES -> seconds += amount * 60 + ChronoUnit.HOURS -> seconds += amount * 3600 + ChronoUnit.HALF_DAYS -> seconds += amount * 43200 + ChronoUnit.DAYS -> days += amount + ChronoUnit.WEEKS -> days += amount * 7 + ChronoUnit.MONTHS -> months += amount + ChronoUnit.YEARS -> months += amount * 12 + else -> error("Unsupported TemporalAmount unit: $unit") + } + } + return InternalIsoDuration(months, days, seconds, nanoseconds) + } } } diff --git a/pom.xml b/pom.xml index 9c0dca20..812d0d91 100755 --- a/pom.xml +++ b/pom.xml @@ -25,8 +25,8 @@ 17 1.9.25 ${java.version} - 5.23.0 - 5.23.0 + 5.24.0 + 5.24.0 5.11.0 2024.2.0 From 72e5c243992de827d7a1283eed2d0bb0ea530741 Mon Sep 17 00:00:00 2001 From: Andreas Berger Date: Thu, 12 Dec 2024 17:32:01 +0100 Subject: [PATCH 3/7] small fixes --- core/pom.xml | 23 +++++++++++++++++++ .../schema/model/outputs/BaseSelection.kt | 7 ------ .../src/main/resources/lib_directives.graphql | 12 ---------- .../neo4j/graphql/utils/AsciiDocTestSuite.kt | 2 +- .../directives/customResolver.adoc | 2 +- .../filtering/advanced-filtering.adoc | 4 ++-- .../filtering/filter-union-relationship.adoc | 2 +- .../filtering/operations.adoc | 2 +- .../integration-test-files/issues/360.adoc | 2 +- .../integration-test-files/issues/4532.adoc | 2 +- .../issues/5223-cartesian.adoc | 2 +- .../issues/5223-point.adoc | 4 ++-- .../datafetcher/AdditionalDataFetcherTest.kt | 2 +- .../graphqlspringboot/controller/QueriesIT.kt | 2 +- .../AdditionalDataFetcherTest.java | 2 +- 15 files changed, 37 insertions(+), 33 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 90986318..089cea95 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -160,4 +160,27 @@ + + + + create-test-file-diff + + true + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.0 + + + true + + + + + + + diff --git a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/BaseSelection.kt b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/BaseSelection.kt index 07b24890..31c47c0f 100644 --- a/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/BaseSelection.kt +++ b/core/src/main/kotlin/org/neo4j/graphql/schema/model/outputs/BaseSelection.kt @@ -37,13 +37,6 @@ open class BaseSelection>( prop.get(selection).forEach { field -> result[field.aliasOrName] = nestedProjection(field) } } -// fun > field(prop: KProperty1>>, value: BaseSelection.() -> Unit) { -// prop.get(selection).forEach { field -> result[field.aliasOrName] = value() } -// } - -// fun project(value: BaseSelection<*>.() -> Any?) { -// prop.get(selection).forEach { field -> result[field.aliasOrName] = value(BaseSelection()) } -// } } } diff --git a/core/src/main/resources/lib_directives.graphql b/core/src/main/resources/lib_directives.graphql index a13d124f..49ba139e 100644 --- a/core/src/main/resources/lib_directives.graphql +++ b/core/src/main/resources/lib_directives.graphql @@ -39,14 +39,6 @@ directive @limit( max: Int ) on OBJECT | INTERFACE - -"Instructs neo4j-graphql-java to exclude create, delete or update operations from the mutation root type." -directive @mutation( - "Describe operations available for this type" - operations: [MutationFields!]! = [ DELETE ] -) on OBJECT | INTERFACE - - "Informs neo4j-graphql-java of node metadata" directive @node( "The labels to map this GraphQL type to in the Neo4j database", @@ -118,7 +110,3 @@ input LimitInput { "Maximum limit to be used for queries." max: Int } - -enum MutationFields { - DELETE -} diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt index ee55e85d..65de70e3 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt @@ -221,7 +221,7 @@ abstract class AsciiDocTestSuite( * to find broken tests easy by its console output, enable this feature */ val FLATTEN_TESTS = System.getProperty("neo4j-graphql-java.flatten-tests", "false") == "true" - val GENERATE_TEST_FILE_DIFF = System.getProperty("neo4j-graphql-java.generate-test-file-diff", "true") == "true" + val GENERATE_TEST_FILE_DIFF = System.getProperty("neo4j-graphql-java.generate-test-file-diff", "false") == "true" val REFORMAT_TEST_FILE = System.getProperty("neo4j-graphql-java.reformat", "false") == "true" val UPDATE_TEST_FILE = System.getProperty("neo4j-graphql-java.update-test-file", "false") == "true" val UPDATE_SEMANTIC_EQUALLY_BLOCKS = diff --git a/core/src/test/resources/integration-test-files/directives/customResolver.adoc b/core/src/test/resources/integration-test-files/directives/customResolver.adoc index 9134ad2a..7f32fdc3 100644 --- a/core/src/test/resources/integration-test-files/directives/customResolver.adoc +++ b/core/src/test/resources/integration-test-files/directives/customResolver.adoc @@ -898,7 +898,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "users": [ diff --git a/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc b/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc index 30fe96d7..ef9551e7 100644 --- a/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc +++ b/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc @@ -734,7 +734,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -793,7 +793,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc b/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc index 036fc4a5..75f68fd3 100644 --- a/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc +++ b/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc @@ -231,7 +231,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ diff --git a/core/src/test/resources/integration-test-files/filtering/operations.adoc b/core/src/test/resources/integration-test-files/filtering/operations.adoc index 03e6545c..c3a7ba0c 100644 --- a/core/src/test/resources/integration-test-files/filtering/operations.adoc +++ b/core/src/test/resources/integration-test-files/filtering/operations.adoc @@ -69,7 +69,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/issues/360.adoc b/core/src/test/resources/integration-test-files/issues/360.adoc index 8d30f926..05036ba5 100644 --- a/core/src/test/resources/integration-test-files/issues/360.adoc +++ b/core/src/test/resources/integration-test-files/issues/360.adoc @@ -112,7 +112,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "events": [ diff --git a/core/src/test/resources/integration-test-files/issues/4532.adoc b/core/src/test/resources/integration-test-files/issues/4532.adoc index 674e608a..f25aecae 100644 --- a/core/src/test/resources/integration-test-files/issues/4532.adoc +++ b/core/src/test/resources/integration-test-files/issues/4532.adoc @@ -273,7 +273,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "inventories": [ diff --git a/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc b/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc index 261adcdb..6f34a32f 100644 --- a/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc +++ b/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc @@ -166,7 +166,7 @@ RETURN { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "locationsConnection": { diff --git a/core/src/test/resources/integration-test-files/issues/5223-point.adoc b/core/src/test/resources/integration-test-files/issues/5223-point.adoc index 0a27d4e9..7ee8829a 100644 --- a/core/src/test/resources/integration-test-files/issues/5223-point.adoc +++ b/core/src/test/resources/integration-test-files/issues/5223-point.adoc @@ -166,7 +166,7 @@ RETURN { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "locationsConnection": { @@ -254,7 +254,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "locations": [ diff --git a/examples/dgs-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/dgsspringboot/datafetcher/AdditionalDataFetcherTest.kt b/examples/dgs-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/dgsspringboot/datafetcher/AdditionalDataFetcherTest.kt index 20456cc1..ecf3a895 100644 --- a/examples/dgs-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/dgsspringboot/datafetcher/AdditionalDataFetcherTest.kt +++ b/examples/dgs-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/dgsspringboot/datafetcher/AdditionalDataFetcherTest.kt @@ -145,6 +145,6 @@ internal class AdditionalDataFetcherTest( companion object { @Container - private val neo4jServer = Neo4jContainer("neo4j:5.24.0") + private val neo4jServer = Neo4jContainer("neo4j:5.24.1") } } diff --git a/examples/graphql-kotlin-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/QueriesIT.kt b/examples/graphql-kotlin-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/QueriesIT.kt index d19453b7..1d65f724 100644 --- a/examples/graphql-kotlin-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/QueriesIT.kt +++ b/examples/graphql-kotlin-spring-boot/src/test/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/QueriesIT.kt @@ -111,7 +111,7 @@ internal class QueriesIT( companion object { @Container - private val neo4jServer = Neo4jContainer("neo4j:5.24.0") + private val neo4jServer = Neo4jContainer("neo4j:5.24.1") } diff --git a/examples/graphql-spring-boot/src/test/java/org/neo4j/graphql/examples/graphqlspringboot/datafetcher/AdditionalDataFetcherTest.java b/examples/graphql-spring-boot/src/test/java/org/neo4j/graphql/examples/graphqlspringboot/datafetcher/AdditionalDataFetcherTest.java index 32fdd6d6..692418b6 100644 --- a/examples/graphql-spring-boot/src/test/java/org/neo4j/graphql/examples/graphqlspringboot/datafetcher/AdditionalDataFetcherTest.java +++ b/examples/graphql-spring-boot/src/test/java/org/neo4j/graphql/examples/graphqlspringboot/datafetcher/AdditionalDataFetcherTest.java @@ -33,7 +33,7 @@ class AdditionalDataFetcherTest { private Driver driver; @Container - private static final Neo4jContainer neo4jServer = new Neo4jContainer<>("neo4j:5.24.0"); + private static final Neo4jContainer neo4jServer = new Neo4jContainer<>("neo4j:5.24.1"); @BeforeEach From 4c1c56173a9b956d9da2b7b5345e42f18f7649e0 Mon Sep 17 00:00:00 2001 From: Andreas Berger Date: Thu, 12 Dec 2024 17:58:01 +0100 Subject: [PATCH 4/7] fixe integration tests --- .../integration-test-files/filtering/advanced-filtering.adoc | 4 ++-- .../src/test/resources/integration-test-files/issues/360.adoc | 2 +- .../integration-test-files/issues/5223-cartesian.adoc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc b/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc index ef9551e7..3f616277 100644 --- a/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc +++ b/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc @@ -1134,7 +1134,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -1410,7 +1410,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/issues/360.adoc b/core/src/test/resources/integration-test-files/issues/360.adoc index 05036ba5..c40b4c20 100644 --- a/core/src/test/resources/integration-test-files/issues/360.adoc +++ b/core/src/test/resources/integration-test-files/issues/360.adoc @@ -183,7 +183,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "events": [ diff --git a/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc b/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc index 6f34a32f..90479566 100644 --- a/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc +++ b/core/src/test/resources/integration-test-files/issues/5223-cartesian.adoc @@ -351,7 +351,7 @@ RETURN { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "locationsConnection": { From 1bc72941fe96f20b2e0757a10c7db871425e812a Mon Sep 17 00:00:00 2001 From: Andreas Berger Date: Thu, 12 Dec 2024 18:01:34 +0100 Subject: [PATCH 5/7] fix integration tests --- .../integration-test-files/custom-scalar-filtering.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc b/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc index aa448c49..e09a9fe3 100644 --- a/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc +++ b/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc @@ -285,7 +285,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ From 797a9743e93aac455988ee939a7f34be19c8927b Mon Sep 17 00:00:00 2001 From: Andreas Berger Date: Thu, 12 Dec 2024 18:08:09 +0100 Subject: [PATCH 6/7] resolve warning --- .../kotlin/org/neo4j/graphql/utils/GraphQLSchemaTestSuite.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/GraphQLSchemaTestSuite.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/GraphQLSchemaTestSuite.kt index 7c42aba9..9c3c7cf1 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/GraphQLSchemaTestSuite.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/GraphQLSchemaTestSuite.kt @@ -52,7 +52,7 @@ class GraphQLSchemaTestSuite(fileName: String) : AsciiDocTestSuite Date: Thu, 12 Dec 2024 19:20:49 +0100 Subject: [PATCH 7/7] add utility to set ignore-order for integration tests --- .../neo4j/graphql/utils/AsciiDocTestSuite.kt | 56 ++++++++++++------- .../neo4j/graphql/utils/CypherTestSuite.kt | 47 +++++++++++++++- .../graphql/utils/asciidoc/AsciiDocParser.kt | 2 + .../graphql/utils/asciidoc/ast/CodeBlock.kt | 12 +++- .../config-options/query-options.adoc | 2 +- .../connections/alias.adoc | 2 +- .../connections/unions.adoc | 6 +- .../custom-scalar-filtering.adoc | 4 +- .../directives/customResolver.adoc | 4 +- .../filtering/advanced-filtering.adoc | 14 ++--- .../filter-interface-relationship.adoc | 4 +- .../filtering/filter-union-relationship.adoc | 4 +- .../filtering/single-relationship.adoc | 2 +- .../filtering/typename-in.adoc | 4 +- .../integration-test-files/find.adoc | 4 +- .../interfaces/relationships/read.adoc | 4 +- .../integration-test-files/issues/1687.adoc | 2 +- .../integration-test-files/issues/207.adoc | 2 +- .../integration-test-files/issues/2820.adoc | 8 +-- .../integration-test-files/issues/4287.adoc | 2 +- .../integration-test-files/issues/583.adoc | 2 +- .../rfcs/query-limits.adoc | 2 +- .../types/points-cartesian.adoc | 4 +- .../integration-test-files/types/points.adoc | 2 +- .../unions/union-relationship-filtering.adoc | 2 +- .../unions/unions-top-level.adoc | 4 +- .../integration-test-files/unions/unions.adoc | 4 +- .../cypher/v2/experimental/typename-in.adoc | 4 +- 28 files changed, 137 insertions(+), 72 deletions(-) diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt index 65de70e3..121a87cd 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/AsciiDocTestSuite.kt @@ -25,7 +25,7 @@ import kotlin.reflect.KMutableProperty1 * @param relevantBlocks a list of pairs of filter functions and properties to set the found code blocks */ abstract class AsciiDocTestSuite( - private val fileName: String, + protected val fileName: String, private val relevantBlocks: List>, private val createMissingBlocks: Boolean = true ) { @@ -69,9 +69,14 @@ abstract class AsciiDocTestSuite( ) } + addAdditionalTests(tests) + return if (FLATTEN_TESTS) flatten(tests.stream(), "$fileName:") else tests.stream() } + open fun addAdditionalTests(tests: MutableList) { + } + private fun createTestsOfSection(section: Section, parentIgnoreReason: String? = null): List { val tests = mutableListOf() @@ -90,7 +95,7 @@ abstract class AsciiDocTestSuite( } is Table -> { - if (testCase != null){ + if (testCase != null) { setTableData(testCase, node) } } @@ -148,21 +153,17 @@ abstract class AsciiDocTestSuite( } private fun writeAdjustedTestFile() { - val content = generateAdjustedFileContent({ block -> - block.generatedContent.takeIf { - when { - UPDATE_SEMANTIC_EQUALLY_BLOCKS -> block.semanticEqual && (block.tandemUpdate?.semanticEqual ?: true) - else -> true - } - } - }) + val content = generateAdjustedFileContent( + { it.generatedContent }, + { !UPDATE_SEMANTIC_EQUALLY_BLOCKS || (it.semanticEqual && (it.tandemUpdate?.semanticEqual ?: true)) } + ) FileWriter(File("src/test/resources/", fileName)).use { it.write(content) } } private fun reformatTestFile() { - val content = generateAdjustedFileContent { it.reformattedContent } + val content = generateAdjustedFileContent({ it.reformattedContent }) FileWriter(File("src/test/resources/", fileName)).use { it.write(content) } @@ -179,19 +180,25 @@ abstract class AsciiDocTestSuite( } } - private fun generateAdjustedFileContent(extractor: (CodeBlock) -> String? = { it.generatedContent }): String { + protected fun generateAdjustedFileContent( + extractor: (CodeBlock) -> String? = { it.generatedContent }, + matcher: (CodeBlock) -> Boolean = { extractor(it) != null } + ): String { knownBlocks.sortWith(compareByDescending { it.start }) val rebuildTest = StringBuffer(document.content) - knownBlocks.filter { extractor(it) != null } + knownBlocks.filter { matcher(it) } .forEach { block -> val start = block.start ?: error("unknown start position") if (block.end == null) { rebuildTest.insert( start, - ".${block.caption}\n${block.marker}\n----\n${extractor(block)}\n----\n\n" + ".${block.caption}\n${block.adjustedMarker}\n----\n${extractor(block)}\n----\n\n" ) } else { rebuildTest.replace(start, block.end!!, extractor(block) + "\n") + if (block.markerStart != null) { + rebuildTest.replace(block.markerStart!!, block.markerEnd!!, block.adjustedMarker) + } } } return rebuildTest.toString() @@ -221,7 +228,8 @@ abstract class AsciiDocTestSuite( * to find broken tests easy by its console output, enable this feature */ val FLATTEN_TESTS = System.getProperty("neo4j-graphql-java.flatten-tests", "false") == "true" - val GENERATE_TEST_FILE_DIFF = System.getProperty("neo4j-graphql-java.generate-test-file-diff", "false") == "true" + val GENERATE_TEST_FILE_DIFF = + System.getProperty("neo4j-graphql-java.generate-test-file-diff", "false") == "true" val REFORMAT_TEST_FILE = System.getProperty("neo4j-graphql-java.reformat", "false") == "true" val UPDATE_TEST_FILE = System.getProperty("neo4j-graphql-java.update-test-file", "false") == "true" val UPDATE_SEMANTIC_EQUALLY_BLOCKS = @@ -229,11 +237,19 @@ abstract class AsciiDocTestSuite( val MAPPER = ObjectMapper() .registerKotlinModule() .registerModules(JavaTimeModule()) - .registerModule(SimpleModule().addSerializer(TemporalAmount::class.java, object : JsonSerializer() { - override fun serialize(value: TemporalAmount?, gen: JsonGenerator?, serializers: SerializerProvider?) { - gen?.writeString(value.toString()) - } - })) + .registerModule( + SimpleModule().addSerializer( + TemporalAmount::class.java, + object : JsonSerializer() { + override fun serialize( + value: TemporalAmount?, + gen: JsonGenerator?, + serializers: SerializerProvider? + ) { + gen?.writeString(value.toString()) + } + }) + ) .disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS) diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt index 74c3aa8c..691d9ddd 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/CypherTestSuite.kt @@ -1,5 +1,6 @@ package org.neo4j.graphql.utils +import com.fasterxml.jackson.module.kotlin.readValue import com.jayway.jsonpath.JsonPath import demo.org.neo4j.graphql.utils.InvalidQueryException import demo.org.neo4j.graphql.utils.asciidoc.ast.CodeBlock @@ -35,6 +36,7 @@ import org.neo4j.graphql.scalars.TemporalScalar import org.opentest4j.AssertionFailedError import org.threeten.extra.PeriodDuration import java.io.File +import java.io.FileWriter import java.math.BigInteger import java.time.* import java.time.format.DateTimeFormatter @@ -43,7 +45,6 @@ import java.time.temporal.TemporalAccessor import java.util.* import java.util.concurrent.FutureTask import java.util.function.Consumer -import java.util.regex.Pattern import kotlin.reflect.full.findAnnotation class CypherTestSuite(fileName: String, val driver: Driver? = null, createMissingBlocks: Boolean = true) : @@ -91,6 +92,12 @@ class CypherTestSuite(fileName: String, val driver: Driver? = null, createMissin } } + override fun addAdditionalTests(tests: MutableList) { + if (ADD_IGNORE_ORDER_TO_INTEGRATION_TESTS) { + tests += DynamicTest.dynamicTest("Create ignore-order", srcLocation, this::reformatMarker) + } + } + override fun createTests(testCase: TestCase, section: Section, ignoreReason: String?): List { if (testCase.graphqlRequest == null) { return emptyList() @@ -104,6 +111,18 @@ class CypherTestSuite(fileName: String, val driver: Driver? = null, createMissin val result = createTransformationTask(testCase) val tests = mutableListOf() + + if (ADD_IGNORE_ORDER_TO_INTEGRATION_TESTS) { + val hasOrder = testCase.cypher.any { it.content.contains("ORDER BY") } + val graphqlResponse = testCase.graphqlResponse + if (!hasOrder && graphqlResponse != null + && hasArrayWithMoreThenOneItems(MAPPER.readValue(graphqlResponse.content)) + ) { + graphqlResponse.adjustedAttributes = graphqlResponse.attributes.toMutableMap() + .also { it["ignore-order"] = null } + } + } + if (DEBUG) { tests.add(printGeneratedQuery(result)) tests.add(printReplacedParameter(result)) @@ -153,6 +172,22 @@ class CypherTestSuite(fileName: String, val driver: Driver? = null, createMissin return tests } + private fun hasArrayWithMoreThenOneItems(value: Any): Boolean { + when (value) { + is Map<*, *> -> { + return value.any { + val mapValue = it.value + mapValue != null && hasArrayWithMoreThenOneItems(mapValue) + } + } + + is Collection<*> -> { + return value.size > 1 || value.filterNotNull().any { hasArrayWithMoreThenOneItems(it) } + } + } + return false + } + private fun createSchema( schemaBlock: CodeBlock, schemaConfigBlock: CodeBlock?, @@ -509,11 +544,17 @@ class CypherTestSuite(fileName: String, val driver: Driver? = null, createMissin } } + + private fun reformatMarker() { + val content = generateAdjustedFileContent({ it.content }, { it.adjustedAttributes != null }) + FileWriter(File("src/test/resources/", fileName)).use { it.write(content) } + } + companion object { private val DEBUG = System.getProperty("neo4j-graphql-java.debug", "false") == "true" private val CONVERT_NUMBER = System.getProperty("neo4j-graphql-java.convert-number", "true") == "true" - - private val DURATION_PATTERN: Pattern = Pattern.compile("^P(.*?)(?:T(.*))?$") + private val ADD_IGNORE_ORDER_TO_INTEGRATION_TESTS = + System.getProperty("neo4j-graphql-java.add-ignore-order-to-integration-tests", "false") == "true" private val PARSE_OPTIONS = Options.newOptions() .createSortedMaps(true) diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/AsciiDocParser.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/AsciiDocParser.kt index 75d2e5bc..d392cc27 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/AsciiDocParser.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/AsciiDocParser.kt @@ -93,6 +93,8 @@ class AsciiDocParser( currentCodeBlock = CodeBlock(uri, language, currentSection, attributes).also { it.caption = caption + it.markerStart = offset + it.markerEnd = offset + line.length currentSection.blocks.add(it) } caption = null diff --git a/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/ast/CodeBlock.kt b/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/ast/CodeBlock.kt index fc34b733..e973423b 100644 --- a/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/ast/CodeBlock.kt +++ b/core/src/test/kotlin/org/neo4j/graphql/utils/asciidoc/ast/CodeBlock.kt @@ -11,6 +11,8 @@ class CodeBlock( var caption: String? = null + var markerStart: Int? = null + var markerEnd: Int? = null var start: Int? = null var end: Int? = null @@ -33,11 +35,15 @@ class CodeBlock( */ var tandemUpdate: CodeBlock? = null - val marker: String - get() = "[source,$language${attributes.map { ",${it.key}${it.value?.let { "=${it}" } ?: ""}" }.joinToString()}]" + var adjustedAttributes: MutableMap? = null + + val adjustedMarker: String + get() = "[source,$language${ + (adjustedAttributes ?: attributes).map { ",${it.key}${it.value?.let { "=${it}" } ?: ""}" }.joinToString("") + }]" override fun toString(): String { - return "CodeBlock(language='$language', attributes=$attributes)" + return "CodeBlock(language='$language', attributes=$attributes${adjustedAttributes?.let { ", adjustedAttributes=$it" } ?: ""})" } fun matches(language: String, filter: Map = emptyMap(), exactly: Boolean = false) = diff --git a/core/src/test/resources/integration-test-files/config-options/query-options.adoc b/core/src/test/resources/integration-test-files/config-options/query-options.adoc index 2e446771..ae2778b5 100644 --- a/core/src/test/resources/integration-test-files/config-options/query-options.adoc +++ b/core/src/test/resources/integration-test-files/config-options/query-options.adoc @@ -65,7 +65,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/connections/alias.adoc b/core/src/test/resources/integration-test-files/connections/alias.adoc index 4c5cd9f8..680e1cc2 100644 --- a/core/src/test/resources/integration-test-files/connections/alias.adoc +++ b/core/src/test/resources/integration-test-files/connections/alias.adoc @@ -1431,7 +1431,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "posts": [ diff --git a/core/src/test/resources/integration-test-files/connections/unions.adoc b/core/src/test/resources/integration-test-files/connections/unions.adoc index 40420f35..d5ad9583 100644 --- a/core/src/test/resources/integration-test-files/connections/unions.adoc +++ b/core/src/test/resources/integration-test-files/connections/unions.adoc @@ -133,7 +133,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "authors": [ @@ -927,7 +927,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "authors": [ @@ -1172,7 +1172,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "authors": [ diff --git a/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc b/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc index e09a9fe3..5da1be06 100644 --- a/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc +++ b/core/src/test/resources/integration-test-files/custom-scalar-filtering.adoc @@ -113,7 +113,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -229,7 +229,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/directives/customResolver.adoc b/core/src/test/resources/integration-test-files/directives/customResolver.adoc index 7f32fdc3..da1e8c48 100644 --- a/core/src/test/resources/integration-test-files/directives/customResolver.adoc +++ b/core/src/test/resources/integration-test-files/directives/customResolver.adoc @@ -658,7 +658,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "users": [ @@ -772,7 +772,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "users": [ diff --git a/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc b/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc index 3f616277..79783bed 100644 --- a/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc +++ b/core/src/test/resources/integration-test-files/filtering/advanced-filtering.adoc @@ -174,7 +174,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -232,7 +232,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -290,7 +290,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -477,7 +477,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -535,7 +535,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -852,7 +852,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -1305,7 +1305,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/filtering/filter-interface-relationship.adoc b/core/src/test/resources/integration-test-files/filtering/filter-interface-relationship.adoc index f39d9f5d..7dfcae9d 100644 --- a/core/src/test/resources/integration-test-files/filtering/filter-interface-relationship.adoc +++ b/core/src/test/resources/integration-test-files/filtering/filter-interface-relationship.adoc @@ -246,7 +246,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ @@ -588,7 +588,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ diff --git a/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc b/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc index 75f68fd3..d7809c71 100644 --- a/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc +++ b/core/src/test/resources/integration-test-files/filtering/filter-union-relationship.adoc @@ -366,7 +366,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ @@ -707,7 +707,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ diff --git a/core/src/test/resources/integration-test-files/filtering/single-relationship.adoc b/core/src/test/resources/integration-test-files/filtering/single-relationship.adoc index c172b5cf..acf43a31 100644 --- a/core/src/test/resources/integration-test-files/filtering/single-relationship.adoc +++ b/core/src/test/resources/integration-test-files/filtering/single-relationship.adoc @@ -83,7 +83,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/filtering/typename-in.adoc b/core/src/test/resources/integration-test-files/filtering/typename-in.adoc index e6edfc0e..b67889c8 100644 --- a/core/src/test/resources/integration-test-files/filtering/typename-in.adoc +++ b/core/src/test/resources/integration-test-files/filtering/typename-in.adoc @@ -115,7 +115,7 @@ RETURN this AS this ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "productions": [ @@ -210,7 +210,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ diff --git a/core/src/test/resources/integration-test-files/find.adoc b/core/src/test/resources/integration-test-files/find.adoc index 9e10c7eb..ed9ce2f5 100644 --- a/core/src/test/resources/integration-test-files/find.adoc +++ b/core/src/test/resources/integration-test-files/find.adoc @@ -63,7 +63,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -144,7 +144,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/interfaces/relationships/read.adoc b/core/src/test/resources/integration-test-files/interfaces/relationships/read.adoc index 32ba0111..be1c7e06 100644 --- a/core/src/test/resources/integration-test-files/interfaces/relationships/read.adoc +++ b/core/src/test/resources/integration-test-files/interfaces/relationships/read.adoc @@ -115,7 +115,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ @@ -439,7 +439,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ diff --git a/core/src/test/resources/integration-test-files/issues/1687.adoc b/core/src/test/resources/integration-test-files/issues/1687.adoc index eae8ee8b..384ca375 100644 --- a/core/src/test/resources/integration-test-files/issues/1687.adoc +++ b/core/src/test/resources/integration-test-files/issues/1687.adoc @@ -68,7 +68,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "genres": [ diff --git a/core/src/test/resources/integration-test-files/issues/207.adoc b/core/src/test/resources/integration-test-files/issues/207.adoc index 72d17ace..5203fc30 100644 --- a/core/src/test/resources/integration-test-files/issues/207.adoc +++ b/core/src/test/resources/integration-test-files/issues/207.adoc @@ -40,7 +40,7 @@ query GetSearchResults { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "search": [ diff --git a/core/src/test/resources/integration-test-files/issues/2820.adoc b/core/src/test/resources/integration-test-files/issues/2820.adoc index 615a17bc..a3312eeb 100644 --- a/core/src/test/resources/integration-test-files/issues/2820.adoc +++ b/core/src/test/resources/integration-test-files/issues/2820.adoc @@ -287,7 +287,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ @@ -459,7 +459,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ @@ -738,7 +738,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ @@ -915,7 +915,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ diff --git a/core/src/test/resources/integration-test-files/issues/4287.adoc b/core/src/test/resources/integration-test-files/issues/4287.adoc index 1a8bdc56..d6f47ba7 100644 --- a/core/src/test/resources/integration-test-files/issues/4287.adoc +++ b/core/src/test/resources/integration-test-files/issues/4287.adoc @@ -119,7 +119,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ diff --git a/core/src/test/resources/integration-test-files/issues/583.adoc b/core/src/test/resources/integration-test-files/issues/583.adoc index 0d5e009c..20b12d70 100644 --- a/core/src/test/resources/integration-test-files/issues/583.adoc +++ b/core/src/test/resources/integration-test-files/issues/583.adoc @@ -132,7 +132,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "actors": [ diff --git a/core/src/test/resources/integration-test-files/rfcs/query-limits.adoc b/core/src/test/resources/integration-test-files/rfcs/query-limits.adoc index 748bbbae..4c55e05a 100644 --- a/core/src/test/resources/integration-test-files/rfcs/query-limits.adoc +++ b/core/src/test/resources/integration-test-files/rfcs/query-limits.adoc @@ -52,7 +52,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/integration-test-files/types/points-cartesian.adoc b/core/src/test/resources/integration-test-files/types/points-cartesian.adoc index 76637a1c..f9d2540b 100644 --- a/core/src/test/resources/integration-test-files/types/points-cartesian.adoc +++ b/core/src/test/resources/integration-test-files/types/points-cartesian.adoc @@ -78,7 +78,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "parts": [ @@ -205,7 +205,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "parts": [ diff --git a/core/src/test/resources/integration-test-files/types/points.adoc b/core/src/test/resources/integration-test-files/types/points.adoc index f513b5b5..a64d7594 100644 --- a/core/src/test/resources/integration-test-files/types/points.adoc +++ b/core/src/test/resources/integration-test-files/types/points.adoc @@ -78,7 +78,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "routes": [ diff --git a/core/src/test/resources/integration-test-files/unions/union-relationship-filtering.adoc b/core/src/test/resources/integration-test-files/unions/union-relationship-filtering.adoc index dd1fb54f..77df3428 100644 --- a/core/src/test/resources/integration-test-files/unions/union-relationship-filtering.adoc +++ b/core/src/test/resources/integration-test-files/unions/union-relationship-filtering.adoc @@ -104,7 +104,7 @@ RETURN this AS this ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "productions": [ diff --git a/core/src/test/resources/integration-test-files/unions/unions-top-level.adoc b/core/src/test/resources/integration-test-files/unions/unions-top-level.adoc index 218c364e..baa6749b 100644 --- a/core/src/test/resources/integration-test-files/unions/unions-top-level.adoc +++ b/core/src/test/resources/integration-test-files/unions/unions-top-level.adoc @@ -104,7 +104,7 @@ RETURN this AS this ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "searches": [ @@ -204,7 +204,7 @@ RETURN this AS this ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "searches": [ diff --git a/core/src/test/resources/integration-test-files/unions/unions.adoc b/core/src/test/resources/integration-test-files/unions/unions.adoc index 577bcc70..056b785c 100644 --- a/core/src/test/resources/integration-test-files/unions/unions.adoc +++ b/core/src/test/resources/integration-test-files/unions/unions.adoc @@ -81,7 +81,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ @@ -185,7 +185,7 @@ RETURN this { ---- .GraphQL-Response -[source,json,response=true] +[source,json,response=true,ignore-order] ---- { "movies": [ diff --git a/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc b/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc index 49fd6719..8a10037b 100644 --- a/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc +++ b/core/src/test/resources/tck-test-files/cypher/v2/experimental/typename-in.adoc @@ -138,8 +138,8 @@ MATCH (this:Actor) WHERE EXISTS { MATCH (this)-[edge:ACTED_IN]->(this0) WHERE ((edge.screenTime = $param0 - OR (this0.title = $param1 - OR this0:Series)) + OR this0.title = $param1 + OR this0:Series) AND (this0:Cartoon OR this0:Movie OR this0:Series))