For a new project we've chosen PostGraphile and I've spent a few days reading the PostGraphile documentation, but to me it seems like it just exposes the CRUD APIs for your underlying Postgres database and tries to move most of the logic in the database layer. I'm have a basic idea of the modularity/plugins and extendable plugins to add more functionality to the PostGraphile app.
But where/how exactly do I write the core/business logic of the micro service?
For example, I currently have a NodeJs REST based service that:
- Has an API that fetches data from database, sends it to another micro-service for processing waits for the result and stores the returned result back in the DB.
- Has an API that fetches and aggregates data from multiple micro-services and returns to the client, without doing any database reads.
- Has an API which fetches something from ElasticSearch and DynamoDB, processes it and returns a response.
So my question is, How do I do something similar with PostGraphile?
It just feels like I'm missing a piece of the puzzle.
If you like the plugin system, lookahead, etc then you could dive straight into Graphile Engine (which is agnostic to data store(s)) and use that to build your GraphQL API. If autogeneration and applying wide-ranging transforms appeals to you, that might be an interesting approach, but otherwise that system is not sufficiently optimised (yet) for one-off APIs currently (and is under-documented), so you might have a better time just writing your own types and resolvers with Apollo Server or similar.