Skip to content

Instantly share code, notes, and snippets.

@KATT
Last active October 6, 2021 10:17
Show Gist options
  • Save KATT/5fde9711ca4426205a20559ae4603fe2 to your computer and use it in GitHub Desktop.
Save KATT/5fde9711ca4426205a20559ae4603fe2 to your computer and use it in GitHub Desktop.
Issues with Hasura

Disclaimer - I'm a massive GraphQL-fan and been building APIs and React-apps with (in production) since 2016. All the criticism below are specifically to do with Hasura and not GraphQL itself.

Explicit types

i have an app that has a type of product listings where something like "price" is optional but price consists of several fields (amount, currency [and more that are irrelevant for this point]) so in the db they all have to be nullable, which is fine, but they are always presented as a group typically, as a consumer you'd want a nullable price: Price but i end up having to write custom client logic that I thought I was done with since starting making backends in graphql 4-5 years ago

Infrastructure

getting started with having a nice dev environment that can be orchestrated easily with migrations etc in every env + locally + CI is a bit of a bitch

Permission modeling

example, these two reqs are mutually exclusive

  • I want role user to access it's own email-field
  • I want role user to access other users' name-field (but not email)

"Inherit" rules of parent tables

Lack of control of graphql-api

I want to be able to use interfaces, unions, etc

Enforcing an api from db modelling becomes worse and worse with time and consistently causes breaking changes in your api.

One of the things that are amazing with GraphQL is the ease of non-breaking api changes and the built-in deprecation support combined with introspection. Hasura removes that.

Issues

1,100 open issues on github right now https://github.com/hasura/graphql-engine/issues

I've hit a bunch of them and when you do you have to do really awkward workarounds

Custom business logic

actions are a good thought but then actually hooking it up to your backend and then orchestrating that in different environments (ci/dev/staging/prod) is horrible (although i've gotten continious deployment and automated e2e testing working it was a horrible process)

writing sql functions is hard

it's not nice to write sql functions to extend your schema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment