Skip to content

Commit

Permalink
feat: try better async query
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Klesse committed Sep 3, 2024
1 parent aab497e commit 4ce82e9
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/runtime/composables/gql-async-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@ export async function gqlAsyncQuery<T = any>(method: string, options: IGraphQLOp
throw new Error('No method detected');
}

// Get config
const config = {
asyncDataOptions: {
lazy: false,
},
fields: null,
log: false,
variables: null,
...options,
hashPasswords: options.hashPasswords ?? true,
};

return useAsyncData(
method,
async () => {
// Get config
const config = {
asyncDataOptions: {
lazy: false,
},
fields: null,
log: false,
variables: null,
...options,
hashPasswords: options.hashPasswords ?? true,
};
const fields = config.fields as unknown as string[];

if (config.log) {
Expand Down

0 comments on commit 4ce82e9

Please sign in to comment.