The query language for modern APIs

  • Deliver high-performance user experience at scale

  • Secure and stabilize your API with a strongly typed schema and validated queries

  • Reduce dependencies through efficient, distributed development

GraphQL is open source and trusted by the industry

Facebook's mobile apps have been powered by GraphQL since 2012. A GraphQL spec was open-sourced in 2015. Now it is used by industry-leading companies worldwide and supported by the GraphQL Foundation, hosted since 2018 by the non-profit Linux Foundation.

More GraphQL users
How it works

A GraphQL Query

  1. Describe your data
    type Project {
      name: String
      tagline: String
      contributors: [User]
    }
  2. Ask for what you want
    {
      project(name: "GraphQL") {
        tagline
      }
    }
  3. Get predictable results
    {
      "project": {
        "tagline": "A query language for APIs"
      }
    }
Try it out live
Business perspective

A proven solution for startups and enterprises

The best user
experience

Deliver high-performing user experiences at scale. The world’s leading apps use GraphQL to create faster, more responsive digital experiences.

  • Faster data retrieval and load times
  • Improved bandwith efficiency

Stability &
Security

Protect your APIs while maintaining full visibility into data consumption. GraphQL allows you to monitor, secure, and optimize API usage while ensuring compliance.

  • Stronger access control
  • Improved business intelligence & cost analysis

Efficient distributed
development

Let your teams ship faster with GraphQL’s flexible, decoupled architecture. GraphQL allows frontend and backend teams to work independently and efficiently.

  • More rapid iterations
  • Improved cross-team collaboration
Learn more
design principles

Five Pillars of GraphQL

Product-centric

GraphQL is unapologetically built for front-end engineers, aligning with their way of thinking, how views are structured and how data is consumed.

Hierarchical

Most product development involves the creation and manipulation of view hierarchies. GraphQL queries mirror UI structures, ensuring a natural way to request data that matches the shape of the response.

Strong-typing

Every GraphQL service defines a type system, enabling tools to syntactically validate queries before execution and ensuring predictable responses.

Client-specified response

A GraphQL service publishes the capabilities that its clients are allowed to consume. It is the client who control the data they receive, requesting only what they need at a field level, unlike traditional fixed endpoints.

Self-documenting

GraphQL APIs can describe themselves, allowing tools and clients to query the schema for available types and capabilities. It serves as a powerful platform for building common tools and client software libraries.

Powered by the community

GraphQL is an ecosystem shaped by thousands of collaborating developers and companies around the world. From solo contributors to full-time maintainers, the GraphQL community builds libraries, runs meetups, funds innovation and helps move the technology forward.

GraphQL advantages

Precision

Ask for what you need, get exactly that

Send a GraphQL query to your API and get precisely the data you request — no over-fetching, no under-fetching. Predictable responses keep apps efficient and performant.

Optimization

Retrieve multiple resources in one request

GraphQL seamlessly follows relationships between data, eliminating multiple API calls. While typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request. Ideal for complex queries and optimizing network performance.

Productivity

Move faster with powerful, community-built tools

Know exactly what you can request without leaving editor. Highlight potential issues before sending a query and take advantage of improved code intelligence. GraphQL makes it easy to build powerful tools. And many of them, like GraphiQL, are open source and built by the GraphQL community.

Consistency

Build confidently with a type-safe schema

GraphQL APIs are structured around types and fields, not endpoints. This ensures data consistency, self-documentation, and clear, actionable errors. Apps can use types to avoid writing manual parsing code.

Versionless

Evolve without versions

Add new fields and types without impacting existing queries. Deprecate outdated fields while keeping APIs clean and future-proof. By using a single evolving version, GraphQL APIs give apps continuous access to new features and encourage more maintainable server code.

Integration

Bring your own data and code

GraphQL is storage-agnostic — integrate databases, REST APIs, and third-party services into a single, cohesive data layer. Write GraphQL APIs that leverage your existing data and code with GraphQL engines available in many languages.

A query language for your API

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

Get many resources
in a single request

GraphQL queries access not just the properties of one resource but also smoothly follow references between them. While typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections.

Bring your own data and code

GraphQL creates a uniform API across your entire application without being limited by a specific storage engine. Write GraphQL APIs that leverage your existing data and code with GraphQL engines available in many languages. You provide functions for each field in the type system, and GraphQL calls them with optimal concurrency.

  • GraphQL
    type Character {
      name: String
      homeWorld: Planet
      friends: [Character]
    }
  • JavaScript
    // type Character {
    class Character {
      // name: String
      getName() {
        return this._name
      }
      // homeWorld: Planet
      getHomeWorld() {
        return fetchHomeworld(this._homeworldID)
      }
      // friends: [Character]
      getFriends() {
        return this._friendIDs.map(fetchCharacter)
      }
    }
  • Python
    # type Character {
    class Character:
      # name: String
      def name(self):
        return self._name
     
      # homeWorld: Planet
      def homeWorld(self):
        return fetchHomeworld(self._homeworldID)
     
      # friends: [Character]
      def friends(self):
        return map(fetchCharacter, self._friendIDs)
  • C Sharp
    // type Character {
    public class Character {
      // name: String
      public String Name { get; }
     
      // homeWorld: Planet
      public async Task<Planet> GetHomeWorldAsync() {
        return await FetchHomeworldAsync(_HomeworldID);
      }
     
      // friends: [Character]
      public async IEnumerable<Task<Character>> GetFriendsAsync() {
        return _FriendIDs.Select(FetchCharacterAsync);
      }
    }
  • GraphQL
    type Character {
      name: String
      homeWorld: Planet
      friends: [Character]
    }
  • JavaScript
    // type Character {
    class Character {
      // name: String
      getName() {
        return this._name
      }
      // homeWorld: Planet
      getHomeWorld() {
        return fetchHomeworld(this._homeworldID)
      }
      // friends: [Character]
      getFriends() {
        return this._friendIDs.map(fetchCharacter)
      }
    }
  • Python
    # type Character {
    class Character:
      # name: String
      def name(self):
        return self._name
     
      # homeWorld: Planet
      def homeWorld(self):
        return fetchHomeworld(self._homeworldID)
     
      # friends: [Character]
      def friends(self):
        return map(fetchCharacter, self._friendIDs)
  • C Sharp
    // type Character {
    public class Character {
      // name: String
      public String Name { get; }
     
      // homeWorld: Planet
      public async Task<Planet> GetHomeWorldAsync() {
        return await FetchHomeworldAsync(_HomeworldID);
      }
     
      // friends: [Character]
      public async IEnumerable<Task<Character>> GetFriendsAsync() {
        return _FriendIDs.Select(FetchCharacterAsync);
      }
    }