File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/fragments/lib/graphqlapi/js Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 10
10
} catch (error) {
11
11
console .log (error);
12
12
// If the error is because the request was cancelled you can confirm here.
13
- if (API .isCancel (error)) {
13
+ if (API .isCancel (error)) {
14
14
console .log (error .message ); // "my message for cancellation"
15
15
// handle user cancellation logic
16
16
}
Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ import { OnCreateTodoSubscription } from './API';
160
160
const sub = API .graphql <GraphQLSubscription <OnCreateTodoSubscription >>(
161
161
graphqlOperation (onCreateTodo )
162
162
).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 );
166
166
}
167
167
});
168
168
@@ -182,9 +182,9 @@ import { onCreateTodo } from './graphql/subscriptions';
182
182
const sub = API .graphql (
183
183
graphqlOperation (onCreateTodo)
184
184
).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);
188
188
}
189
189
});
190
190
You can’t perform that action at this time.
0 commit comments