3 ms·
Datasette was designed for Vercel from the start. It's a really great way of turning data into a read-only API, with both JSON and GraphQL endpoints. https://d
by simonw 4y ago
Datasette was designed for Vercel from the start. It's a really great way of turning data into a read-only API, with both JSON and GraphQL endpoints.
https://datasette.io/ https://datasette.io/
Demo here: https://datasette.simonwillison.net/simonwillisonblog https://datasette.simonwillison.net/simonwillisonblog
GraphQL demo here: https://datasette.simonwillison.net/graphql?query=%7B%0A%20%20blog_entry(sort_desc%3A%20created)%20%7B%0A%20%20%20%20nodes%20%7B%0A%20%20%20%20%20%20title%2C%0A%20%20%20%20%20%20created%2C%0A%20%20%20%20%20%20blog_entry_tags_list%20%7B%0A%20%20%20%20%20%20%20%20nodes%20%7B%0A%20%20%20%20%20%20%20%20%20%20tag_id%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tag%0A%20%20%20%20%20%20%20%20%20%20%20%20blog_entry_tags_list%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20totalCount%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D https://datasette.simonwillison.net/graphql?query=%7B%0A%20%...
To deploy a SQLite database to Vercel with a GraphQL API:
brew install datasette
datasette install datasette-publish-vercel
datasette publish vercel mydatabase.db \
--project my-new-vercel-project-name \
--install datasette-graphql
Here's a tutorial on how to get data into that SQLite database in the first place: https://datasette.io/tutorials/clean-data https://datasette.io/tutorials/clean-data