From 60b52cf946fb77d59b31b143dd60006d7475ee0c Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Mon, 5 Oct 2020 21:22:31 +0200 Subject: [PATCH] Add publicationState only if received in the args Signed-off-by: Alexandre Bodin --- packages/strapi-plugin-graphql/services/type-definitions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/strapi-plugin-graphql/services/type-definitions.js b/packages/strapi-plugin-graphql/services/type-definitions.js index ebfb4633fc..7d3742a3c3 100644 --- a/packages/strapi-plugin-graphql/services/type-definitions.js +++ b/packages/strapi-plugin-graphql/services/type-definitions.js @@ -224,6 +224,8 @@ const buildAssocResolvers = model => { } } + console.log(queryOpts); + const results = association.model ? await strapi.plugins.graphql.services['data-loaders'].loaders[targetModel.uid].load( { @@ -437,7 +439,7 @@ const buildCollectionType = model => { [pluralName]: async (parent, args, ctx, ast) => { const results = await buildQuery(pluralName, resolverOpts)(parent, args, ctx, ast); - const __options__ = { _publicationState: args.publicationState }; + const __options__ = _.pick(args, 'publicationState'); return assignOptions(results, { __options__ }); }, },