Download the PHP package tylerfiekens/graphqlite-laravel without Composer
On this page you can find all versions of the php package tylerfiekens/graphqlite-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tylerfiekens/graphqlite-laravel
More information about tylerfiekens/graphqlite-laravel
Files in tylerfiekens/graphqlite-laravel
Package graphqlite-laravel
Short Description A Laravel service provider package to help you get started with GraphQLite in Laravel.
License MIT
Homepage https://github.com/thecodingmachine/graphqlite
Informations about the package graphqlite-laravel
Laravel GraphQLite bindings
GraphQLite integration package for Laravel.
This package is based on the work of the friendly folks over at TheCodingMachine.
Installation
Publish the configuration file
Usage
The package will automatically register the routes for the GraphQL endpoint. You can access the GraphQL endpoint at /graphql.
By default, the package will look for your GraphQL types in the App\GraphQL\Types namespace, and your queries and mutations in the App\GraphQL\Queries and App\GraphQL\Mutations namespaces respectively.
You can change these settings in the config/graphqlite.php configuration file.
Types
To create a new type, you can just create a new class in the App\GraphQL\Types namespace.
The only requirement is that the class must have a #[Type] annotation, which is used to register the type in the schema.
To add fields to the type, you can create public methods with a #[Field] annotation. The method name will be used as the field name.
That's it! The type will be automatically registered in the schema.
Queries
Now let's create a query to fetch an example object.
By default, the package will look for queries in the App\GraphQL\Queries namespace.
Queries are created in the same way as types, but with a #[Query] annotation instead of a #[Type] annotation.
The query will be automatically registered in the schema. You can now query it in your GraphQL client.
Mutations
Now let's create a mutation to create a new example object.
By default, the package will look for mutations in the App\GraphQL\Mutations namespace.
Mutations are created in the same way as queries, but with a #[Mutation] annotation instead of a #[Query] annotation.
The mutation will be automatically registered in the schema. You can now call it in your GraphQL client.
All versions of graphqlite-laravel with dependencies
thecodingmachine/graphqlite Version ^v7.0.0
illuminate/console Version ^11
illuminate/container Version ^11
illuminate/support Version ^11
illuminate/cache Version ^11
symfony/psr-http-message-bridge Version ^6
laminas/laminas-diactoros Version ^3.5
symfony/cache Version ^6
psr/container Version ^2.0.2
ecodev/graphql-upload Version ^7.0