From a9acf112097dba2a6733d063ce8e702b68b15a68 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 28 May 2020 17:26:48 +0200 Subject: [PATCH] refactor(client): simply landing query (#38935) --- client/src/components/landing/index.js | 6 +++--- client/src/pages/index.js | 18 ++++-------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/client/src/components/landing/index.js b/client/src/components/landing/index.js index 606631113c..f6de7ecef5 100644 --- a/client/src/components/landing/index.js +++ b/client/src/components/landing/index.js @@ -14,7 +14,7 @@ import './landing.css'; import '../Map/map.css'; const propTypes = { - edges: PropTypes.array + nodes: PropTypes.array }; const BigCallToAction = () => ( @@ -38,8 +38,8 @@ const AsFeaturedSection = () => ( ); -export const Landing = ({ edges }) => { - const superBlocks = uniq(edges.map(element => element.node.superBlock)); +export const Landing = ({ nodes }) => { + const superBlocks = uniq(nodes.map(node => node.superBlock)); const interviewPrep = superBlocks.splice(-1); return ( diff --git a/client/src/pages/index.js b/client/src/pages/index.js index 7263f41604..6d78449a82 100644 --- a/client/src/pages/index.js +++ b/client/src/pages/index.js @@ -7,10 +7,10 @@ import { AllChallengeNode } from '../redux/propTypes'; export const IndexPage = ({ data: { - allChallengeNode: { edges } + allChallengeNode: { nodes } } }) => { - return ; + return ; }; const propTypes = { @@ -30,18 +30,8 @@ export const query = graphql` filter: { isHidden: { eq: false } } sort: { fields: [superOrder, order, challengeOrder] } ) { - edges { - node { - fields { - slug - blockName - } - id - block - title - superBlock - dashedName - } + nodes { + superBlock } } }