From 65eba6800939a870f97bac43445416b899f026ae Mon Sep 17 00:00:00 2001 From: Alexandr Viniychuk Date: Mon, 9 May 2016 09:00:07 -0400 Subject: [PATCH] documentation updates --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 962b6a4..cbd801a 100644 --- a/README.md +++ b/README.md @@ -34,33 +34,32 @@ graphql: resource: "@GraphQLBundle/Controller/" ``` -Let's check if you've done everything right so far – try to access the `localhost:8000/graphql` url. +Let's check if you've done everything right so far – try to access url `localhost:8000/graphql`. You should get a JSON response with the following error: ```js {"errors":[{"message":"You have to set GraphQL Schema to process"}]} ``` -That's because there was no GraphQL Schema specified for the processor yet. -You need to create a GraphQL Schema class and set it inside your `app/config/config.yml` file. +That's because there was no GraphQL Schema specified for the processor yet. You need to create a GraphQL Schema class and set it inside your `app/config/config.yml` file. -> THere is a way where you can use inline approach, in order to do that you have to define your own GraphQL controller and use a `->setSchema` method of the processor to set the Schema +> There is a way where you can use inline approach and do not create a Schema class, in order to do that you have to define your own GraphQL controller and use a `->setSchema` method of the processor to set the Schema. The fastest way to create a Schema class is to use a generator shipped with this bundle: ```sh -php bin/console graphql:schema:generate App +php bin/console graphql:schema:generate AppBundle ``` -Here *App* is a name of the bundle where the class will be generated in. +Here *AppBundle* is a name of the bundle where the class will be generated in. You will be requested for a confirmation to create a class and then presented with instructions to update your config file. -```sh -Update your app/config/config.yml with the parameter: +```yaml +# Update your app/config/config.yml with the parameter: graph_ql: schema_class: AppBundle\GraphQL\Schema ``` -After you've added parameters to config file, try to access the following link in the browser – 'http://localhost:8000/graphql?query={hello}' +After you've added parameters to config file, try to access the following link in the browser – `http://localhost:8000/graphql?query={hello}` -> Alternatively, you can execute the same request using CURL client in your console +> Alternatively, you can execute the same request using CURL client in your console > `curl http://localhost:8000/graphql --data "query={ hello }"` Successful response from a test Schema will be displayed: