Add support for 'in' field for Issuables GraphQL API
What does this MR do and why?
This MR adds support for 'in' field to the public Issueables GraphQL API. The same field already is support in REST API, but was missing in a GraphQL one.
Outdated queries
Query examples
Aut quia
) field only
Title (SELECT 1 AS one FROM "issues" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND "issues"."title" ILIKE '%Aut%' AND "issues"."title" ILIKE '%quia%' LIMIT 1 OFFSET 20
SELECT "issues".* FROM "issues" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND "issues"."title" ILIKE '%Aut%' AND "issues"."title" ILIKE '%quia%' ORDER BY "issues"."created_at" DESC, "issues"."id" DESC LIMIT 20
Qua
), assignee and author fields
Title (SELECT 1 AS one FROM "issues" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND "issues"."title" ILIKE '%Qua%' AND EXISTS (SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."user_id" = 1 AND (issue_id = issues.id)) AND "issues"."author_id" IN (SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('pilar_mills')))) LIMIT 1 OFFSET 20
SELECT "issues".* FROM "issues" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND "issues"."title" ILIKE '%Qua%' AND EXISTS (SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."user_id" = 1 AND (issue_id = issues.id)) AND "issues"."author_id" IN (SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('pilar_mills')))) ORDER BY "issues"."created_at" DESC, "issues"."id" DESC LIMIT 20
Assignee and author fields without title
SELECT 1 AS one FROM "issues" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND EXISTS (SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."user_id" = 1 AND (issue_id = issues.id)) AND "issues"."author_id" IN (SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('pilar_mills')))) LIMIT 1 OFFSET 20
SELECT "issues".* FROM "issues" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND EXISTS (SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."user_id" = 1 AND (issue_id = issues.id)) AND "issues"."author_id" IN (SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('pilar_mills')))) ORDER BY "issues"."created_at" DESC, "issues"."id" DESC LIMIT 20
Qui
) and all the other fields
Title (SELECT 1 AS one FROM "issues" LEFT OUTER JOIN milestones ON issues.milestone_id = milestones.id LEFT OUTER JOIN milestone_releases ON issues.milestone_id = milestone_releases.milestone_id INNER JOIN "epic_issues" ON "epic_issues"."issue_id" = "issues"."id" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND "issues"."title" ILIKE '%Qui%' AND EXISTS (SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."user_id" = 13 AND (issue_id = issues.id)) AND "issues"."author_id" IN (SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('carmella')))) AND "milestones"."title" = 'Sprint - Nam deleniti quos debitis fugit asperiores inventore aut.' AND "milestone_releases"."release_id" IS NULL AND NOT (EXISTS (SELECT "label_links".* FROM "label_links" WHERE "label_links"."target_type" = 'Issue' AND "label_links"."target_id" = "issues"."id")) AND NOT (EXISTS (SELECT true FROM "award_emoji" WHERE "award_emoji"."user_id" = 1 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."awardable_id" = "issues"."id")) AND "issues"."confidential" = FALSE AND "issues"."issue_type" = 0 AND ("issues"."weight" = -1 OR "issues"."weight" IS NULL) AND "epic_issues"."epic_id" IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "epics".* FROM "epics" WHERE "epics"."id" = 30)
UNION
(SELECT "epics".* FROM "epics", "base_and_descendants" WHERE "epics"."parent_id" = "base_and_descendants"."id")) SELECT "id" FROM "base_and_descendants" AS "epics") AND "issues"."sprint_id" IS NULL LIMIT 1 OFFSET 20
SELECT "issues".* FROM "issues" LEFT OUTER JOIN milestones ON issues.milestone_id = milestones.id LEFT OUTER JOIN milestone_releases ON issues.milestone_id = milestone_releases.milestone_id INNER JOIN "epic_issues" ON "epic_issues"."issue_id" = "issues"."id" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND "issues"."title" ILIKE '%Qui%' AND EXISTS (SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."user_id" = 13 AND (issue_id = issues.id)) AND "issues"."author_id" IN (SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('carmella')))) AND "milestones"."title" = 'Sprint - Nam deleniti quos debitis fugit asperiores inventore aut.' AND "milestone_releases"."release_id" IS NULL AND NOT (EXISTS (SELECT "label_links".* FROM "label_links" WHERE "label_links"."target_type" = 'Issue' AND "label_links"."target_id" = "issues"."id")) AND NOT (EXISTS (SELECT true FROM "award_emoji" WHERE "award_emoji"."user_id" = 1 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."awardable_id" = "issues"."id")) AND "issues"."confidential" = FALSE AND "issues"."issue_type" = 0 AND ("issues"."weight" = -1 OR "issues"."weight" IS NULL) AND "epic_issues"."epic_id" IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "epics".* FROM "epics" WHERE "epics"."id" = 30)
UNION
(SELECT "epics".* FROM "epics", "base_and_descendants" WHERE "epics"."parent_id" = "base_and_descendants"."id")) SELECT "id" FROM "base_and_descendants" AS "epics") AND "issues"."sprint_id" IS NULL ORDER BY "issues"."created_at" DESC, "issues"."id" DESC LIMIT 20
Another fields only
SELECT 1 AS one FROM "issues" LEFT OUTER JOIN milestones ON issues.milestone_id = milestones.id LEFT OUTER JOIN milestone_releases ON issues.milestone_id = milestone_releases.milestone_id INNER JOIN "epic_issues" ON "epic_issues"."issue_id" = "issues"."id" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND "issues"."title" ILIKE '%Qui%' AND EXISTS (SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."user_id" = 13 AND (issue_id = issues.id)) AND "issues"."author_id" IN (SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('carmella')))) AND "milestones"."title" = 'Sprint - Nam deleniti quos debitis fugit asperiores inventore aut.' AND "milestone_releases"."release_id" IS NULL AND NOT (EXISTS (SELECT "label_links".* FROM "label_links" WHERE "label_links"."target_type" = 'Issue' AND "label_links"."target_id" = "issues"."id")) AND NOT (EXISTS (SELECT true FROM "award_emoji" WHERE "award_emoji"."user_id" = 1 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."awardable_id" = "issues"."id")) AND "issues"."confidential" = FALSE AND "issues"."issue_type" = 0 AND ("issues"."weight" = -1 OR "issues"."weight" IS NULL) AND "epic_issues"."epic_id" IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "epics".* FROM "epics" WHERE "epics"."id" = 30)
UNION
(SELECT "epics".* FROM "epics", "base_and_descendants" WHERE "epics"."parent_id" = "base_and_descendants"."id")) SELECT "id" FROM "base_and_descendants" AS "epics") AND "issues"."sprint_id" IS NULL LIMIT 1 OFFSET 20
SELECT "issues".* FROM "issues" LEFT OUTER JOIN milestones ON issues.milestone_id = milestones.id LEFT OUTER JOIN milestone_releases ON issues.milestone_id = milestone_releases.milestone_id INNER JOIN "epic_issues" ON "epic_issues"."issue_id" = "issues"."id" WHERE "issues"."project_id" = 6 AND ("issues"."state_id" IN (1)) AND "issues"."title" ILIKE '%Qui%' AND EXISTS (SELECT "issue_assignees".* FROM "issue_assignees" WHERE "issue_assignees"."user_id" = 13 AND (issue_id = issues.id)) AND "issues"."author_id" IN (SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('carmella')))) AND "milestones"."title" = 'Sprint - Nam deleniti quos debitis fugit asperiores inventore aut.' AND "milestone_releases"."release_id" IS NULL AND NOT (EXISTS (SELECT "label_links".* FROM "label_links" WHERE "label_links"."target_type" = 'Issue' AND "label_links"."target_id" = "issues"."id")) AND NOT (EXISTS (SELECT true FROM "award_emoji" WHERE "award_emoji"."user_id" = 1 AND "award_emoji"."awardable_type" = 'Issue' AND "award_emoji"."awardable_id" = "issues"."id")) AND "issues"."confidential" = FALSE AND "issues"."issue_type" = 0 AND ("issues"."weight" = -1 OR "issues"."weight" IS NULL) AND "epic_issues"."epic_id" IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "epics".* FROM "epics" WHERE "epics"."id" = 30)
UNION
(SELECT "epics".* FROM "epics", "base_and_descendants" WHERE "epics"."parent_id" = "base_and_descendants"."id")) SELECT "id" FROM "base_and_descendants" AS "epics") AND "issues"."sprint_id" IS NULL ORDER BY "issues"."created_at" DESC, "issues"."id" DESC LIMIT 20
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Stanislav Lashmanov