Download the PHP package v16studios/graphql-laravel-bootstrapper without Composer
On this page you can find all versions of the php package v16studios/graphql-laravel-bootstrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download v16studios/graphql-laravel-bootstrapper
More information about v16studios/graphql-laravel-bootstrapper
Files in v16studios/graphql-laravel-bootstrapper
Package graphql-laravel-bootstrapper
Short Description A package for automatic schema configuration designed to work with rebing/graphql-laravel.
License LGPL-3.0-only
Homepage https://github.com/v16studios/graphql-laravel-bootstrapper
Informations about the package graphql-laravel-bootstrapper
GraphQL Laravel Bootstrapper
A package for automatic schema configuration designed to work with rebing/graphql-laravel. This project is tested with BrowserStack.
Installation
Run composer require v16studios/graphql-laravel-bootstrapper
in the terminal.
Publishing the package config file is optional but recommended if you would like to use a different namespace for your types, queries and mutations:
Publish the config file by running php artisan vendor:publish --tag=bootstrapper-config
in the terminal.
Afterwards you can modify the namespace(s) that the package uses to find your schema by editing the namespace_filters
key in the config/graphql-laravel-bootstrapper.php
file.
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The LGPL 3.0 License. Please see License File for more information.
Basic Usage
Instead of manually defining your GraphQL schema in the config files of the Rebing GraphQL package, you can use this package to automatically generate your schemas by implementing the various supplied interfaces on your types, queries and mutations.
For example you can define a 'global' type like so:
The getSchemaName
method should return the name of the schema that this type should be added to. If you return an empty string, the type will be added to all schemas making it a 'global' type.
You can then define a query like so:
Just like the type, the getSchemaName
method defined in the interface should return the name of the schema that this query should be added to. In this case we are adding it to the primary
schema. In the Rebing GraphQL configuration file we have defined primary
as the default schema name like this:
You can see that we haven't needed to define the User
type or the GetUser
query in the configuration file, they are automatically added by the bootstrapper.
Interfaces are provided for adding all types, queries and mutations as well as enums, graphql interfaces, unions and middleware (including http, execution and resolver middleware) to your schemas.
Please note these docs are a work in progress and will be updated in due course.
All versions of graphql-laravel-bootstrapper with dependencies
ext-json Version *
rebing/graphql-laravel Version ^9.6
spatie/laravel-package-tools Version ^1.0