Recommended way to fetch data for static site generator


I noticed that the post on integrating Dato with static site generators uses the Content Management API using dato dump

However, it looks like your new site uses the GraphQL Content Delivery API

What situations would you use the Content Delivery API over the Content Management API in the context of static site generators?

What were the trade-offs that Dato considered when building the new site?

Hi @anthoq88, where possible, the best thing is to use our GraphQL API, as it’s under CDN, it’s heavily cached and gives faster responses.

dato dump is a tool that we released before our GraphQL API even existed, so it uses the REST API, downloading every content of your project locally to let you create markdown/yaml files compatible with practically any static generator. We might create a new tool similar to dato dump that uses GraphQL in the future.

As long as you’re working with a 100% static website generator, it really doesn’t matter that much which API you use. But if your website makes API calls in real time for each the visitor (like you can do with Next.js for example), then you should try to use GraphQL.