4 ms·
Ask HN: Should I use golang for building a graphql API
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!
- ioddly 8y agoI'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.
- dbetteridge 8y agoI 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
- smt88 8y agoStrong, structural type systems are a good fit for GraphQL back ends. You should look into TypeScript and Reason before you decide.
- nikolasburk 8y agoGo is a great language for building GraphQL servers, the https://github.com/99designs/gqlgen 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/graphql 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/typescript/graphql https://github.com/prisma/prisma-examples/tree/master/typesc...
- dbetteridge 8y agoAppreciated, hadnt heard of gqlgen but that looks much less boilerplate heavy
- ioddly 8y agoThanks 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.