diff --git a/package.json b/package.json index eb967e7..2e43f81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@visualbravo/zenstack-cache", - "version": "1.0.5", + "version": "1.0.6", "description": "Reduce response times and database load with query-level caching integrated with the ZenStack ORM.", "keywords": [ "accelerate", diff --git a/src/plugin.ts b/src/plugin.ts index 53481eb..79efffc 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -59,11 +59,7 @@ export function defineCachePlugin(pluginOptions: CachePluginOptions) { onQuery: async ({ args, model, operation, proceed, client }) => { if (args && 'cache' in args) { const authId = client.$auth - ? Object.keys(client.$auth) - .filter(key => - client.$schema.models[client.$schema.authType!]!.idFields.includes(key), - ) - .join('_') + ? client.$schema.models[client.$schema.authType!]!.idFields.map(key => client.$auth![key]) : undefined const json = stableHash({