Added empty graphql controller
This commit is contained in:
parent
3fefd2e764
commit
eff4c94066
|
@ -117,4 +117,11 @@ return [
|
|||
'sdk' => true,
|
||||
'tests' => false,
|
||||
],
|
||||
'v1/graphql' => [
|
||||
'name' => 'GraphQL',
|
||||
'description' => 'GraphQL Endpoint',
|
||||
'controller' => 'controllers/api/graphql.php',
|
||||
'sdk' => false,
|
||||
'tests' => false,
|
||||
],
|
||||
];
|
||||
|
|
22
app/controllers/api/graphql.php
Normal file
22
app/controllers/api/graphql.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
global $utopia;
|
||||
|
||||
/**
|
||||
* 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!
|
||||
*/
|
||||
|
||||
$utopia->post('/v1/graphql')
|
||||
->desc('GraphQL Endpoint')
|
||||
->label('scope', 'public')
|
||||
->action(
|
||||
function () {
|
||||
throw new Exception('Method not supported yet', 500);
|
||||
}
|
||||
);
|
Loading…
Reference in a new issue