Commit 22a541d8 authored by Zack Cuddy's avatar Zack Cuddy

Geo - GraphQL Remove Edges

This change removes some un-needed complexity from
our Geo Replication GraphQL schema.
parent 6566448f
......@@ -9,17 +9,15 @@ export default graphQlFieldName => {
pageInfo {
...PageInfo
}
edges {
node {
id
packageFileId
state
retryCount
lastSyncFailure
retryAt
lastSyncedAt
createdAt
}
nodes {
id
packageFileId
state
retryCount
lastSyncFailure
retryAt
lastSyncedAt
createdAt
}
}
}
......
......@@ -56,7 +56,7 @@ export const fetchReplicableItemsGraphQl = ({ state, dispatch }, direction) => {
})
.then(res => {
const registries = res.data.geoNode.packageFileRegistries;
const data = registries.edges.map(e => e.node);
const data = registries.nodes;
const pagination = {
...registries.pageInfo,
page: state.paginationData.page,
......
......@@ -53,22 +53,18 @@ export const MOCK_BASIC_GRAPHQL_QUERY_RESPONSE = {
geoNode: {
packageFileRegistries: {
pageInfo: MOCK_GRAPHQL_PAGINATION_DATA,
edges: [
nodes: [
{
node: {
id: 'git/1',
packageFileId: '1',
state: 'PENDING',
lastSyncedAt: null,
},
id: 'git/1',
packageFileId: '1',
state: 'PENDING',
lastSyncedAt: null,
},
{
node: {
id: 'git/2',
packageFileId: '2',
state: 'SYNCED',
lastSyncedAt: null,
},
id: 'git/2',
packageFileId: '2',
state: 'SYNCED',
lastSyncedAt: null,
},
],
},
......
......@@ -132,7 +132,7 @@ describe('GeoReplicable Store Actions', () => {
describe('with no direction set', () => {
const direction = null;
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', () => {
testAction(
......@@ -159,7 +159,7 @@ describe('GeoReplicable Store Actions', () => {
describe('with direction set to "next"', () => {
const direction = NEXT;
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', () => {
testAction(
......@@ -191,7 +191,7 @@ describe('GeoReplicable Store Actions', () => {
describe('with direction set to "prev"', () => {
const direction = PREV;
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', () => {
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