Skip to content

Commit 17b2ab2

Browse files
committed
README file is updated
1 parent 80982a7 commit 17b2ab2

File tree

3 files changed

+18
-44
lines changed

3 files changed

+18
-44
lines changed

README.md

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,22 @@ Navigate inside the directory:
5555
$ cd react-app-simple-book-search-graphql
5656
```
5757

58-
Install all the necessary dependecies and run the application
58+
Install all the necessary dependecies and run the **client side** of the application
5959

6060
```bash
6161
$ npm install
6262

6363
# To serve the application we use a npm module named http-server
64-
$ npm run serve
64+
$ npm run client-start
65+
```
66+
67+
Now open **Another Terminal** and navigate to the same directory and run the **GraphQL Server**
68+
69+
```bash
70+
$ cd /path/to/react-app-simple-book-search-graphql
71+
72+
# Run the GraphQL Server
73+
$ npm run server-start
6574
```
6675

6776
### Login to book search
@@ -77,52 +86,19 @@ $ npm run serve
7786
| -------- | -------- |
7887
| admin | admin123 |
7988

80-
_tested with latest versions of <img src="screenshots/chrome.png" width="20px" title="Google Chrome">[Google Chrome](https://www.google.com/chrome/) and <img src="screenshots/firefox.png" width="25px" title="Firefox Developer edition">[Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/)_
81-
82-
## Usage
89+
_tested with latest versions of <img src="screenshots/chrome.png" width="20px" title="Google Chrome">[Google Chrome](https://www.google.com/chrome/) and <img src="screenshots/firefox.png" width="25px" title="Firefox">[Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/)_
8390

84-
First clone the repo
85-
86-
```bash
87-
$ git clone https://github.com/anijitsao/simple-apollo-server-graphql.git
88-
```
89-
90-
Install all the necessary dependencies by going inside the directory
91-
92-
```bash
93-
# Navigating inside the directory
94-
$ cd simple-apollo-server-graphql
95-
96-
# To install all the necessary dependencies
97-
$ npm install
98-
```
99-
100-
### Deployment
101-
102-
In order to deploy the example, you need to run the following command:
103-
104-
```
105-
$ serverless deploy
106-
```
107-
108-
### Invocation
109-
110-
After successful deployment, you can invoke the deployed **functions / resolvers**.
111-
112-
However, to call using [GraphQL](https://graphql.org/) API you can use any _supported_ Client like [Apollo Sandbox](https://studio.apollographql.com/sandbox/explorer/?_gl=1%2Abuieem%2A_ga%2AMjAyNTg2NTkxOC4xNjc5OTg3MzI4%2A_ga_0BGG5V2W2K%2AMTY3OTk4NzMyOC4xLjEuMTY3OTk4NzM0NS4wLjAuMA..) with the `url` and _HTTP Verbs_ as shown in Terminal.
91+
However, to _test_ [GraphQL](https://graphql.org/) API you can use any _supported_ Client like [Apollo Sandbox](https://studio.apollographql.com/sandbox/explorer/?_gl=1%2Abuieem%2A_ga%2AMjAyNTg2NTkxOC4xNjc5OTg3MzI4%2A_ga_0BGG5V2W2K%2AMTY3OTk4NzMyOC4xLjEuMTY3OTk4NzM0NS4wLjAuMA..) with the `url` and _HTTP Verbs_ as shown in Terminal.
11392

11493
## API Listing
11594

11695
API listing is given below, -
11796

11897
All APIs have common endpoint as following.
119-
**POST** /url-of-the-deployed-lambda/graphql (for `localhost` it will be `http://localhost:4000/graphql`)
12098

121-
Following username and password is valid
99+
**POST** /url-of-the-deployed-service/graphql (for `localhost` it will be `http://localhost:4000/graphql`)
122100

123-
| Username | Password |
124-
| -------- | -------- |
125-
| admin | admin123 |
101+
Following _Queries_ use the same URL mentioned above
126102

127103
```javascript
128104
query CreateTokenQuery{
@@ -133,8 +109,6 @@ query CreateTokenQuery{
133109
}
134110
```
135111

136-
Following _Queries_ use the same URL mentioned above
137-
138112
```javascript
139113
query HelloQuery {
140114
hello

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-simple-apollo-server-graphql",
3-
"version": "1.0.0",
2+
"name": "react-app-simple-book-search-graphql",
3+
"version": "2.0.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "react-simple-apollo-server-graphql",
2+
"name": "react-app-simple-book-search-graphql",
33
"type": "module"
44
}

0 commit comments

Comments
 (0)