GraphQL
GraphQL lets applications request fields through a typed API schema. The server remains responsible for data access and permissions.
Selecting the fields needed from an API
GraphQL is a query language for APIs with rules for server-side execution. A typed schema defines the data and operations on offer. The application selects the fields it needs from that schema. GraphQL does not require a particular database.
A fictional software company is planning a customer portal. The selection { project(id: "P-42") { name } } requests a project's name if its own schema offers those fields and that argument. This invented example is not a query sent to an existing service. The server implementation must fetch the data and decide whether the person requesting it may see it. A schema-valid call alone grants no access rights; the internal field internalRate should remain unavailable to customers even if they explicitly request it.
The portal therefore needs definitions for both the fields offered and their access rules. Field selection helps views with differing data needs; actual response times and database work must be examined in the implementation.
Sources
Related terms
- APIAn API defines how software can use functions or data offered by other software.
- RESTREST defines architectural constraints for distributed interfaces. Resources, stateless requests and links are part of the approach.
- Server-sent eventsServer-sent events carry text notifications from server to client over HTTP, for example about the progress of a background job.
- Entity tagAn ETag identifies a particular representation version of an HTTP resource and supports conditional reads or changes.
- Cross-Origin Resource SharingCORS controls browser access to responses across origin boundaries. It replaces neither API login nor permission checks.
- Electronic Data InterchangeEDI transfers structured business documents between systems. Format, partner profile, data mapping and responses need to agree.
Your project with ASES
Describe your project to us. We will get back to you with an initial assessment.