Skip to content

Commit 422a6de

Browse files
authored
fix: revert to authId (#17)
1 parent 1049f2b commit 422a6de

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "workspace",
33
"type": "module",
4-
"version": "1.0.4",
4+
"version": "1.0.5",
55
"private": "true",
66
"license": "MIT",
77
"scripts": {

packages/cache/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@visualbravo/zenstack-cache",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"keywords": [
55
"accelerate",
66
"cache",

packages/cache/src/plugin.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,19 @@ export function defineCachePlugin(pluginOptions: CachePluginOptions) {
5858

5959
onQuery: async ({ args, model, operation, proceed, client }) => {
6060
if (args && 'cache' in args) {
61+
const authId = client.$auth
62+
? Object.keys(client.$auth)
63+
.filter(key =>
64+
client.$schema.models[client.$schema.authType!]!.idFields.includes(key),
65+
)
66+
.join('_')
67+
: undefined
68+
6169
const json = stableHash({
6270
args,
6371
model,
6472
operation,
65-
auth: client.$auth,
73+
authId,
6674
})
6775

6876
if (!json) {

packages/config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstack-cache/config",
33
"type": "module",
4-
"version": "1.0.4",
4+
"version": "1.0.5",
55
"private": true,
66
"exports": {
77
"./ts": "./ts.json"

0 commit comments

Comments
 (0)