Michał Tyszkiewicz
4/29/2021
After writing about some of the biggest libraries out there I think it's time to look at one that hasn't been covered as much, namely BaseQL. If we look at its website it says BaseQL lets you quickly create a GraphQL API from your production ready Airtable backend. In short it combines the benefits of Airtable with GraphQL. I’m going to boldly assume that if you’re here you already know a bit about GraphQL so let’s first look at what Airtable is.
To put it simple Airtable is a flexible service which lets you easily create relational datasets. It's like a hybrid of a spreadsheet and a database, you have cells but they can have types like checkbox or drop-down list and can have file attachments, for example images, which can be previewed. Everything is neatly compartmentalized:
While there are both more complex programs for database handling (like FileMaker Pro) and simpler services, better suited for casual use (like Google Sheets) Airtable is the closest to a catch all solution that will work best in most cases. Now if you want to use that solution it could be prudent to combine its benefits with those of GraphQL and luckily there’s just the thing for that.
All you need to do is a way to access the data stored in Airtable and that's what BaseQL was designed for.
BaseQL gives you a dynamic GraphQL API for your Airtable bases. This means you will be instantly able to query, search and mutate data from your Airtable bases using GraphQL and all its benefits. The key one being optimization as with GraphQL you get exactly what you wanted and just that, with no over or under fetching. Yes, unlike Airtable you’ll need to know the basics of GraphQL, but you’ll likely find it quite easy to get a hang of and BaseQL even provides you with a playground to test it out on their website. It also does not disturb anyone else in the workgroup who can just continue working on Airtable as usual while you get the data you need. The features are quite simple:
To start you need to install the BaseQL app via Airtable Marketplace (required Airtable PRO) or using Custom Blocks feature.
fetch('https://api.baseql.com/airtable/graphql/appuzDcQEvfnkzXjD', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Authorization: 'Bearer SECRET_TOKEN',
},
body: JSON.stringify({ query: '{ people: { name } }' }),
})
.then((r) => r.json())
.then((data) => console.log('data returned:', data));
To summarize Airtable with GraphQL makes for a pretty powerful combination. On the database side you can have anyone work on it and it requires no knowledge of programming at all. On the other side you can focus on building your app knowing that it will be able to fetch data efficiently via BaseQL from your Airtable bases. It gives you a lot of flexibility especially working in a group with different skills and it's also a great way to start getting into GraphQL if you want to do so. As mentioned before it's not perfect, but as far as working with databases goes it's definitely worth a try.