Hacker News new | past | comments | ask | show | jobs | submit login

I've been building a GraphQL only product for 1.5 years now. It was also the best scenario for graphQL because we were also rewriting an entire app from scratch.

For some background info this app has a huge feature set, low traffic, B2B, and at most 2 developers working on this app for about 1 year.

For the technical side I chose typescript from the back end and front end (Angular). This mean I could use the same typings from our ORM mongoose.

Very early on I was able to pick tooling that ending up being cutting edge compared to any other tool in any language, namely the tools where graphql-compose, grapqhl-compose-mongoose, and graphql-code-generator. In addition GraphQL lent itself pretty well to dependency injection on the server side.

It took about 6 months to get fully proficient, but it was completely worth it being able to use the same types for the front end and back end. GraphQL even made it possible to bootstrap types from mongoose into the server. A lot of time when dealing with 3rd party services I could copy the docs and turn it into types for the resolvers.

The biggest single benefit of it all was side stepping the middleware of Express. I didn't realize how awful express middleware are, because you can't really control the middleware chain very well. But the library with graphql-compose made chaining resolvers extremely precise, which was important.

Overall I love working with GraphQL but I realize that I probably could have done just as well with rest if the backend has decent middleware chaining i.e not express. For performance there is lots of options that are often built in like client caching, batched queries, whitelist queries, and persisted queries. It worked pretty well in a PWA too.

tl;dr

pros

- types everywhere!

- following the logic of any resolver is usually pretty straightforward.

- true middleware

- learned how to make good rest frameworks in the future.

cons

- hugely steep learning curve




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: