3 ms·
From the perspective of someone who's been neck-deep in a highly complex PostGraphile project for several years now, I wholeheartedly and strongly recommend tha
by Rudism 3y ago
From the perspective of someone who's been neck-deep in a highly complex PostGraphile project for several years now, I wholeheartedly and strongly recommend that you SHOULD NOT expose your database or autogenerate an API from your database. Maybe it's fine if you have a really basic schema and the API requirements are just a few CRUD endpoints with no business logic, but as soon as you go past that you'll find yourself in a world of pain.
One upsetting side effect of giving API consumers the ability to query your data arbitrarily, is they will absolutely find the most inefficient and resource-intensive ways to do it. And the blame when the "API" is taking several minutes to come back with data will be laid squarely at your feet even though the cause of the problem may not be under your control at all.