Fetch after save

Hello,

I have a small problem with couchbase/graphql/redux…not sure if is something wrong on my side or not…when I run a request to my api from redux, I wait the response, and I immediately fetch my new result I get an empty object…after 200ms I get the result…I doing something wrong?

Hi @francesco.venica,

Are you using N1QL to fetch the new result? If so, you should look into Scan Consistency. You don’t say which SDK/language you are using, but here’s the documentation for .NET: https://docs.couchbase.com/dotnet-sdk/2.7/scan-consistency-examples.html

The SDKs by default use “NotBounded” as a scan consistency. This is the option for best performance, but in the cases where you need to read your own write immediately, you should check out RequestPlus and AtPlus options.

1 Like

cool, now I try that one!

many thanks
Francesco

More specifically, the SDKs don’t pass a scan consistency param unless specified by the app developer, and the query service is “not bounded” by default. Minor nit to pick, but could be worth mentioning for some-future-default-change.