@wishknish/knishio-client-js 0.7.8 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -484,6 +484,29 @@ This method involves individually building Atoms and Molecules, triggering the s
484
484
  3. `MutationProposeMolecule`, `MutationRequestAuthorization`, `MutationCreateIdentifier`, `MutationLinkIdentifier`, `MutationClaimShadowWallet`, `MutationCreateToken`, `MutationRequestTokens`, and `MutationTransferTokens` -> returns molecule metadata
485
485
  4. `QueryEmbeddingStatus` -> returns an array of `{ metaType, metaId, state, totalMetas, embeddedCount, embeddedAt, model }` objects
486
486
 
487
+ ## Network Freshness
488
+
489
+ `KnishIOClient` runs on [urql](https://urql.dev), which caches GraphQL responses
490
+ (`cache-first` by default). For a **long-lived server/sync client**, pass
491
+ `defaultRequestPolicy: 'network-only'` so reads always reflect current ledger
492
+ state (e.g. a meta created *after* the client started). Browser/SPA clients
493
+ should keep the default `cache-first`.
494
+
495
+ ```js
496
+ const client = new KnishIOClient({
497
+ uri: 'https://your-node/graphql',
498
+ cellSlug: 'YOURCELL',
499
+ defaultRequestPolicy: 'network-only' // server/long-lived: always-fresh reads
500
+ })
501
+
502
+ // Per call: client.queryMeta({ metaType: 'Foo', requestPolicy: 'network-only' })
503
+ // Toggle: client.setDefaultRequestPolicy('network-only')
504
+ // Inspect: client.getDefaultRequestPolicy()
505
+ ```
506
+
507
+ Precedence: a query's own context (e.g. ContinuID's `network-only`, which always
508
+ wins) > per-call `requestPolicy` > client `defaultRequestPolicy` > urql default.
509
+
487
510
  ## Getting Help
488
511
 
489
512
  Knish.IO is under active development, and our team is ready to assist with integration questions. The best way to seek help is to stop by our [Telegram Support Channel](https://t.me/wishknish). You can also [send us a contact request](https://knish.io/contact) via our website.