404 Error on all Blog Posts

Recently we changed our blog to be ordered by the last publication. But now it gives everything a 404 error when you click it. I'm guessing something needs to change above this

export const pageQuery = graphql query { prismic { allBlog_posts(sortBy:meta_firstPublicationDate_DESC) { edges { node { _meta { firstPublicationDate } title date excerpt author category } } } } };

I'm guessing something in this area needs to be updated but I'm not sure what ?

posts.push(






{post.node.category}

{post.node.date}


        <Link to={`/blog/` + post.node._meta.uid}>
          <h2 className={styles.postHeading}>{post.node.title}</h2>
        </Link>
        <div className={styles.excerpt}>
          <RichText
            render={post.node.excerpt}
            serializeHyperlink={customBlogLink}
          />
        </div>
      </div>
      <Button
        className={styles.readMore}
        to={`/blog/` + post.node._meta.uid}
      >
        Read more
      </Button>
    </article>
  </Col>
);

}

Hi Kevin,

Welcome to the Prismic forum, and thanks for posting this question!

The first thing that stands out to me is that you might be missing the uid in your GraphQL query. I see it's referenced in your component, but not included in your GraphQL query. Does it help if you replace your GraphQL string with this?

{
  allBlog_posts(sortBy: meta_firstPublicationDate_DESC) {
    edges {
      node {
        _meta {
          firstPublicationDate
          uid
        }
        title
        date
        excerpt
        author
        category
      }
    }
  }
}

This issue has been closed due to inactivity. Flag to reopen.