Better HN
topnewbestaskshowjobs
Log inSign up

kaiba42

1 karma · joined Mar 24, 2017 (9y ago) · 1 submissions

Submissions

comment 4y ago · link · parent

Read the wall of comments.. I think GraphQL is great for one primary reason: schema.graphql files. Having strongly typed payload definitions that integrate with languages like Typescript is beneficial to frontend developers in the same way that protobuf schemas are beneficial to backend developers. I know REST APIs can accomplish the same degree of type safety using OpenAPI/Swagger schemas. Honestly, REST APIs that have these schemas start to look a lot like GraphQL APIs. To that end, using GraphQL really becomes a question of preference in using GraphQL’s schema definition language versus JSON as a schema definition language. In actuality, GraphQL schemas can be defined using JSON! And so this brings me to my conclusion about GraphQL. GraphQL is just a set of tools and conventions for implementing strongly typed REST APIs with JSON payloads. Who doesn’t want that?