Commit dc0576aa authored by Natalia Tepluhina's avatar Natalia Tepluhina Committed by David O'Regan

Performance Improvements for the Epic View: GraphQL startupjs

parent 0974d0a5
fragment PageInfo on PageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
fragment RelatedTreeBaseEpic on Epic {
id
iid
title
webPath
relativePosition
userPermissions {
__typename
adminEpic
createEpic
}
descendantCounts {
__typename
openedEpics
closedEpics
openedIssues
closedIssues
}
healthStatus {
__typename
issuesAtRisk
issuesOnTrack
issuesNeedingAttention
}
}
fragment EpicNode on Epic {
...RelatedTreeBaseEpic
state
reference(full: true)
relationPath
createdAt
closedAt
hasChildren
hasIssues
group {
__typename
fullPath
}
}
query childItems(
$fullPath: ID!
$iid: ID
$pageSize: Int = 100
$epicEndCursor: String = ""
$issueEndCursor: String = ""
) {
group(fullPath: $fullPath) {
__typename
id
path
fullPath
epic(iid: $iid) {
__typename
...RelatedTreeBaseEpic
children(first: $pageSize, after: $epicEndCursor) {
__typename
edges {
__typename
node {
__typename
...EpicNode
}
}
pageInfo {
__typename
...PageInfo
}
}
issues(first: $pageSize, after: $issueEndCursor) {
__typename
edges {
__typename
node {
__typename
iid
epicIssueId
title
closedAt
state
createdAt
confidential
dueDate
weight
webPath
reference(full: true)
relationPath
relativePosition
assignees {
__typename
edges {
__typename
node {
__typename
webUrl
name
username
avatarUrl
}
}
}
milestone {
__typename
title
startDate
dueDate
}
healthStatus
}
}
pageInfo {
__typename
...PageInfo
}
}
}
}
}
query epicDetails($fullPath: ID!, $iid: ID!) { query epicDetails($fullPath: ID!, $iid: ID!) {
group(fullPath: $fullPath) { group(fullPath: $fullPath) {
__typename
epic(iid: $iid) { epic(iid: $iid) {
__typename
participants { participants {
__typename
edges { edges {
__typename
node { node {
__typename
name name
avatarUrl avatarUrl
webUrl webUrl
......
import epicDetailsQuery from 'shared_queries/epic/epic_details.query.graphql';
import { deprecatedCreateFlash as flash } from '~/flash'; import { deprecatedCreateFlash as flash } from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -6,7 +7,6 @@ import { __, s__, sprintf } from '~/locale'; ...@@ -6,7 +7,6 @@ import { __, s__, sprintf } from '~/locale';
import { statusType, statusEvent, dateTypes } from '../constants'; import { statusType, statusEvent, dateTypes } from '../constants';
import epicDetailsQuery from '../queries/epicDetails.query.graphql';
import epicSetSubscription from '../queries/epicSetSubscription.mutation.graphql'; import epicSetSubscription from '../queries/epicSetSubscription.mutation.graphql';
import updateEpic from '../queries/updateEpic.mutation.graphql'; import updateEpic from '../queries/updateEpic.mutation.graphql';
import epicUtils from '../utils/epic_utils'; import epicUtils from '../utils/epic_utils';
......
fragment RelatedTreeBaseEpic on Epic {
id
iid
title
webPath
relativePosition
userPermissions {
adminEpic
createEpic
}
descendantCounts {
openedEpics
closedEpics
openedIssues
closedIssues
}
healthStatus {
issuesAtRisk
issuesOnTrack
issuesNeedingAttention
}
}
fragment EpicNode on Epic {
...RelatedTreeBaseEpic
state
reference(full: true)
relationPath
createdAt
closedAt
hasChildren
hasIssues
group {
fullPath
}
}
#import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
#import "./epic.fragment.graphql"
#import "./issue.fragment.graphql"
query childItems(
$fullPath: ID!
$iid: ID
$pageSize: Int = 100
$epicEndCursor: String = ""
$issueEndCursor: String = ""
) {
group(fullPath: $fullPath) {
id
path
fullPath
epic(iid: $iid) {
...RelatedTreeBaseEpic
children(first: $pageSize, after: $epicEndCursor) {
edges {
node {
...EpicNode
}
}
pageInfo {
...PageInfo
}
}
issues(first: $pageSize, after: $issueEndCursor) {
edges {
node {
...IssueNode
}
}
pageInfo {
...PageInfo
}
}
}
}
}
fragment IssueNode on EpicIssue {
iid
epicIssueId
title
closedAt
state
createdAt
confidential
dueDate
weight
webPath
reference(full: true)
relationPath
relativePosition
assignees {
edges {
node {
webUrl
name
username
avatarUrl
}
}
}
milestone {
title
startDate
dueDate
}
healthStatus
}
import Api from 'ee/api'; import Api from 'ee/api';
import epicChildren from 'shared_queries/epic/epic_children.query.graphql';
import { deprecatedCreateFlash as flash } from '~/flash'; import { deprecatedCreateFlash as flash } from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
...@@ -13,7 +14,6 @@ import { ...@@ -13,7 +14,6 @@ import {
import { ChildType, ChildState, idProp, relativePositions } from '../constants'; import { ChildType, ChildState, idProp, relativePositions } from '../constants';
import epicChildren from '../queries/epicChildren.query.graphql';
import epicChildReorder from '../queries/epicChildReorder.mutation.graphql'; import epicChildReorder from '../queries/epicChildReorder.mutation.graphql';
import { processQueryResponse, formatChildItem, gqClient } from '../utils/epic_utils'; import { processQueryResponse, formatChildItem, gqClient } from '../utils/epic_utils';
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
- add_page_specific_style 'page_bundles/roadmap' - add_page_specific_style 'page_bundles/roadmap'
- add_page_startup_api_call discussions_path(@epic) - add_page_startup_api_call discussions_path(@epic)
- add_page_startup_graphql_call('epic/epic_details', { fullPath: @group.full_path, iid: @epic.iid })
- add_page_startup_graphql_call('epic/epic_children', { fullPath: @group.full_path, iid: @epic.iid, pageSize: 100, epicEndCursor: '', issueEndCursor: '' })
#epic-app-root{ data: epic_show_app_data(@epic), #epic-app-root{ data: epic_show_app_data(@epic),
'data-allow-sub-epics' => allow_sub_epics } 'data-allow-sub-epics' => allow_sub_epics }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment