1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00
appwrite/app/controllers/api/graphql.php

24 lines
592 B
PHP
Raw Normal View History

2020-01-04 10:16:26 +13:00
<?php
2020-06-29 05:31:21 +12:00
use Utopia\App;
2020-01-04 10:16:26 +13:00
/**
* TODO:
* 1. Map all objects, object-params, object-fields
* 2. Parse GraphQL request payload (use: https://github.com/webonyx/graphql-php)
* 3. Route request to relevant controllers (of REST API?) / resolvers and aggergate data
* 4. Handle errors if any
* 5. Returen JSON response
* 6. Write tests!
*/
2020-06-29 05:31:21 +12:00
App::post('/v1/graphql')
2020-01-04 10:16:26 +13:00
->desc('GraphQL Endpoint')
2020-06-26 06:32:12 +12:00
->groups(['api', 'graphql'])
2020-01-04 10:16:26 +13:00
->label('scope', 'public')
->action(
function () {
2020-01-04 20:44:03 +13:00
throw new Exception('GraphQL support is coming soon!', 502);
2020-01-04 10:16:26 +13:00
}
);