| name | GraphQL.js |
|---|---|
| description | The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment. |
| url | https://www.graphql-js.org/ |
| github | graphql/graphql-js |
| npm | graphql |
To run a GraphQL.js hello world script from the command line:
npm install graphqlThen run node hello.js with this code in hello.js:
var { graphql, buildSchema } = require("graphql")
var schema = buildSchema(`
type Query {
hello: String
}
`)
var rootValue = { hello: () => "Hello world!" }
var source = "{ hello }"
graphql({ schema, source, rootValue }).then(response => {
console.log(response)
})