Skip to content

Commit 6259e01

Browse files
committed
update readme.md
1 parent 2a60634 commit 6259e01

File tree

1 file changed

+16
-40
lines changed

1 file changed

+16
-40
lines changed

README.md

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,24 @@ based on the [reference implementation in JavaScript](https://github.com/graphql
99

1010
## Installation
1111

12-
**git clone:**
13-
14-
````bash
15-
git clone https://github.com/joonlabs/php-graphql.git
16-
````
17-
18-
after downloading include the autloader.php, e.g.:
19-
20-
````php
21-
require 'php-graphql/src/autoloader.php';
22-
````
23-
24-
## Hello world!
25-
26-
```php
27-
use GraphQL\Servers\Server;
28-
use GraphQL\Schemas\Schema;
29-
use GraphQL\Types\GraphQLString;
30-
use GraphQL\Types\GraphQLObjectType;
31-
use GraphQL\Fields\GraphQLTypeField;
32-
33-
// build the query type
34-
$QueryType = new GraphQLObjectType("Query", "Root Query", function (){
35-
return [
36-
new GraphQLTypeField(
37-
"hello",
38-
new GraphQLString(),
39-
"Your first hello world GraphQL-Application",
40-
function (){ return 'Hello world!'; }
41-
)
42-
];
43-
});
12+
Via **composer:**
13+
```bash
14+
composer require joonlabs/php-graphql
15+
```
4416

45-
// build the schema
46-
$schema = new Schema($QueryType);
17+
Via **git submodule:**
4718

48-
// start a server
49-
$server = new Server($schema);
50-
$server->listen();
19+
```bash
20+
git clone https://github.com/joonlabs/php-graphql.git
5121
```
5222

53-
That's it! Now the GraphQL server is ready to accept requests at the URL of the PHP script.
23+
For more information, see the [doc pages](https://joonlabs.github.io/php-graphql/docs/getting-started/)
5424

25+
## Documentation
26+
The library's documentation is available at [https://joonlabs.github.io/php-graphql/](https://joonlabs.github.io/php-graphql/) or in the [docs](https://github.com/joonlabs/php-graphql/tree/master/docs) folder.
27+
28+
## Examples
29+
Examples can be found in the [examples](https://github.com/joonlabs/php-graphql/tree/master/docs) directory and are additionally discussed in the [documentation](https://joonlabs.github.io/php-graphql/).
5530
## Backers and sponsors
5631

5732
<img src="https://joonlabs.com/php-graphql/backers/joon.png" alt="index.js logo" height="30"/><br>
@@ -60,5 +35,6 @@ see [joonlabs.com](https://joonlabs.com)
6035
<br>
6136
<img src="https://joonlabs.com/php-graphql/backers/leafx.png" alt="index.js logo" height="30"/><br>
6237
see [leafx.de](https://leafx.de)
63-
<br>
64-
<br>
38+
39+
#License
40+
Fore more infromation regarding the license, see the [LICENSE](https://github.com/joonlabs/php-graphql/blob/master/LICENSE) file.

0 commit comments

Comments
 (0)