mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
Address GraphQL
This commit is contained in:
parent
9d04c61cbe
commit
4c22088146
1 changed files with 20 additions and 22 deletions
|
|
@ -105,31 +105,29 @@ class Schema
|
|||
continue;
|
||||
}
|
||||
|
||||
$additionalMethods = null;
|
||||
if (is_array($sdk)) {
|
||||
$mainSdk = array_shift($sdk);
|
||||
$additionalMethods = $sdk;
|
||||
|
||||
$sdk = $mainSdk;
|
||||
if (!\is_array($sdk)) {
|
||||
$sdk = [$sdk];
|
||||
}
|
||||
|
||||
$namespace = $sdk->getNamespace();
|
||||
$method = $sdk->getMethodName();
|
||||
$name = $namespace . \ucfirst($method);
|
||||
foreach ($sdk as $method) {
|
||||
$namespace = $method->getNamespace();
|
||||
$methodName = $method->getMethodName();
|
||||
$name = $namespace . \ucfirst($methodName);
|
||||
|
||||
foreach (Mapper::route($utopia, $route, $complexity) as $field) {
|
||||
switch ($route->getMethod()) {
|
||||
case 'GET':
|
||||
$queries[$name] = $field;
|
||||
break;
|
||||
case 'POST':
|
||||
case 'PUT':
|
||||
case 'PATCH':
|
||||
case 'DELETE':
|
||||
$mutations[$name] = $field;
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("Unsupported method: {$route->getMethod()}");
|
||||
foreach (Mapper::route($utopia, $route, $complexity) as $field) {
|
||||
switch ($route->getMethod()) {
|
||||
case 'GET':
|
||||
$queries[$name] = $field;
|
||||
break;
|
||||
case 'POST':
|
||||
case 'PUT':
|
||||
case 'PATCH':
|
||||
case 'DELETE':
|
||||
$mutations[$name] = $field;
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("Unsupported method: {$route->getMethod()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue