@@ -270,6 +270,41 @@ public function testGetTypes()
270270 public function testAddSchema ()
271271 {
272272 GraphQL::addSchema ('custom_add ' , [
273+ 'query ' => [
274+ 'examplesCustom ' => ExamplesQuery::class
275+ ],
276+ 'mutation ' => [
277+ 'updateExampleCustom ' => UpdateExampleMutation::class
278+ ],
279+ 'types ' => [
280+ CustomExampleType::class
281+ ]
282+ ]);
283+
284+ $ schemas = GraphQL::getSchemas ();
285+ $ this ->assertArrayHasKey ('custom_add ' , $ schemas );
286+ }
287+
288+ /**
289+ * Test merge schema
290+ *
291+ * @test
292+ */
293+ public function testMergeSchema ()
294+ {
295+ GraphQL::addSchema ('custom_add ' , [
296+ 'query ' => [
297+ 'examplesCustom ' => ExamplesQuery::class
298+ ],
299+ 'mutation ' => [
300+ 'updateExampleCustom ' => UpdateExampleMutation::class
301+ ],
302+ 'types ' => [
303+ CustomExampleType::class
304+ ]
305+ ]);
306+
307+ GraphQL::addSchema ('custom_add_another ' , [
273308 'query ' => [
274309 'examplesCustom ' => ExamplesQuery::class
275310 ],
@@ -283,6 +318,20 @@ public function testAddSchema()
283318
284319 $ schemas = GraphQL::getSchemas ();
285320 $ this ->assertArrayHasKey ('custom_add ' , $ schemas );
321+ $ this ->assertArrayHasKey ('custom_add_another ' , $ schemas );
322+
323+ GraphQL::addSchema ('custom_add_another ' , [
324+ 'query ' => [
325+ 'examplesCustomAnother ' => ExamplesQuery::class
326+ ]
327+ ]);
328+
329+ $ schemas = GraphQL::getSchemas ();
330+ $ this ->assertArrayHasKey ('custom_add_another ' , $ schemas );
331+
332+ $ querys = $ schemas ['custom_add_another ' ]['query ' ];
333+ $ this ->assertArrayHasKey ('examplesCustom ' , $ querys );
334+ $ this ->assertArrayHasKey ('examplesCustomAnother ' , $ querys );
286335 }
287336
288337 /**
0 commit comments