File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,44 @@ interfaces {
137137 $ I ->assertNull ( $ field ['type ' ]['ofType ' ]['name ' ] );
138138 $ I ->assertSame ( 'PlantsCloneRoots ' , $ field ['type ' ]['name ' ] );
139139
140+ $ query = '
141+ query GetPageWithPlants($databaseId: ID!) {
142+ page(id:$databaseId idType:DATABASE_ID) {
143+ id
144+ title
145+ ...on WithAcfPlants {
146+ plants {
147+ name
148+ clonedRepeater {
149+ notClonedRepeater {
150+ anotherName
151+ }
152+ }
153+ notClonedRepeater {
154+ anotherName
155+ }
156+ }
157+ }
158+ }
159+ }
160+ ' ;
161+
162+ $ I ->haveHttpHeader ( 'Content-Type ' , 'application/json ' );
163+ $ I ->sendPost ( '/graphql ' , json_encode ([
164+ 'query ' => $ query ,
165+ 'variables ' => [
166+ 'databaseId ' => 0
167+ ]
168+ ]));
169+
170+ $ I ->seeResponseCodeIs ( 200 );
171+ $ I ->seeResponseIsJson ();
172+ $ response = $ I ->grabResponse ();
173+ $ response = json_decode ( $ response , true );
174+
175+ // Validate that the query above was valid, returned data, and no errors
176+ $ I ->assertNotEmpty ( $ response ['data ' ] );
177+ $ I ->assertArrayNotHasKey ( 'errors ' , $ response );
140178 }
141179
142180 public function findField ( $ name , $ fields ) {
You can’t perform that action at this time.
0 commit comments