@@ -22,7 +22,7 @@ Feature: GraphQL query support
2222
2323 @createSchema
2424 Scenario : Retrieve an item with different relations to the same resource
25- Given there are 2 multiRelationsDummy objects having each a manyToOneRelation, 2 manyToManyRelations, 3 oneToManyRelations and 4 embeddedRelations
25+ Given there are 2 multiRelationsDummy objects having each 1 manyToOneRelation, 2 manyToManyRelations, 3 oneToManyRelations and 4 embeddedRelations
2626 When I send the following GraphQL request:
2727 """
2828 {
@@ -33,6 +33,10 @@ Feature: GraphQL query support
3333 id
3434 name
3535 }
36+ manyToOneResolveRelation {
37+ id
38+ name
39+ }
3640 manyToManyRelations {
3741 edges{
3842 node {
@@ -70,7 +74,7 @@ Feature: GraphQL query support
7074
7175 @createSchema
7276 Scenario : Retrieve embedded collections
73- Given there are 2 multiRelationsDummy objects having each a manyToOneRelation, 2 manyToManyRelations, 3 oneToManyRelations and 4 embeddedRelations
77+ Given there are 2 multiRelationsDummy objects having each 1 manyToOneRelation, 2 manyToManyRelations, 3 oneToManyRelations and 4 embeddedRelations
7478 When I send the following GraphQL request:
7579 """
7680 {
@@ -81,6 +85,10 @@ Feature: GraphQL query support
8185 id
8286 name
8387 }
88+ manyToOneResolveRelation {
89+ id
90+ name
91+ }
8492 manyToManyRelations {
8593 edges{
8694 node {
@@ -113,10 +121,13 @@ Feature: GraphQL query support
113121 Then the response status code should be 200
114122 And the response should be in JSON
115123 And the header "Content-Type" should be equal to "application/json"
124+ And the JSON node "errors" should not exist
116125 And the JSON node "data.multiRelationsDummy.id" should be equal to "/multi_relations_dummies/2"
117126 And the JSON node "data.multiRelationsDummy.name" should be equal to "Dummy #2"
118127 And the JSON node "data.multiRelationsDummy.manyToOneRelation.id" should not be null
119128 And the JSON node "data.multiRelationsDummy.manyToOneRelation.name" should be equal to "RelatedManyToOneDummy #2"
129+ And the JSON node "data.multiRelationsDummy.manyToOneResolveRelation.id" should not be null
130+ And the JSON node "data.multiRelationsDummy.manyToOneResolveRelation.name" should be equal to "RelatedManyToOneResolveDummy #2"
120131 And the JSON node "data.multiRelationsDummy.manyToManyRelations.edges" should have 2 element
121132 And the JSON node "data.multiRelationsDummy.manyToManyRelations.edges[1].node.id" should not be null
122133 And the JSON node "data.multiRelationsDummy.manyToManyRelations.edges[0].node.name" should match "#RelatedManyToManyDummy(1|2)2#"
@@ -135,6 +146,65 @@ Feature: GraphQL query support
135146 And the JSON node "data.multiRelationsDummy.nestedPaginatedCollection.edges[2].node.name" should be equal to "NestedPaginatedDummy3"
136147 And the JSON node "data.multiRelationsDummy.nestedPaginatedCollection.edges[3].node.name" should be equal to "NestedPaginatedDummy4"
137148
149+ @createSchema
150+ Scenario : Retrieve an item with different relations (all unset)
151+ Given there are 2 multiRelationsDummy objects having each 0 manyToOneRelation, 0 manyToManyRelations, 0 oneToManyRelations and 0 embeddedRelations
152+ When I send the following GraphQL request:
153+ """
154+ {
155+ multiRelationsDummy(id: "/multi_relations_dummies/2") {
156+ id
157+ name
158+ manyToOneRelation {
159+ id
160+ name
161+ }
162+ manyToOneResolveRelation {
163+ id
164+ name
165+ }
166+ manyToManyRelations {
167+ edges{
168+ node {
169+ id
170+ name
171+ }
172+ }
173+ }
174+ oneToManyRelations {
175+ edges{
176+ node {
177+ id
178+ name
179+ }
180+ }
181+ }
182+ nestedCollection {
183+ name
184+ }
185+ nestedPaginatedCollection {
186+ edges{
187+ node {
188+ name
189+ }
190+ }
191+ }
192+ }
193+ }
194+ """
195+ Then the response status code should be 200
196+ And the response should be in JSON
197+ And the header "Content-Type" should be equal to "application/json"
198+ And the JSON node "errors" should not exist
199+ And the JSON node "data.multiRelationsDummy.id" should be equal to "/multi_relations_dummies/2"
200+ And the JSON node "data.multiRelationsDummy.name" should be equal to "Dummy #2"
201+ And the JSON node "data.multiRelationsDummy.manyToOneRelation" should be null
202+ And the JSON node "data.multiRelationsDummy.manyToOneResolveRelation" should be null
203+ And the JSON node "data.multiRelationsDummy.manyToManyRelations.edges" should have 0 element
204+ And the JSON node "data.multiRelationsDummy.oneToManyRelations.edges" should have 0 element
205+ And the JSON node "data.multiRelationsDummy.nestedCollection" should have 0 element
206+ And the JSON node "data.multiRelationsDummy.nestedPaginatedCollection.edges" should have 0 element
207+
138208 @createSchema @!mongodb
139209 Scenario : Retrieve an item with child relation to the same resource
140210 Given there are tree dummies
0 commit comments