Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuwave/laravel-graphql-relay
This project is deprecated in favor of https://github.com/nuwave/lighthouse
https://github.com/nuwave/laravel-graphql-relay
Last synced: about 1 month ago
JSON representation
This project is deprecated in favor of https://github.com/nuwave/lighthouse
- Host: GitHub
- URL: https://github.com/nuwave/laravel-graphql-relay
- Owner: nuwave
- Archived: true
- Created: 2015-11-16T14:51:41.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-29T10:22:42.000Z (over 4 years ago)
- Last Synced: 2024-08-01T22:50:57.073Z (4 months ago)
- Language: PHP
- Homepage:
- Size: 122 KB
- Stars: 44
- Watchers: 10
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-graphql - laravel-graphql-relay - A Laravel library to help construct a server supporting react-relay. (Libraries / PHP Libraries)
- awesome-graphql - laravel-graphql-relay - A Laravel library to help construct a server supporting react-relay. (Libraries / PHP Libraries)
README
# This project is deprecated in favor of https://github.com/nuwave/lighthouse
# laravel-grapql-relay
Use Facebook [GraphQL](http://facebook.github.io/graphql/) with [React Relay](https://facebook.github.io/relay/). This package extends graphql-php to work with Laravel and is currently **a work in progress**. You can reference what specifications GraphQL needs to provide to work with Relay in the [documentation](https://facebook.github.io/relay/docs/graphql-relay-specification.html#content).
Although this package no longer depends on [laraval-graphql](https://github.com/Folkloreatelier/laravel-graphql), it laid the foundation for this package which likely wouldn't exist without it. It is also a great alternative if you are using GraphQL w/o support for Relay.
Because this package is still in the early stages, breaking changes will occur. We will keep the documentation updated with the current release. Please feel free to contribute, PR are absolutely welcome!
### Installation ###
You must then modify your composer.json file and run composer update to include the latest version of the package in your project.
```php
"require": {
"nuwave/laravel-graphql-relay": "0.3.*"
}
```Or you can use the composer require command from your terminal.
```bash
composer require nuwave/laravel-graphql-relay
```Add the service provider to your ```config/app.php``` file
```php
Nuwave\Relay\LaravelServiceProvider::class
```Add the Relay & GraphQL facade to your app/config.php file
```php
'GraphQL' => Nuwave\Relay\Facades\GraphQL::class,
'Relay' => Nuwave\Relay\Facades\Relay::class,
```Publish the configuration file
```bash
php artisan vendor:publish --provider="Nuwave\Relay\LaravelServiceProvider"
```Create a ```schema.php``` file and add the path to the config. See the [Schema](https://github.com/nuwave/laravel-graphql-relay/wiki/3.-Schema#schema-file) wiki page for more information on `schema.php`.
```php
// config/relay.php
// ...
'schema' => [
'path' => 'Http/schema.php',
'output' => null,
],
```To generate a ```schema.json``` file (used with the Babel Relay Plugin):
```bash
php artisan relay:schema
```*You can customize the output path in the ```relay.php``` config file under ```schema.output```*
For additional documentation, look through the docs folder or read the Wiki.