Created
March 5, 2020 18:36
-
-
Save bogoslavskiy/3462d3615c0aa6c3be78b48eba282952 to your computer and use it in GitHub Desktop.
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 merge = require('lodash/merge'); | |
import Scalars from './scalars'; | |
// Modules | |
import Messages from './resolvers/Messages'; | |
import Device from './resolvers/Device'; | |
const Modules = { | |
typeDefs: [ | |
Messages.typeDefs, | |
Device.typeDefs, | |
], | |
resolvers: merge( | |
Messages.resolvers, | |
Device.resolvers | |
) | |
}; | |
const schema = makeExecutableSchema({ | |
typeDefs: [ | |
...Scalars.declarations, | |
...Modules.typeDefs | |
], | |
resolvers: { | |
...Scalars.resolvers, | |
...Modules.resolvers | |
} | |
}); | |
export default schema; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment