Skip to content
This repository was archived by the owner on Mar 29, 2020. It is now read-only.

Commit 330d8bb

Browse files
committed
replace readme
1 parent 6fb6069 commit 330d8bb

File tree

1 file changed

+36
-25
lines changed

1 file changed

+36
-25
lines changed

README.md

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,63 @@
1-
# laravel-graphql-relay
1+
# laravel-grapql-relay #
22

3-
## Documentation currently under development
3+
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).
44

5-
Use Facebook [GraphQL](http://facebook.github.io/graphql/) with [React Relay](https://facebook.github.io/relay/). This package is used alongside [laravel-graphql](https://github.com/Folkloreatelier/laravel-graphql) 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).
5+
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.
66

7-
## Installation
7+
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!
8+
9+
### Installation ###
810

911
You must then modify your composer.json file and run composer update to include the latest version of the package in your project.
1012

11-
```json
13+
```php
1214
"require": {
13-
"nuwave/laravel-graphql-relay": "0.1.*"
15+
"nuwave/laravel-graphql-relay": "0.3.*"
1416
}
1517
```
1618

17-
Or you can use the ```composer require``` command from your terminal.
19+
Or you can use the composer require command from your terminal.
1820

19-
```json
21+
```
2022
composer require nuwave/laravel-graphql-relay
2123
```
2224

2325
Add the service provider to your ```app/config.php``` file
2426

25-
```php
26-
Nuwave\Relay\ServiceProvider::class
27+
```
28+
Nuwave\Relay\LaravelServiceProvider::class
2729
```
2830

29-
Add the following entries to your ```config/graphql.php``` file ([laravel-graphql configuration file](https://github.com/Folkloreatelier/laravel-graphql#installation-1))
31+
Add the Relay & GraphQL facade to your app/config.php file
3032

31-
```php
33+
```
34+
'GraphQL' => Nuwave\Relay\Facades\GraphQL::class,
35+
'Relay' => Nuwave\Relay\Facades\Relay::class,
36+
```
37+
38+
Publish the configuration file
39+
40+
```
41+
php artisan vendor:publish --provider="Nuwave\Relay\LaravelServiceProvider"
42+
```
43+
44+
Create a ```schema.php``` file and add the path to the config
45+
46+
```
47+
// config/relay.php
48+
// ...
3249
'schema' => [
33-
'query' => [
34-
// ...
35-
'node' => Nuwave\Relay\Node\NodeQuery::class,
36-
],
37-
// ...
50+
'path' => 'Http/schema.php',
51+
'output' => null,
3852
],
39-
'types' => [
40-
// ...
41-
'node' => Nuwave\Relay\Node\NodeType::class,
42-
'pageInfo' => Nuwave\Relay\Types\PageInfoType::class,
43-
]
4453
```
4554

46-
To generate a ```schema.json``` file (used with the [Babel Relay Plugin](https://facebook.github.io/relay/docs/guides-babel-plugin.html#content))
55+
To generate a ```schema.json``` file (used with the Babel Relay Plugin):
4756

48-
```php
57+
```
4958
php artisan relay:schema
5059
```
5160

52-
For additional documentation, please read the [Wiki](https://github.com/nuwave/laravel-graphql-relay/wiki/1.-GraphQL-and-Relay)
61+
*You can customize the output path in the ```relay.php``` config file under ```schema.output```*
62+
63+
For additional documentation, look through the docs folder or read the Wiki.

0 commit comments

Comments
 (0)