Sort schema
This commit is contained in:
parent
fe0bd6a66e
commit
b176929557
1 changed files with 14 additions and 8 deletions
|
@ -70,20 +70,26 @@ class SchemaBuilder
|
||||||
$register->set($collectionsDirtyKey, static fn() => false);
|
$register->set($collectionsDirtyKey, static fn() => false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$queryFields = \array_merge_recursive(
|
||||||
|
$apiSchema['query'],
|
||||||
|
$collectionSchema['query']
|
||||||
|
);
|
||||||
|
$mutationFields = \array_merge_recursive(
|
||||||
|
$apiSchema['mutation'],
|
||||||
|
$collectionSchema['mutation']
|
||||||
|
);
|
||||||
|
|
||||||
|
\ksort($queryFields);
|
||||||
|
\ksort($mutationFields);
|
||||||
|
|
||||||
$schema = new Schema([
|
$schema = new Schema([
|
||||||
'query' => new ObjectType([
|
'query' => new ObjectType([
|
||||||
'name' => 'Query',
|
'name' => 'Query',
|
||||||
'fields' => \array_merge_recursive(
|
'fields' => $queryFields
|
||||||
$apiSchema['query'],
|
|
||||||
$collectionSchema['query']
|
|
||||||
)
|
|
||||||
]),
|
]),
|
||||||
'mutation' => new ObjectType([
|
'mutation' => new ObjectType([
|
||||||
'name' => 'Mutation',
|
'name' => 'Mutation',
|
||||||
'fields' => \array_merge_recursive(
|
'fields' => $mutationFields
|
||||||
$apiSchema['mutation'],
|
|
||||||
$collectionSchema['mutation']
|
|
||||||
)
|
|
||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue