question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

enhancement(gatsby-source-contentful) publishedAt and firstPublishedAt fields

See original GitHub issue

Summary

Currently content nodes only pick up the updatedAt and createdAt fields from the contentful API response. I would like to suggest a change to also include the publishedAt and firstPublishedAt fields.

Motivation

I am working on a project that requires us to sort a list of entries by their publish date.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
axe312gercommented, May 27, 2020

The gatsby source plugin uses the sync api. The delivery/sync api does not have access to this attribute:

https://www.contentful.com/developers/docs/references/content-delivery-api/#/introduction/common-resource-attributes

But the new Contentful graphql api does support this attribute:

https://www.contentful.com/developers/docs/references/graphql/#/reference/schema-generation/sys-field

As soon the gatsby source plugin supports the contentful graphql api, this tickets should be solved automatically. (See disclaimer: https://www.contentful.com/developers/docs/references/graphql/#/introduction/basic-api-information)

I’ll readd it to the GitHub project so we can keep track of this 😃

0reactions
axe312gercommented, May 30, 2022

@chawes13 no, you only have available what you see in GraphQL

The new version will contain the (first) publish date. see #31385

Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-source-contentful
This can break your site when field values get removed. You may workaround with an extra content entry with all fields filled out....
Read more >
Building Rise of the Robots with Gatsby and Contentful
Paul Scanlon uses Contentful to drive the content for Rise of the Robots, and demonstrates the flexibility of building a Gatsby site powered ......
Read more >
Filtering by dates in Gatsby and Contentful - Stack Overflow
We can add a publishedAt datetime field in our ContentModel, which will help our content authors publish things in the future. We can...
Read more >
gatsby – CSS-Tricks
I got myself involved in this field, I co-founded (with Alexandra Spalato), ... Using New Gatsby Source WordPress Plugin originally published on CSS-Tricks ......
Read more >
Gatsby i18n: A Hands-on Guide | Phrase
One of the first and most popular of these frameworks is Gatsby. ... Published at {post.frontmatter.published_at}.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found