What is GraphQL?
mainGraphQL is a query language designed for building client applications. It provides an intuitive and flexible syntax for describing data requirements and interactions.
Key characteristics include:
- Not a programming language: It is used to make requests to application services that have capabilities defined by the GraphQL specification.
- Language/Storage Agnostic: It does not mandate specific programming languages or storage systems; instead, services map their capabilities to the GraphQL type system.
- Hierarchical Structure: GraphQL requests are structured hierarchically, mirroring the shape of the data in the response.
- Strong-typing: Every service defines an application-specific type system. This allows tools to validate requests for syntactic and type correctness before execution.
- Client-specified responses: Clients specify exactly what data they need at field-level granularity. A response contains exactly what was requested and no more.
- Self-describing: Through introspection, the GraphQL type system can be queried by the GraphQL language itself, allowing for the discovery of capabilities and documentation.
{
user(id: 4) {
name
}
}