Commit e646fca7 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '227385-remove-edges-geo' into 'master'

Geo - GraphQL Remove Edges

Closes #227385

See merge request gitlab-org/gitlab!36491
parents 035d510d 22a541d8
...@@ -9,17 +9,15 @@ export default graphQlFieldName => { ...@@ -9,17 +9,15 @@ export default graphQlFieldName => {
pageInfo { pageInfo {
...PageInfo ...PageInfo
} }
edges { nodes {
node { id
id packageFileId
packageFileId state
state retryCount
retryCount lastSyncFailure
lastSyncFailure retryAt
retryAt lastSyncedAt
lastSyncedAt createdAt
createdAt
}
} }
} }
} }
......
...@@ -56,7 +56,7 @@ export const fetchReplicableItemsGraphQl = ({ state, dispatch }, direction) => { ...@@ -56,7 +56,7 @@ export const fetchReplicableItemsGraphQl = ({ state, dispatch }, direction) => {
}) })
.then(res => { .then(res => {
const registries = res.data.geoNode.packageFileRegistries; const registries = res.data.geoNode.packageFileRegistries;
const data = registries.edges.map(e => e.node); const data = registries.nodes;
const pagination = { const pagination = {
...registries.pageInfo, ...registries.pageInfo,
page: state.paginationData.page, page: state.paginationData.page,
......
...@@ -53,22 +53,18 @@ export const MOCK_BASIC_GRAPHQL_QUERY_RESPONSE = { ...@@ -53,22 +53,18 @@ export const MOCK_BASIC_GRAPHQL_QUERY_RESPONSE = {
geoNode: { geoNode: {
packageFileRegistries: { packageFileRegistries: {
pageInfo: MOCK_GRAPHQL_PAGINATION_DATA, pageInfo: MOCK_GRAPHQL_PAGINATION_DATA,
edges: [ nodes: [
{ {
node: { id: 'git/1',
id: 'git/1', packageFileId: '1',
packageFileId: '1', state: 'PENDING',
state: 'PENDING', lastSyncedAt: null,
lastSyncedAt: null,
},
}, },
{ {
node: { id: 'git/2',
id: 'git/2', packageFileId: '2',
packageFileId: '2', state: 'SYNCED',
state: 'SYNCED', lastSyncedAt: null,
lastSyncedAt: null,
},
}, },
], ],
}, },
......
...@@ -132,7 +132,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -132,7 +132,7 @@ describe('GeoReplicable Store Actions', () => {
describe('with no direction set', () => { describe('with no direction set', () => {
const direction = null; const direction = null;
const registries = MOCK_BASIC_GRAPHQL_QUERY_RESPONSE.geoNode?.packageFileRegistries; const registries = MOCK_BASIC_GRAPHQL_QUERY_RESPONSE.geoNode?.packageFileRegistries;
const data = registries.edges.map(e => e.node); const data = registries.nodes;
it('should call gqClient with no before/after variables as well as a first variable but no last variable', () => { it('should call gqClient with no before/after variables as well as a first variable but no last variable', () => {
testAction( testAction(
...@@ -159,7 +159,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -159,7 +159,7 @@ describe('GeoReplicable Store Actions', () => {
describe('with direction set to "next"', () => { describe('with direction set to "next"', () => {
const direction = NEXT; const direction = NEXT;
const registries = MOCK_BASIC_GRAPHQL_QUERY_RESPONSE.geoNode?.packageFileRegistries; const registries = MOCK_BASIC_GRAPHQL_QUERY_RESPONSE.geoNode?.packageFileRegistries;
const data = registries.edges.map(e => e.node); const data = registries.nodes;
it('should call gqClient with after variable but no before variable as well as a first variable but no last variable', () => { it('should call gqClient with after variable but no before variable as well as a first variable but no last variable', () => {
testAction( testAction(
...@@ -191,7 +191,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -191,7 +191,7 @@ describe('GeoReplicable Store Actions', () => {
describe('with direction set to "prev"', () => { describe('with direction set to "prev"', () => {
const direction = PREV; const direction = PREV;
const registries = MOCK_BASIC_GRAPHQL_QUERY_RESPONSE.geoNode?.packageFileRegistries; const registries = MOCK_BASIC_GRAPHQL_QUERY_RESPONSE.geoNode?.packageFileRegistries;
const data = registries.edges.map(e => e.node); const data = registries.nodes;
it('should call gqClient with before variable but no after variable as well as a last variable but no first variable', () => { it('should call gqClient with before variable but no after variable as well as a last variable but no first variable', () => {
testAction( testAction(
......
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