| @@ 62-69 (lines=8) @@ | ||
| 59 | public function getSchema() { |
|
| 60 | $config = new SchemaConfig(); |
|
| 61 | ||
| 62 | if ($mutations = $this->getMutations()) { |
|
| 63 | $config->setMutation(new ObjectType([ |
|
| 64 | 'name' => 'MutationRoot', |
|
| 65 | 'fields' => function () use ($mutations) { |
|
| 66 | return $this->schemaBuilder->resolveFields($mutations); |
|
| 67 | } |
|
| 68 | ])); |
|
| 69 | } |
|
| 70 | ||
| 71 | if ($query = $this->getRootFields()) { |
|
| 72 | $config->setQuery(new ObjectType([ |
|
| @@ 71-78 (lines=8) @@ | ||
| 68 | ])); |
|
| 69 | } |
|
| 70 | ||
| 71 | if ($query = $this->getRootFields()) { |
|
| 72 | $config->setQuery(new ObjectType([ |
|
| 73 | 'name' => 'QueryRoot', |
|
| 74 | 'fields' => function () use ($query) { |
|
| 75 | return $this->schemaBuilder->resolveFields($query); |
|
| 76 | } |
|
| 77 | ])); |
|
| 78 | } |
|
| 79 | ||
| 80 | $config->setTypes(function () { |
|
| 81 | return $this->getTypes(); |
|