Last active
August 21, 2017 00:29
-
-
Save JeffML/ad5610cba9b47e6bfad5d598eebb082c to your computer and use it in GitHub Desktop.
Reorg: root schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
makeExecutableSchema | |
} from 'graphql-tools'; | |
import { | |
schema as authorpostsSchema, | |
resolvers as authorpostsResolvers | |
} from './authorposts'; | |
const baseSchema = [ | |
` | |
type Query { | |
domain: String | |
} | |
type Mutation { | |
domain: String | |
} | |
schema { | |
query: Query, | |
mutation: Mutation | |
}` | |
] | |
// Put schema together into one array of schema strings and one map of resolvers, like makeExecutableSchema expects | |
const schema = [...baseSchema, ...authorpostsSchema] | |
const options = { | |
typeDefs: schema, | |
resolvers: {...authorPostResolvers} | |
} | |
const executableSchema = makeExecutableSchema(options); | |
export default executableSchema; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment