Product changes

Robert van Boesschoten

Data API Update: Sort on Belongs to properties, Refresh tokens and more

We've said it before, we'll say it again: The Data API is a major building stone in Betty Blocks app development, enabling builders to serve data both in- and outside of Betty Blocks environments. In this release, we offer new features, improvements of existing features and bugfixes.

Sort on Belongs to properties

Sort on Belongs to properties in the Data API. This adds the ability to order on a belongs_to when doing ordering. We've also improved clarity in formatting of queries. Instead of providing a field and an order, Users can now give the following query and it will be ordered on , for example, 'movie.name'.

query{ 
allReview(sort: {relation: {movie: {name: DESC}}}){
results{
id
movie{
name
}
}
}
}

Note: a recompile is necessary for this feature to work.

 

Refresh token flow in Data API

Requesting data through the Data API can be available to everyone (public data) or only to authorized users (private data). For the second group, an active session is required. With the new Refresh token flow for the Data API, users can extend their active sessions, instead of starting a new one.  

 

Bugfixes and improvements

We also implemented some fixes for known issues and polished some existing features. Take a look below of what we've done recently. 

Improvements
- Added the model descriptions in the GraphQL schema for introspection. This is only visible when you are a builder of the app. Not when you are a (possible) end-user of the API.

Fixes
- We fixed a race condition scenario in the db connections used by the Data API.
- We fixed that sorting only worked when fields were specified in a specific order. That is no longer necessary.
- We fixed where querying one object with a file was not working properly.
- We fixed where changing model permission could be led to compilation errors of the data API.
- We fixed where string operators where snake_cased and are now camelCased.
- We fixed where the data API did not return the proper timezone at data time property results.
- We implemented a fix where ‘where’ variable filter was not correctly applied.

 

 

 

Subscribe to product changes