2 ms·
This is exactly why I use GraphQL for my APIs: 1. All inputs and outputs are strongly typed, and the framework validates the types before my code touches it 2
by hn_throwaway_99 6y ago
This is exactly why I use GraphQL for my APIs:
1. All inputs and outputs are strongly typed, and the framework validates the types before my code touches it
2. Can easily generate Typescript types from my GraphQL typedefs.
3. Types can evolve easily to maintain backwards compatibility with existing clients withOUT requiring explicit versions (if so desired).
- ecf 6y agoNot only is there benefit for the developer, but for the consumer as well. Having typed APIs allows IDE-like autocomplete when working with API tools like Insomnia. An entire website dedicated to documentation for REST endpoints and their query parameters can be replaced with a simple readme instructing those to point their tool to the GQL client endpoint.