4 ms·
Companies like Facebook limit the documents that can be queried against their GraphQL API this way. There are some major benefits of this: - improving the spee
by syrusakbary 8y ago
Companies like Facebook limit the documents that can be queried against their GraphQL API this way.
There are some major benefits of this:
- improving the speed of the HTTP request (it always be faster to just send a documentId rather than a big query sting from the client side)
- Control what is queried against your API (so there are no "Facebook" clones with some extra views)
At the end, with enough tooling you can make the frontend projects upload their documents queries automatically as their developers work on it. So the tradeoffs for GraphQL APIs focused on internal products are not as bad.
- underwater 8y agoI don’t think Facebook is limiting the queries that can be run. Persisted queries are an optional optimisation on top of dynamic queries.