-
https://graphql.org/blog/graphql-a-query-language/
A GraphQL query is a string that is sent to a server to be interpreted and fulfilled, which then returns JSON back to the client.
- client downloads more information than is actually required in the app
- endpoint doesn’t provide enough of the required information
- it needs to make one additional request per element to fetch the required data
-
https://stablekernel.com/advantages-and-disadvantages-of-graphql/
👍
- clients have the ability to dictate exactly what they need from the server, and receive that data in a predictable way
- ability to retrieve many resources in a single request
- strongly-typed API
Every GraphQL service defines a set of types which completely describe the set of possible data you can query on that service. Then, when queries come in, they are validated and executed against that schema
👎
- queries always return a HTTP status code of
200
- If your query is unsuccessful, your response JSON will have a top-level
errors
key with associated error messages and stacktrace
- If your query is unsuccessful, your response JSON will have a top-level
- lack of built-in caching support
- complexity
- N+1 Problem - https://github.com/graphql/dataloader