Thank you so much for the comprehensive answer! I will definitely be using raw sql to build out a custom field and will come back to your examples to guide me
I suddenly realized that I could use JSON as a type and added that to the SDL to access the count relations result
// api/src/post.sdl.js
type Post {
id: Int!
[...]
_count: JSON
}
With the code I posted earlier, I was able to access the count in the cell query!