Skip to content

Allow epics search in specific fields with GraphQL

Eugenia Grieff requested to merge 277065-epic-search-in-issues-inconsistent into master

What does this MR do?

Related to #277065 (closed)

This MR introduces a new argument to EpicsResolver that allows us to specify the field to search in. This new argument will take a string that can be "title", "description", or a combination of both to search in either: "title,description". It is not a required argument but it will validate the presence of search is present.

This is the first usage of the :in argument in our GraphQL API so I've asked for opinions on the name in #f_graphql (internal link) where I got the following response:

Alex Kalderimis: Being consistent with the REST endpoint seems like a virtue to me. As long as the description on the argument is clear, then that seems ok to me

Currently, the REST endpoints using this param are issues and merge_requests.

Example query 1
query {
  group(fullPath: "base-group") {
    epics(search: "foo", in: "title") {
      edges {
        node {
          title
          description
        }
      }
    }
  }
}
Example response
{
  "data": {
    "group": {
      "epics": {
        "edges": [
          {
            "node": {
              "title": "Epic Foo",
              "description": ""
            }
          }
        ]
      }
    }
  }
}
Example query 2
query {
  group(fullPath: "base-group") {
    epics(search: "foo", in: "description") {
      edges {
        node {
          title
          description
        }
      }
    }
  }
}
Example response
{
  "data": {
    "group": {
      "epics": {
        "edges": [
          {
            "node": {
              "title": "Epic 2",
              "description": "Description foo"
            }
          }
        ]
      }
    }
  }
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Eugenia Grieff

Merge request reports