Skip to content

Commit d196b4d

Browse files
committed
author apis is done
1 parent 01744d0 commit d196b4d

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ query HelloQuery {
9696
}
9797
```
9898

99-
100-
10199
```javascript
102100
query FindBooksQuery {
103101
findBooks {
@@ -108,6 +106,16 @@ query FindBooksQuery {
108106
}
109107
```
110108

109+
```javascript
110+
query FindAllAuthors{
111+
findAuthors {
112+
_id
113+
firstName
114+
lastName
115+
}
116+
}
117+
```
118+
111119
**POST** /url-of-the-deployed-lambda/graphql
112120

113121
Following *Mutations* have the same URL mentioned above
@@ -146,4 +154,36 @@ mutation UpdateBookMutation($updateId: ID!, $bookData: UpdataBookParams!) {
146154
}
147155
}
148156
```
157+
```javascript
158+
mutation AddAuthorMutation {
159+
addAuthor(firstName: "Agatha", lastName: "Christie"){
160+
_id
161+
firstName
162+
}
163+
}
164+
```
149165

166+
```javascript
167+
mutation DeleteAuthorMutation {
168+
deleteAuthor(_id: "62d6afb823b01d6d1ff85988")
169+
}
170+
```
171+
172+
```javascript
173+
mutation UpdateAuthorMutation(
174+
$updateId: ID!
175+
$authorData: UpdataAuthorParams!
176+
) {
177+
updateAuthor(_id: $updateId, updateAuthorData: $authorData)
178+
}
179+
180+
// variables
181+
{
182+
"updateId": "62d6afd523b01d6d1ff85989",
183+
"authorData": {
184+
"firstName": "Agatha",
185+
"lastName": "Christie",
186+
"country": "United Kingdom"
187+
}
188+
}
189+
```

0 commit comments

Comments
 (0)