GraphQL JavaScript Reference Implementation
github.com
1
Leaving SiteNav
External Link Disclaimer
You are about to visit github.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
GraphQL is a free and open-source query language for APIs and a runtime for fulfilling those queries with existing data. Originally developed internally at Facebook (now Meta) by Lee Byron, Nick Schrock, and Dan Schafer starting in 2012 (driven by the need for a more efficient and flexible data layer for Facebook's mobile applications), GraphQL was open-sourced in 2015. Since 2018, GraphQL has been maintained by the GraphQL Foundation under the Linux Foundation. This repository contains the JavaScript reference implementation of the GraphQL specification. Key features: query language: clients specify exactly what data they need, and the server returns only that data, eliminating over-fetching (downloading more data than needed) and under-fetching (making multiple requests). Queries are hierarchical and strongly typed. Schema definition: the API schema is defined using the GraphQL Schema Definition Language (SDL), declaring types (Object, Input, Enum, Interface, Union, Scalar), fields, arguments, and relationships between types. This schema serves as a contract between client and server and enables automatic validation, introspection, and tooling. Single endpoint: all queries, mutations (data modifications), and subscriptions (real-time updates via WebSocket) are sent to a single /graphql endpoint, simplifying API architecture compared to REST's multiple endpoints. Type safety: the strongly typed schema enables compile-time checking, automatic documentation, and powerful developer tooling (GraphiQL, Apollo Studio, Codegen). Resolver functions: each field in the schema has a resolver function that fetches the corresponding data from databases, microservices, or other APIs. Resolvers can batch and cache requests to avoid N+1 queries using DataLoader. Introspection: clients can query the schema itself to discover available types, fields, and operations. GraphQL clients: Apollo Client, urql, Relay. JavaScript/TypeScript. MIT.
Tags & Categories
Categories
Tags
Statistics
1
Views
0
Clicks
0
Like
0
Dislike