Gatsby Data Fetching Examples

Examples

Build Time

This data from GitHub is fetched using gatsby-source-graphql at build time. This data will only update when the site is rebuilt by Gatsby, but removes the need and latency to hit the GitHub API when the site loads. Without needing to hit an API, the site will load faster for visitors because the data was already loaded when the site built. This is especially beneficial for users with slower internet connections or if you want to allow your site to be visited offline using a plugin like gatsby-plugin-offline.

Gatsby repo: gatsbyjs/gatsby

Runtime

This data from GitHub is fetched using the Fetch API at runtime. This data will update every time you refresh this page.

Star count for the Gatsby repo: 0