Skip to content

Commit

Permalink
feat: add names arg for queues query
Browse files Browse the repository at this point in the history
relates: #80
  • Loading branch information
Boris Dorofeev authored and nodkz committed Aug 24, 2023
1 parent b04c9ab commit 432ad5a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/query/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ export function createQueuesFC(
type: 'String',
defaultValue: 'bull',
},
names: {
type: '[String!]',
},
},
resolve: async (_, { prefix }) => {
const titles = await scanQueueTitles(prefix, opts);
resolve: async (_, { prefix, names }) => {
//Если передали имена, значит они согласованы с префиксом (bull.[имя проекта]).
const titles = names
? names.map((name: string) => ({ prefix, queueName: name }))
: await scanQueueTitles(prefix, opts);
return getQueues(titles, opts);
},
};
Expand Down

0 comments on commit 432ad5a

Please sign in to comment.