We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ad05305 + a74b570 commit c47b056Copy full SHA for c47b056
src/GraphQl/Type/SchemaBuilder.php
@@ -92,16 +92,21 @@ public function getSchema(): Schema
92
}
93
94
95
- return new Schema([
+ $schema = [
96
'query' => new ObjectType([
97
'name' => 'Query',
98
'fields' => $queryFields,
99
]),
100
- 'mutation' => new ObjectType([
+ ];
101
+
102
+ if ($mutationFields) {
103
+ $schema['mutation'] = new ObjectType([
104
'name' => 'Mutation',
105
'fields' => $mutationFields,
- ]),
- ]);
106
+ ]);
107
+ }
108
109
+ return new Schema($schema);
110
111
112
private function getNodeInterface(): InterfaceType
0 commit comments