@burojs/hasura 0.2.0 → 0.5.0
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 +15 -16
- package/dist/index.cjs +912 -772
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +594 -285
- package/dist/index.d.ts +594 -285
- package/dist/index.js +899 -770
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -56,22 +56,21 @@ registry rather than by branching on resource names:
|
|
|
56
56
|
| `dataBody` | route a heavy array payload into/out of a 1:1 sibling table |
|
|
57
57
|
| `live` | opt this resource into subscription-driven invalidation |
|
|
58
58
|
|
|
59
|
-
####
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
error envelope is a product decision this package has not taken.
|
|
59
|
+
#### Errors Hasura sends with HTTP 200
|
|
60
|
+
|
|
61
|
+
Hasura answers every GraphQL-level failure with HTTP 200, so the provider
|
|
62
|
+
classifies the envelope by `extensions.code`: `access-denied` and
|
|
63
|
+
`permission-error` reject as `{ kind: 'forbidden', code }`, `invalid-jwt` as
|
|
64
|
+
`{ kind: 'auth', code: 'invalid-jwt' }`, and every other code as
|
|
65
|
+
`{ kind: 'protocol', code: 'graphql-error' }`. When the app passes an
|
|
66
|
+
`authProvider` to `<BuroProvider>`, an `auth` rejection reaches its `onError`,
|
|
67
|
+
which decides whether to refresh; on `refreshed` the runtime replays a read once
|
|
68
|
+
(a mutation once when it is replay-safe). `config.recoverAuth` remains the hook
|
|
69
|
+
for an HTTP **401**, which a proxy or gateway in front of Hasura answers; it is
|
|
70
|
+
not consulted for the envelope. A mutation whose request was sent and got no
|
|
71
|
+
answer at all rejects as `{ kind: 'sent', code: 'hasura-request-sent',
|
|
72
|
+
retryable: false }`: it may have been applied. Pinned by
|
|
73
|
+
`tests/fixture-fidelity.test.ts` and `tests/error-kinds.test.ts`.
|
|
75
74
|
|
|
76
75
|
Optimistic concurrency is available per call: pass
|
|
77
76
|
`providerOptions.ifUpdatedAt` on an update and the mutation switches to a
|