Knowledgebase

Understanding GraphQL Print

  • backenddevelopment, backend, troubleshooting, caching, performance, guide, howto, solution
  • 0

Query-driven APIs.

WHAT IT IS

A query language where the client specifies exactly what data it wants.

WHAT PROBLEM IT ADDRESSES

Retrieving too much or too little from fixed endpoints, and making many requests to assemble a view.

WHAT IT PROVIDES

One endpoint A typed schema Clients requesting precisely the fields they need Introspection and generated documentation

WHAT IT COSTS

Caching becomes harder, since requests are not distinguished by address Complexity on the server Query cost that is difficult to predict

WHAT THE SEVERE PERFORMANCE PROBLEM IS

Resolving nested fields producing a query per item, repeatedly.

WHAT SOLVES IT

Batching and caching within a request.

WHAT TO IMPLEMENT ALWAYS

Query depth limits Complexity limits Timeouts

WHY

An unrestricted query can request deeply nested data and exhaust the server.

WHAT TO BE CAREFUL WITH

Introspection enabled publicly, revealing the entire schema Authorisation checked only at the top level

WHAT TO CHECK

Entitlement at every field resolving sensitive data.

WHEN TO USE IT

Many clients with differing data needs.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot