diff --git a/graphql/resolvers/Goal.ts b/graphql/resolvers/Goal.ts index 75baf9534..042623dd1 100644 --- a/graphql/resolvers/Goal.ts +++ b/graphql/resolvers/Goal.ts @@ -21,7 +21,15 @@ const connectionMap: Record = { false: 'disconnect', }; -const projectGoalsFilter = (data: { query: string; states: string[]; tags: string[]; owner: string[] }): any => { +const projectGoalsFilter = (data: { + query: string; + priority: string[]; + states: string[]; + tags: string[]; + owner: string[]; +}): any => { + const priorityFilter = data.priority.length ? { priority: { in: data.priority } } : {}; + const statesFilter = data.states.length ? { state: { @@ -70,6 +78,7 @@ const projectGoalsFilter = (data: { query: string; states: string[]; tags: strin }, }, ], + ...priorityFilter, ...statesFilter, ...tagsFilter, ...ownerFilter, diff --git a/graphql/resolvers/Project.ts b/graphql/resolvers/Project.ts index 108fe32e8..81493e5ba 100644 --- a/graphql/resolvers/Project.ts +++ b/graphql/resolvers/Project.ts @@ -22,10 +22,13 @@ const connectionMap: Record = { const projectGoalsFilter = (data: { key: string; query: string; + priority: string[]; states: string[]; tags: string[]; owner: string[]; }): any => { + const priorityFilter = data.priority.length ? { priority: { in: data.priority } } : {}; + const statesFilter = data.states.length ? { state: { @@ -77,6 +80,7 @@ const projectGoalsFilter = (data: { project: { key: data.key, }, + ...priorityFilter, ...statesFilter, ...tagsFilter, ...ownerFilter, diff --git a/graphql/resolvers/Team.ts b/graphql/resolvers/Team.ts index 44aba6f71..83b074fa0 100644 --- a/graphql/resolvers/Team.ts +++ b/graphql/resolvers/Team.ts @@ -23,9 +23,11 @@ const connectionMap: Record = { }; const projectGoalsFilter = ( - data: { query: string; states: string[]; tags: string[]; owner: string[] }, + data: { query: string; priority: string[]; states: string[]; tags: string[]; owner: string[] }, extra: any = {}, ): any => { + const priorityFilter = data.priority.length ? { priority: { in: data.priority } } : {}; + const statesFilter = data.states.length ? { state: { @@ -74,6 +76,7 @@ const projectGoalsFilter = ( }, }, ], + ...priorityFilter, ...statesFilter, ...tagsFilter, ...ownerFilter, diff --git a/graphql/schema.graphql b/graphql/schema.graphql index 473dd45ed..a0729ffce 100644 --- a/graphql/schema.graphql +++ b/graphql/schema.graphql @@ -248,6 +248,7 @@ input ProjectDelete { input ProjectGoalsCountInput { key: String! owner: [String!]! + priority: [String!]! query: String! states: [String!]! tags: [String!]! @@ -258,6 +259,7 @@ input ProjectGoalsInput { offset: Int! owner: [String!]! pageSize: Int! + priority: [String!]! query: String! states: [String!]! tags: [String!]! @@ -406,6 +408,7 @@ input TeamDelete { input TeamGoalsInput { owner: [String!]! + priority: [String!]! query: String! slug: String! states: [String!]! @@ -414,6 +417,7 @@ input TeamGoalsInput { input TeamProjectsInput { owner: [String!]! + priority: [String!]! query: String! slug: String! states: [String!]! @@ -448,6 +452,7 @@ type User { input UserGoalsInput { owner: [String!]! + priority: [String!]! query: String! states: [String!]! tags: [String!]! diff --git a/graphql/types.ts b/graphql/types.ts index 1b656982a..e27246a39 100644 --- a/graphql/types.ts +++ b/graphql/types.ts @@ -460,6 +460,7 @@ export const ProjectGoalsInput = inputObjectType({ t.nonNull.string('key'); t.nonNull.int('pageSize'); t.nonNull.int('offset'); + t.nonNull.list.nonNull.string('priority'); t.nonNull.list.nonNull.string('states'); t.nonNull.list.nonNull.string('tags'); t.nonNull.list.nonNull.string('owner'); @@ -470,6 +471,7 @@ export const ProjectGoalsInput = inputObjectType({ export const UserGoalsInput = inputObjectType({ name: 'UserGoalsInput', definition(t) { + t.nonNull.list.nonNull.string('priority'); t.nonNull.list.nonNull.string('states'); t.nonNull.list.nonNull.string('tags'); t.nonNull.list.nonNull.string('owner'); @@ -481,6 +483,7 @@ export const ProjectGoalsCountInput = inputObjectType({ name: 'ProjectGoalsCountInput', definition(t) { t.nonNull.string('key'); + t.nonNull.list.nonNull.string('priority'); t.nonNull.list.nonNull.string('states'); t.nonNull.list.nonNull.string('tags'); t.nonNull.list.nonNull.string('owner'); @@ -525,6 +528,7 @@ export const TeamProjectsInput = inputObjectType({ name: 'TeamProjectsInput', definition(t) { t.field(TeamModel.slug); + t.nonNull.list.nonNull.string('priority'); t.nonNull.list.nonNull.string('states'); t.nonNull.list.nonNull.string('tags'); t.nonNull.list.nonNull.string('owner'); @@ -536,6 +540,7 @@ export const TeamGoalsInput = inputObjectType({ name: 'TeamGoalsInput', definition(t) { t.field(TeamModel.slug); + t.nonNull.list.nonNull.string('priority'); t.nonNull.list.nonNull.string('states'); t.nonNull.list.nonNull.string('tags'); t.nonNull.list.nonNull.string('owner');