@@ -22,7 +22,7 @@ Feature: GraphQL query support
22
22
23
23
@createSchema
24
24
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
26
26
When I send the following GraphQL request:
27
27
"""
28
28
{
@@ -33,6 +33,10 @@ Feature: GraphQL query support
33
33
id
34
34
name
35
35
}
36
+ manyToOneResolveRelation {
37
+ id
38
+ name
39
+ }
36
40
manyToManyRelations {
37
41
edges{
38
42
node {
@@ -70,7 +74,7 @@ Feature: GraphQL query support
70
74
71
75
@createSchema
72
76
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
74
78
When I send the following GraphQL request:
75
79
"""
76
80
{
@@ -81,6 +85,10 @@ Feature: GraphQL query support
81
85
id
82
86
name
83
87
}
88
+ manyToOneResolveRelation {
89
+ id
90
+ name
91
+ }
84
92
manyToManyRelations {
85
93
edges{
86
94
node {
@@ -113,10 +121,13 @@ Feature: GraphQL query support
113
121
Then the response status code should be 200
114
122
And the response should be in JSON
115
123
And the header "Content-Type" should be equal to "application/json"
124
+ And the JSON node "errors" should not exist
116
125
And the JSON node "data.multiRelationsDummy.id" should be equal to "/multi_relations_dummies/2"
117
126
And the JSON node "data.multiRelationsDummy.name" should be equal to "Dummy #2"
118
127
And the JSON node "data.multiRelationsDummy.manyToOneRelation.id" should not be null
119
128
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"
120
131
And the JSON node "data.multiRelationsDummy.manyToManyRelations.edges" should have 2 element
121
132
And the JSON node "data.multiRelationsDummy.manyToManyRelations.edges[1].node.id" should not be null
122
133
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
135
146
And the JSON node "data.multiRelationsDummy.nestedPaginatedCollection.edges[2].node.name" should be equal to "NestedPaginatedDummy3"
136
147
And the JSON node "data.multiRelationsDummy.nestedPaginatedCollection.edges[3].node.name" should be equal to "NestedPaginatedDummy4"
137
148
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
+
138
208
@createSchema @!mongodb
139
209
Scenario : Retrieve an item with child relation to the same resource
140
210
Given there are tree dummies
0 commit comments