HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
graphql
graphql-js
TypeScript2015–2021
graphql / graphql-js

graphql-js

A reference implementation of GraphQL for JavaScript

24Distinct people
27Mentions
0Explicit recommenders
20.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A reference implementation of GraphQL for JavaScript

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year27 dated mentions

Observed mentions: 2015-07-02 10:38:10 UTC to 2021-10-12 18:33:01 UTC.

024682015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC817
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC303
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC606
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC404
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC202
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC303
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
GraphQL.js The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook. See more complete documentation at https://graphql.org/ and https://graphql.org/graphql-js/. Looking for help? Find resources from the community. Getting Started A general overview of GraphQL is available in the README for the Specification for GraphQL. That overview describes a simple set of GraphQL examples that exist as tests in this repository. A good way to get started with this repository is to walk through that README and the corresponding tests in parallel. Using GraphQL.js Install GraphQL.js from npm With npm: npm install --save graphql With yarn: yarn add graphql With bun: bun add graphql GraphQL.js provides two important capabilities: building a type schema and serving queries against that type schema. First, build a GraphQL type schema which maps to your codebase. import { graphql, GraphQLSchema, GraphQLObjectType, GraphQLString, } from 'graphql'; var schema = new GraphQLSchema({ query: new GraphQLObjectType({ name: 'RootQueryType', fields: { hello: { type: GraphQLString, resolve() { return 'world'; }, }, }, }), }); This defines a simple schema, with one type and one field, that resolves to a fixed value. The resolve function can return a value, a promise, or an array of promises. A more complex example is included in the top-level tests directory. Then, serve the result of a query against that type schema. var source = '{ hello }'; graphql({ schema, source }).then((result) => { // Prints // { // data: { hello: "world" } // } console.log(result); }); This runs a query fetching the one field defined. The graphql function will first ensure the query is syntactically and semantically valid before executing it, reporting errors otherwise. var source = '{ BoyHowdy }'; graphql({ schema, source }).then((result) => { // Prints // { // errors: [ // { message: 'Cannot query field BoyHowdy on RootQueryType', // locations: [ { line: 1, column: 3 } ] } // ] // } console.log(result); }); Want to ride the bleeding edge? The npm branch in this repository is automatically maintained to be the last commit to 17.x.x to pass all tests, in the same form found on npm. It is recommended to use builds deployed to npm for many reasons, but if you want to use the latest not-yet-released version of graphql-js, you can do so by depending directly on this branch: npm install graphql@git://github.com/graphql/graphql-js.git#npm Using in a Browser GraphQL.js is a general-purpose library and can be used both in a Node server and in the browser. As an example, the GraphiQL tool is built with GraphQL.js! Building a project using GraphQL.js with webpack or rollup should just work and only include the portions of the library you use. This works because GraphQL.js is distributed with both CommonJS (require()) and ESModule (import) files. The exports map within the project package.json should direct runtimes and bundlers to the appropriate files. Tools that do not support exports will find the CommonJS and ESModule builds side by side, with the CommonJS code packaged in files with the .js extension and the ESModule build within .mjs files. Contributing We actively welcome pull requests. Learn how to contribute. This repository is managed by EasyCLA. Project participants must sign the free GraphQL Specification Membership agreement before making a contribution. You only need to do this one time, and it can be signed by individual contributors or their employers. To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you. You can find detailed information here. If you have issues, please email operations@graphql.org. If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the GraphQL Foundation. Changelog Changes are tracked as GitHub releases. License GraphQL.js is MIT-licensed. Version Support GraphQL.JS follows Semantic Versioning (SemVer) for its releases. Our version support policy is as follows: Latest Major Version: We provide full support, including bug fixes and security updates, for the latest major version of GraphQL.JS. Previous Major Version: We offer feature support for the previous major version for 12 months after the release of the newest major version. This means that for 12 months we can backport features for specification changes if they don't cause any breaking changes. We'll continue supporting the previous major version with bug and security fixes. Older Versions: Versions older than the previous major release are considered unsupported. While the code remains available, we do not actively maintain or provide updates for these versions. One exception to this rule is when the older version has been released < 1 year ago, in that case we will treat it like the "Previous Major Version". Long-Term Support (LTS) We do not currently offer a Long-Term Support version of GraphQL.JS. Users are encouraged to upgrade to the latest stable version to receive the most up-to-date features, performance improvements, and security updates. End-of-Life (EOL) Schedule We will announce the EOL date for a major version at least 6 months in advance. After a version reaches its EOL, it will no longer receive updates, even for critical security issues. Upgrade Assistance To assist users in upgrading to newer versions: We maintain detailed release notes for each version, highlighting new features, breaking changes, and deprecations. Our documentation includes migration guides for moving between major versions. The community forum (Discord channel #graphql-js) is available for users who need additional assistance with upgrades. Security Updates We prioritize the security
Read the full README on GitHub

