@@ -108,6 +108,28 @@ public function formContentTypes(): iterable
108108 yield ['application/x-www-form-urlencoded;bla;blub ' ];
109109 }
110110
111+ public function testPostWithBatchedRequest (): void
112+ {
113+ $ fooQuery = /** @lang GraphQL */ '{ foo } ' ;
114+ $ barQuery = /** @lang GraphQL */ '{ bar } ' ;
115+ $ request = $ this ->makeRequest (
116+ 'POST ' ,
117+ [],
118+ [],
119+ ['Content-Type ' => 'application/json ' ],
120+ \Safe \json_encode ([
121+ ['query ' => $ fooQuery ],
122+ ['query ' => $ barQuery ],
123+ ])
124+ );
125+ $ params = (new RequestParser ())->parseRequest ($ request );
126+
127+ self ::assertIsArray ($ params );
128+ [$ fooParams , $ barParams ] = $ params ;
129+ self ::assertSame ($ fooQuery , $ fooParams ->query );
130+ self ::assertSame ($ barQuery , $ barParams ->query );
131+ }
132+
111133 public function testPostDefaultsToRegularForm (): void
112134 {
113135 $ query = /** @lang GraphQL */ '{ foo } ' ;
@@ -291,7 +313,7 @@ public function testMultipartFormWithoutOperations(): void
291313 * @param array<mixed> $headers
292314 * @param string|resource|null $content
293315 */
294- public function makeRequest (string $ method , array $ parameters = [], array $ files = [], array $ headers = [], $ content = null ): Request
316+ private function makeRequest (string $ method , array $ parameters = [], array $ files = [], array $ headers = [], $ content = null ): Request
295317 {
296318 $ symfonyRequest = SymfonyRequest::create (
297319 'http://foo.bar/graphql ' ,
0 commit comments