UNPKG

apollon-cli

Version:

27 lines (21 loc) 596 B
/** * * @param {{Query,Mutation,Subscription}} schema * @param {{SimpleSubscription, fs}} helpers */ module.exports = function(schema, helpers) { let {Query, Mutation} = schema; // Type field resolvers schema.NameOfType = { // example of a field called json json: async function(root, params, context){ return JSON.stringify(root); } } // Query resolvers Query.NameOfQuery = async function(root, params, context){ } // Mutation resolvers Mutation.NameOfMutation = async function(root, params, context){ } };