Open zhaoyi0113 opened 4 years ago
I have below code in nodejs. It works well. But I can't get any error even I specify an invalid URL or wrong authentication. I wonder how subscription report errors.
URL
const createClient = (url: string, auth: any) => { const client = new AWSAppSyncClient({ url, region: 'ap-southeast-2', auth, disableOffline: true, offlineConfig: { callback: (err, succ) => { if (err) console.error(err); else { console.log('SUCCESS', succ); } }, }, }); return client; }; const client = createClient(URL, oidcAuth); client .hydrated() .then((gq) => { gq.subscribe({ query: subscribeTxn, fetchPolicy: 'network-only', variables: { id: '123' }, }) .subscribe({ next: (data: any) => { console.log('realtime data: ', data); }, complete: () => { console.log('complete'); }, error: (err: Error) => console.error(err), }); })
I have below code in nodejs. It works well. But I can't get any error even I specify an invalid
URL
or wrong authentication. I wonder how subscription report errors.