A problem I’ve been facing is how to remove content in Gatsby that has a deadline. Here I’ll show you the approach I’m using to filter content at query time using GraphQL and then automate the build process.
Perhaps the easiest way to format dates in Gatsby is at query-time using Gatsby’s GraphQL layer.
Learn how to query structured content in Sanity with GraphQl and display the content in a Gatsby website
If you want to consume your Sanity dataset from a front-end the you will need to set up an API. You can do this using Sanity’s custom query language GROQ or GraphQL. These notes focus on the latter.