Skip to content

Commit

Permalink
parse clientId for query composables when there are 3 parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
slavanossar committed Jan 20, 2023
1 parent 87d5201 commit 71b4d9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/composables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const prep = (...args: any) => {
const query = args?.[0]?.query || args?.[0]
const cache = args?.[0]?.cache ?? true
const variables = args?.[0]?.variables || (typeof args?.[1] !== 'string' && args?.[1]) || undefined
let clientId = args?.[0]?.clientId || (typeof args?.[1] === 'string' && args?.[1]) || undefined
let clientId = args?.[0]?.clientId || (typeof args?.[1] === 'string' && args?.[1]) || (typeof args?.[2] === 'string' && args?.[2]) || undefined

if (!clientId || !clients?.[clientId]) {
clientId = clients?.default ? 'default' : Object.keys(clients!)[0]
Expand Down

0 comments on commit 71b4d9f

Please sign in to comment.