1
0
Fork 0
mirror of synced 2024-06-01 18:39:57 +12:00
This commit is contained in:
Jake Barnby 2022-10-25 16:35:00 +13:00
parent e3b5919e40
commit b6e7e84d50
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 3 additions and 2 deletions

View file

@ -4,7 +4,7 @@ The GraphQL services allows you to manipulate your Appwrite instance through a s
>
> The major difference comes from the way the data is returned. GraphQL returns the data in a structured format, giving you only the nodes you ask for, while REST returns the data in a flat format.
>
> GraphQL has a single endpoint for all queries and mutations except file uploads, while the REST API has multiple endpoints for each type of action.
> GraphQL has a single endpoint for all queries and mutations, while the REST API has multiple endpoints for each type of action.
>
> Both APIs are fully compatible with each other, and you can use them together in the same project.
>

View file

@ -153,6 +153,7 @@ class Mapper
];
}
// If model has no properties, explicitly add a 'status' field because GraphQL requires at least 1 field per type.
if (!$model->isAny() && empty($model->getRules())) {
$fields['status'] = [
'type' => Type::string(),
@ -362,7 +363,7 @@ class Mapper
private static function getUnionImplementation(string $name, array $object): Type
{
// FIXME: Find a different way to do this
// TODO: Find a better way to do this
switch ($name) {
case 'Attributes':