Using the API

At the heart of subZero sits PostgREST and as such, the REST interface is actually the same as the one exposed by PostgREST.
What subZero does is put a proxy in front of PostgREST in order to be able to have control of the url prefix of the api, cache responses and provide a mechanism to restrict which columns are available for filtering plus a lot of other usefull features that are not the target of PostgREST. Other then that, anything describe in the PostgREST documentation, you can trust it's available in subZero REST interface. Rather then maintaining duplicate documentation here, you can consult the exelent docs that PostgREST provides.
The only thing to remember is that whenever you see a url like /people, it's equivalent in a default subZero installation is /rest/people (but you can change that if you like)

Let's just check a few examples:

Get the projects of a specific client and all the active tasks for them

This is another example of a safety net the database gives you when you leverage its features, it will not let you corrupt your data by accident. We will have to be specific using ON DELETE what happens to related comments when a task is deleted. It might seem annoying at first but this strictness will save you a lot of headake in the long run.

Some of you might have come here for GraphQL specifically and all we've shown you so far was SQL and REST. So without any further ado, open this address in your browser http://localhost:8080/graphiql/

This is a nice IDE available in development mode to interact with your API. Use the auto-complete and the automatically generated documentation on the right to see what you can do with this api and by the way, the GraphQL endpoint for the api is http://localhost:8080/graphql/simple/ and http://localhost:8080/graphql/relay/ depending on the flavour you prefer.

Let's try and run a few queries:

Login, the browser will get back a session cookie that will allow us to execute other requests in an authenticated state

If you have LivePage extension in chrome, when iterating over your API, just like in REST, all you need to do is edit the files and save them and by the time you Alt+TAB to the browser, the page is refreshed and ready for you to (re)execute your GraphQL query.

Info

If you are familiar with the GraphQL ecosystem, you've probably figured out by now that this structure for the API will not work with Relay. subZero is capable of generating a compatible API but for the purpose of this tutorial we used this simple version to better see the relation between the GraphQL types and the entities in the api schema without the mental overhead of such concepts as viewer, connections, edges