Skip to content

Commit 378c75b

Browse files
committed
pr feedback
1 parent 715f1ea commit 378c75b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/fragments/lib/graphqlapi/js/cancel-request.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ try {
1010
} catch (error) {
1111
console.log(error);
1212
// If the error is because the request was cancelled you can confirm here.
13-
if(API.isCancel(error)) {
13+
if (API.isCancel(error)) {
1414
console.log(error.message); // "my message for cancellation"
1515
// handle user cancellation logic
1616
}

src/fragments/lib/graphqlapi/js/getting-started.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ import { OnCreateTodoSubscription } from './API';
160160
const sub = API.graphql<GraphQLSubscription<OnCreateTodoSubscription>>(
161161
graphqlOperation(onCreateTodo)
162162
).subscribe({
163-
next: (todoData) => {
164-
console.log(todoData);
165-
// Do something with the data
163+
next: (payload) => {
164+
const createdTodo = payload.value.data?.onCreateTodo;
165+
console.log(createdTodo);
166166
}
167167
});
168168

@@ -182,9 +182,9 @@ import { onCreateTodo } from './graphql/subscriptions';
182182
const sub = API.graphql(
183183
graphqlOperation(onCreateTodo)
184184
).subscribe({
185-
next: (todoData) => {
186-
console.log(todoData);
187-
// Do something with the data
185+
next: (payload) => {
186+
const createdTodo = payload.value.data?.onCreateTodo;
187+
console.log(createdTodo);
188188
}
189189
});
190190

0 commit comments

Comments
 (0)