WordPress gatsby graphql need sorting on children

WordPress gatsby graphql need sorting on children


0

On the following graphql I need sorting/order on the WPChildren with the ‘menuOrder’ item…

query ($id: String!) {
  allWpPage(
    filter: {id: {eq: $id}}
  ) {
    edges {
      node {
        id
        title
        uri
        content
        children {
          id
        }
        blocks
      }
    }
    nodes {
      wpChildren {
        nodes {
          id
          ... on WpPage {
            id
            title
            uri
            featuredImage {
              node {
                mediaItemUrl
              }
            }
            overviewtext {
              overviewTitle
              overviewDescription
            }
            menuOrder
          }
        }
      }
    }
  }
}

The graphql is to show content from current page AND gets its children but I can’t get the sorting to work…any ideas are highly appreciated! 🙂

regards,

Chris


Load 7 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *