Schema

TODO (Discuss overview of GraphQL Schema)

Schema Generation

In order for GraphQL to know about your types/mutations/queries/etc, we must register them with the schema.

schema()->group(['namespace' => 'App\\Http\\GraphQL', 'middleware' => ['auth']], function () {
    schema()->group(['namespace' => 'Types'], function () {
        schema()->type('user', 'UserType');
        schema()->type('viewer', 'ViewerType');
        schema()->type('task', 'TaskType');
    });

    schema()->group(['namespace' => 'Queries'], function () {
        schema()->query('viewer', 'ViewerQuery');
    });

    schema()->group(['namespace' => 'Mutations'], function () {
        schema()->mutation('createUser', 'CreateUserMutation');
    });
});

results matching ""

    No results matching ""