Skip to content

Commit

Permalink
Update graphql syntax to use new sort syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
eloisetaylor5693 committed Dec 6, 2023
1 parent a471c35 commit 5f2d46e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 33 deletions.
34 changes: 16 additions & 18 deletions src/pages/news.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,23 @@ const NewsIndex = ({ data, location }) => {

export default NewsIndex;

export const pageQuery = graphql`
query {
site {
siteMetadata {
title
}
export const pageQuery = graphql`{
site {
siteMetadata {
title
}
allContentfulNews(sort: { fields: createdAt, order: DESC }) {
nodes {
id
newsContent {
raw
}
title
author
shortDescription
createdAt(formatString: "Do MMMM YYYY")
slug
}
allContentfulNews(sort: {createdAt: DESC}) {
nodes {
id
newsContent {
raw
}
title
author
shortDescription
createdAt(formatString: "Do MMMM YYYY")
slug
}
}
`;
}`;
28 changes: 13 additions & 15 deletions src/pages/work-days.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,19 @@ const WorkDaysIndex = ({ data, location }) => {

export default WorkDaysIndex;

export const pageQuery = graphql`
query {
site {
siteMetadata {
title
}
export const pageQuery = graphql`{
site {
siteMetadata {
title
}
allContentfulWorkDay(sort: { fields: dateOfWorkday, order: DESC }) {
nodes {
slug
createdAt
id
title
shortDescriptionOfWorkday
}
}
allContentfulWorkDay(sort: {dateOfWorkday: DESC}) {
nodes {
slug
createdAt
id
title
shortDescriptionOfWorkday
}
}
`;
}`;

0 comments on commit 5f2d46e

Please sign in to comment.