API Type: GraphQL
Compared to REST or RPC, I like that GraphQL adds a layer of typechecking at the API-level, lets clients request multiple resources in one query, and gives them the flexibility to request only what they want without having to implement variations on the API-side. Its structured nature also makes it easier for client libraries to implement normalized caching.
Might change soon? Very UnlikelySetup
graphql
is required for anything GraphQL. I also like graphql-scalars
, which provides additional scalars such as EmailAddress
, URL
, or PositiveInt
.
- Yarn
- NPM
yarn add graphql graphql-scalars
npm i graphql graphql-scalars