3 ms·
The article glosses over my favorite feature: it is typed. Being able to automatically type the network responses on the frontend is huge. Never before had I s
by it_citizen 4y ago
The article glosses over my favorite feature: it is typed.
Being able to automatically type the network responses on the frontend is huge. Never before had I such confidence in the FE code I am writing. My entire FE project is typed end to end without any manual assumption and things work most of the time on the first successful compilation.
- no_wizard 4y agoOpenAPI is suppose to help with this as well, though I haven't seen alot of good examples in the wild (or where I have worked) where OpenAPI was implemented well or from the start.
- jeffdn 4y agoAn alternative approach is to use something like Thrift to type your responses —- properly implemented, an RPC framework like that is amazing. So much validation boilerplate removed on the backend, and receiving it on the frontend as a nice type is fabulous as well.
- vaibhav2614 4y ago+1 to this. In my experience, the open source tooling around GraphQL is much better than the tools that generate types from other SDLs like protobufs. This makes it really easy for servers and clients to behave in a typesafe manner. I've seen a backend service / front-end SPA use REST, grpc and then GraphQL to communicate. Type safety has been the easiest to understand and scale across the eng team using the GraphQL ecosystem.
- ab-dm 4y ago100% this. I’ve used GraphQL on two projects now, where we manage the front and back end, and it’s been an amazing experience. A strong type system, combined with a GraphQL code generator and typescript, has been an amazing experience as both front and back end developer. Not only do I have types for the backend (for the Things like input args as well as models), I have types for the front end, as well as easy to use hooks to utilise them in React. During development, we constantly fetch the latest schema and check if anything has changed, If so the build breaks then and there, highflying which queries are no longer valid. The development experience has been amazing, and much more productive than and REST based workflow I’ve used, purely because of the type system.