Ask HN: Should I use golang for building a graphql API

3 points by dbetteridge ↗ HN
I'm at the early stages of building an API, i've laid out my database structure and some idea of the functions/features I need from it.

However i'm a bit stuck on language for building the API itself, there will be a need for document upload and full user role based access control.

Is Go's graphql setup mature enough for this use case, or will I need to be building a lot from scratch, would something like Python with Django or Flask be a better choice for getting something off the ground ASAP?

Thanks!

6 comments

[ 2.9 ms ] story [ 22.0 ms ] thread
Strong, structural type systems are a good fit for GraphQL back ends. You should look into TypeScript and Reason before you decide.
I'm using graphql-go/graphql at the moment. Sparse documentation, but everything seems to work correctly. I'm not too familiar with the Python GraphQL stuff, but here I'm writing my own schema and resolvers, so I guess it depends on what you mean from "by scratch."

If you need something off the ground ASAP, maybe look at something like Hasura or Postgraphile: point it at your DB and get the GraphQL resolvers.

I have started with graphql-go/graphql but the lack of documentation is what i was getting at with the maturity aspect.

Thanks for the suggestions

Go is a great language for building GraphQL servers, the https://github.com/99designs/gqlgen library helps you by build type-safe GraphQL servers and reduces the boilerplate. You can find an example here: https://github.com/prisma/prisma-examples/tree/master/go/gra...

Otherwise I'd recommend TypeScript - the tooling ecosystem around GraphQL is definitely most advanced in the JS space. If you're interested, you can check out an example here: https://github.com/prisma/prisma-examples/tree/master/typesc...

Appreciated, hadnt heard of gqlgen but that looks much less boilerplate heavy
Thanks for the heads up on gqlgen. Have you used its subscription + websocket functionality? This is the part I haven't figured out with graphql-go yet.