Skip to content

Commit 72839b2

Browse files
committed
Simplify hash call.
1 parent 017c825 commit 72839b2

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

packages/cache/src/plugin.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,12 @@ export function defineCachePlugin(pluginOptions: CachePluginOptions) {
5858

5959
onQuery: async ({ args, model, operation, proceed, client }) => {
6060
if (args && 'cache' in args) {
61-
let json: string
62-
63-
if (client.$auth) {
64-
json = stableHash({
65-
args,
66-
model,
67-
operation,
68-
auth: client.$auth,
69-
})
70-
} else {
71-
json = stableHash({
72-
args,
73-
model,
74-
operation,
75-
})
76-
}
61+
const json = stableHash({
62+
args,
63+
model,
64+
operation,
65+
auth: client.$auth,
66+
})
7767

7868
if (!json) {
7969
throw new Error(

0 commit comments

Comments
 (0)