You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-41Lines changed: 15 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -55,13 +55,22 @@ Navigate inside the directory:
55
55
$ cd react-app-simple-book-search-graphql
56
56
```
57
57
58
-
Install all the necessary dependecies and run the application
58
+
Install all the necessary dependecies and run the **client side** of the application
59
59
60
60
```bash
61
61
$ npm install
62
62
63
63
# 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
65
74
```
66
75
67
76
### Login to book search
@@ -77,52 +86,19 @@ $ npm run serve
77
86
| -------- | -------- |
78
87
| admin | admin123 |
79
88
80
-
_tested with latest versions of <imgsrc="screenshots/chrome.png"width="20px"title="Google Chrome">[Google Chrome](https://www.google.com/chrome/) and <imgsrc="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 <imgsrc="screenshots/chrome.png"width="20px"title="Google Chrome">[Google Chrome](https://www.google.com/chrome/) and <imgsrc="screenshots/firefox.png"width="25px"title="Firefox">[Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/)_
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.
113
92
114
93
## API Listing
115
94
116
95
API listing is given below, -
117
96
118
97
All APIs have common endpoint as following.
119
-
**POST** /url-of-the-deployed-lambda/graphql (for `localhost` it will be `http://localhost:4000/graphql`)
120
98
121
-
Following username and password is valid
99
+
**POST** /url-of-the-deployed-service/graphql (for `localhost` it will be `http://localhost:4000/graphql`)
122
100
123
-
| Username | Password |
124
-
| -------- | -------- |
125
-
| admin | admin123 |
101
+
Following _Queries_ use the same URL mentioned above
126
102
127
103
```javascript
128
104
query CreateTokenQuery{
@@ -133,8 +109,6 @@ query CreateTokenQuery{
133
109
}
134
110
```
135
111
136
-
Following _Queries_ use the same URL mentioned above
0 commit comments