passes context locales by default to gql resolvers

This commit is contained in:
James
2020-04-10 11:52:02 -04:00
parent 7b6d24669b
commit 56ad633e41
2 changed files with 4 additions and 0 deletions

View File

@@ -13,6 +13,8 @@ const getFind = (config, collection) => withDefaultLocale(
model: collection.model,
query: {},
paginate: {},
locale: context.locale,
fallbackLocale: context.fallbackLocale,
};
if (args.where) options.query.where = args.where;

View File

@@ -12,6 +12,8 @@ const findByID = (config, collection) => withDefaultLocale(
depth: 0,
model: collection.model,
id: args.id,
locale: context.locale,
fallbackLocale: context.fallbackLocale,
};
if (args.locale) {