question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

without disableOffline:true graphql operations failing with error in readFromStore

See original GitHub issue

I’ve an AppSync application which is configured to use Cognito.

When I’m configuring the AppSyncClient without the disableOffline: true option I am ending up with this error upon executing any query:

  graphQLErrors: [],
  networkError:
   Error: Can't find field listKiosks on object undefined.
       at /project/node_modules/aws-appsync/node_modules/apollo-cache-inmemory/src/readFromStore.ts:233:15
       at Array.forEach (<anonymous>)
       at StoreReader.diffQueryAgainstStore (/project/node_modules/aws-appsync/node_modules/apollo-cache-inmemory/src/readFromStore.ts:231:26)
       at StoreReader.readQueryFromStore (/project/node_modules/aws-appsync/node_modules/apollo-cache-inmemory/src/readFromStore.ts:178:17)
       at processOfflineQuery (/project/node_modules/aws-appsync/lib/link/offline-link.js:158:34)
       at /project/node_modules/aws-appsync/lib/link/offline-link.js:114:28
       at new Subscription (/project/node_modules/zen-observable/lib/Observable.js:183:34)
       at Observable.subscribe (/project/node_modules/zen-observable/lib/Observable.js:262:14)
       at /project/node_modules/aws-appsync/lib/client.js:175:67,

If was quite hard to figure out that disableOffline is needed to make this work.

I don’t know what is the expected behavior:

  1. Shall it work with offline capabilities in a node application (not necessarily from Lambda only)?

or

  1. We could provide a better error message that under node this functionality is not available and if node environment detected, then bail out with a friendly error message during client initialization?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
stephankaagcommented, Jan 29, 2019

@stephankaag perhaps it was not clear, but specifying disableOffline: true works like a charm.

I know but I don’t want disable offline functionalities.

0reactions
mikeRChambers610commented, Aug 18, 2020

@attilah this is a solution that works like a charm if you do not need offline capabilities…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling operation errors - Apollo GraphQL Docs
These are errors encountered while attempting to communicate with your GraphQL server, usually resulting in a 4xx or 5xx response status code (and...
Read more >
Mutations and Input Types - GraphQL
It's often convenient to have a mutation that maps to a database create or update operation, like setMessage , return the same thing...
Read more >
Error Masking – GraphQL Yoga
Unexpected errors can be caused by failed connections to remote ... sensible defaults as error masking is enabled without you needing to ...
Read more >
Handling GraphQL errors like a champ with unions and ...
Without a doubt, one of the best features of GraphQL is its awesome type system. Together with tools like the GraphQL Code Generator...
Read more >
A Guide to GraphQL Errors
❗️Con: No Schema. We love GraphQL for it's type system. The errors key of a GraphQL response, commonly called "Top-Level" errors, don ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found