Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ JavaScript can be produced by running:
npm run build
```

Once `npm run build` has run, you may `require()` directly from node.
Once `npm run build` has run, you may `import` or `require()` directly from
node.

The full test suite can be evaluated by running:

Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,20 @@ serving queries against that type schema.
First, build a GraphQL type schema which maps to your code base.

```js
var GraphQL = require('graphql');

var schema = new GraphQL.GraphQLSchema({
query: new GraphQL.GraphQLObjectType({
import {
graphql,
GraphQLSchema,
GraphQLObjectType,
GraphQLString
} from 'graphql';

var schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'RootQueryType',
fields: {
hello: {
type: GraphQL.GraphQLString,
resolve: function() { return 'world'; }
type: GraphQLString,
resolve: () => { return 'world'; }
}
}
})
Expand All @@ -79,7 +84,7 @@ Then, serve the result of a query against that type schema.
```js
var query = '{ hello }';

GraphQL.graphql(schema, query).then(function (result) {
graphql(schema, query).then(function (result) {

// Prints
// {
Expand All @@ -97,7 +102,7 @@ it, reporting errors otherwise.
```js
var query = '{ boyhowdy }';

GraphQL.graphql(schema, query).then(function (result) {
graphql(schema, query).then(function (result) {

// Prints
// {
Expand Down Expand Up @@ -126,7 +131,8 @@ JavaScript can be produced by running:
npm run build
```

Once `npm run build` has run, you may `require()` directly from node.
Once `npm run build` has run, you may `import` or `require()` directly from
node.

After developing, the full test suite can be evaluated by running:

Expand Down