Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/tslint-5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashko Stubailo committed May 29, 2017
2 parents 1298715 + 64b3452 commit 78834ce
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Expand Up @@ -18,7 +18,7 @@ When using `graphql-tools`, you describe the schema as a GraphQL type language s

```js

const schema = `
const typeDefs = `
type Author {
id: ID! # the ! means that every author object _must_ have an id
firstName: String
Expand Down Expand Up @@ -59,7 +59,7 @@ export default schema;
Then you define resolvers as a nested object that maps type and field names to resolver functions:

```js
const resolverMap = {
const resolvers = {
Query: {
posts() {
return posts;
Expand Down Expand Up @@ -93,17 +93,15 @@ export default resolverMap;
At the end, the schema and resolvers are combined using `makeExecutableSchema`:

```js
import schema from './data/schema.js';
import resolverMap from './data/resolvers';
import { makeExecutableSchema } from 'graphql-tools';

const executableSchema = makeExecutableSchema({
typeDefs: schema,
resolvers: resolverMap,
typeDefs,
resolvers,
});
```

This example has the entire type definition in one string and all resolvers in one object, but you can combine types and resolvers from multiple files, as documented in the [modularizing the schema](http://dev.apollodata.com/tools/graphql-tools/generate-schema.html#modularizing) section of the docs.
This example has the entire type definition in one string and all resolvers in one file, but you can combine types and resolvers from multiple files and objects, as documented in the [modularizing the schema](http://dev.apollodata.com/tools/graphql-tools/generate-schema.html#modularizing) section of the docs.

## Contributions

Expand Down

0 comments on commit 78834ce

Please sign in to comment.