Use GraphQL for Roadmap
Summary
We already implemented GraphQL to render Epics Tree (see https://gitlab.com/gitlab-org/gitlab-ee/issues/10795), so API already supports all necessary keys required to render Roadmap for any group. Using GraphQL to render Roadmap will allow us to use single query file in both the places, thus having SSoT for networking logic for both Epics and Roadmap.
Current Rails API Implementation for Roadmap
Current Rails API for Roadmap supports following query params;
-
state
: State of Epics to show, possible values;all
,opened
&closed
. -
start_date
: Start date inYYYY-M-D
format from which Epics with provided start date exist. -
end_date
: Finish date inYYYY-M-D
format from which Epics with provided finish date exist. -
layout
[optional]: Preset value when user clicks it on UI, possible values;QUARTERS
,MONTHS
&WEEKS
. This param is only sent when user changes the preset.
Also, the group information is part of endpoint URL itself. For eg; URL to fetch all Epics within gitlab-org
group on GitLab.com is /groups/gitlab-org/-/epics.json
, with above params sent as query params.
Current GraphQL API implementation for Epics
Current GraphQL query used for Epic Tree requires following variables;
-
fullPath
: Group within which we're looking for Epics. -
iid
: ID of Epic for which we want to fetch child items (attached Epics & Issues). -
pageSize
: Number of items to fetch. Default upper limit for GraphQL backend is100
. -
epicEndCursor
[optional]: Cursor position for pagination in Epics list. -
issueEndCursor
[optional]: Cursor position for pagination in Issues list.
If we were to use GraphQL API for Roadmap at a group level, we'd have to make iid
variable to be optional such that the query allows to fetch all top-level epics for provided group, and additionally support startDate
, endDate
, state
and layout
variables (all being optional when used within Epics to render tree).