What Hacker News says

27 sources
> I have only seen null vs undefined lead to 2 things in my experience: mistakes and bikeshedding. I disagree, though I think the implementation leaves something to be desired. Primarily, I think there is fundamentally a difference between the value of obj.bar in the following examples that is useful to differentiate between: { foo: 'hello' } { foo: 'hello', bar: null } For example, GraphQL makes specific use of this when dealing with input types for mutations: null essentially means "delete this field" while unset means "don't change it". There is a very good discussion on this topic here, https://github.com/graphql/graphql-js/issues/133 , which goes into the rationale behind it, how it's supported in languages that do NOT differentiate between null and undefined, and how some folks changed their minds on the issue.
In Tricks I wish I knew when I learned TypeScript
While I agree the presence of both null and undefined in JavaScript can make things a big pain in the ass, trying to get rid of null in favor of undefined is a huge mistake. For example, a couple years ago GraphQL specifically added support for the difference between undefined and null, and it was a good change. An optional field on an input type can be left off (in which case it is undefined) or it can be explicitly set to null. For a mutation, these have very different meanings: undefined means "don't update the property" while null means "update the property to null (which usually means 'delete')". These are very different things. This thread, https://github.com/graphql/graphql-js/issues/133, is a good overview.
In Intent to stop using 'null' in my JS code
First, Webpack and Babel are totally used for backend. If you look at a lot of Node libraries, they use ES6 modules in their [docs](https://github.com/graphql/graphql-js). While you could use mjs for this, it's still experimental. I do think create-react-app is a good innovation in the JS world. However, I've never found a good equivalent on the back end. Setting up even the most basic CRUD REST API requires a whole lot of typing for very little reward. As for convention, I think JS could do with more of it. I find that when I talk about adding more convention, people take it quite literally as "we need to reinvent Rails in JS". That's not at all what I mean. Convention can be something as simple as Rack, which is a consistent, useful interface between servers. Convention does not and is not tied to monoliths or MVC or any other aspect of
Read the rest
Rails.
In The melting pot of JavaScript (2017)
At Newsweek/The Daily Beast we used Adobe AEM which was very powerful. It had a flexible JCR-based content model and component based content editor. At the time (5 years ago) it had very little in the way of a content API so we had to build our own solution. We actually used our Content API with Rhino (Java js runtime) to render DustJS templates server-side. This server side rendering we built there inspired aspects of our Static Site Generator. Being able to load a project's GraphQL schema in memory allows us to improve caching when generating a large site. The content modeling an initial interface was heavily inspired by a CMS we used in our agency work called Webhook (http://www.webhook.com/). It was the first product we found which combined flexible content modeling with Static Site Generation. TakeShape goes one step further to provi
Read the rest
de a robust API that can be used with by the static site to enable dynamic experiences (think search, tag pages, user generated content). As far as GraphQL we use Facebook's reference implementation (https://github.com/graphql/graphql-js). The challenge with TakeShape is that we allow users to define their own content types which in turn generates their own GraphQL schema. This makes using high-level server libraries like Apollo which assume a static schema challenging to use. GraphQL itself takes care of a lot of the content functionality on its own. The challenge was adding all the missing pieces like authorization, authentication, rate-limiting, access policies, data validation, etc.
In Show HN: TakeShape, a Headless GraphQL CMS and SSG
In Relicensing React, Jest, Flow, and Immutable.js

Showing the 15 most recent of 27 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.