@hydre/make_schema
v1.3.0
Published
An utility function to build a graphql schema
Downloads
5
Readme
const schema = make_schema({
document: 'type Query { ping: String! }',
resolvers: {
Query: {
ping: () => 'pong',
},
Subscription: {
ping: {
resolve: () => 'pong',
async *subscribe() {
yield 0
},
},
},
},
directives: {
foo: ({
resolve, // original resolver
root, // resolver params in the same order
parameters, // .
context, // .
info, // .
directive_arguments, // parameters for the directive
}) => {},
},
})