mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 17:41:43 -05:00
Make debug email routes work with new APIs
This commit is contained in:
parent
a532dab9b7
commit
ad1f47ef73
3 changed files with 6 additions and 13 deletions
|
@ -79,7 +79,7 @@ export const getDefaultResolvers = (collectionName, resolverOptions = defaultOpt
|
|||
description: `A single ${typeName} document fetched by ID or slug`,
|
||||
|
||||
async resolver(root, { input = {} }, context, { cacheControl }) {
|
||||
const { selector, enableCache = false } = input;
|
||||
const { selector = {}, enableCache = false } = input;
|
||||
const { documentId, slug } = selector;
|
||||
|
||||
debug('');
|
||||
|
|
|
@ -21,8 +21,11 @@ Meteor.startup(function () {
|
|||
|
||||
// else get test object (sample post, comment, user, etc.)
|
||||
const testVariables = (typeof email.testVariables === 'function' ? email.testVariables() : email.testVariables) || {};
|
||||
// delete params.query so we don't pass it to GraphQL query
|
||||
delete params.query;
|
||||
// merge test variables with params from URL
|
||||
const variables = {...testVariables, ...params};
|
||||
// TODO: this is currently hardcoded to work with the SingleXYZInput type, maybe bad idea?
|
||||
const variables = { input: { selector: { ...testVariables, ...params } } };
|
||||
|
||||
const result = email.query ? await runQuery(email.query, variables, { locale }) : {data: {}};
|
||||
|
||||
|
|
|
@ -72,17 +72,7 @@ const resolvers = {
|
|||
},
|
||||
|
||||
},
|
||||
|
||||
// total: {
|
||||
|
||||
// name: 'UsersTotal',
|
||||
|
||||
// async resolver(root, { terms = {} }, { Users }) {
|
||||
// const {selector} = await Users.getParameters(terms);
|
||||
// return await Connectors.count(Users, selector);
|
||||
// },
|
||||
|
||||
// }
|
||||
|
||||
};
|
||||
|
||||
export default resolvers;
|
||||
|
|
Loading…
Add table
Reference in a new issue