fixes bug with using old api identifier
This commit is contained in:
@@ -41,6 +41,7 @@ const find = async (args) => {
|
||||
req: {
|
||||
locale,
|
||||
fallbackLocale,
|
||||
payloadAPI,
|
||||
},
|
||||
} = options;
|
||||
|
||||
@@ -54,7 +55,7 @@ const find = async (args) => {
|
||||
// Only allow depth override within REST.
|
||||
// If allowed in GraphQL, it would break resolvers
|
||||
// as a full object will be returned instead of an ID string
|
||||
if (api === 'REST') {
|
||||
if (payloadAPI === 'REST') {
|
||||
if (depth && depth !== '0') {
|
||||
optionsToExecute.options.autopopulate = {
|
||||
maxDepth: parseInt(depth, 10),
|
||||
|
||||
@@ -32,12 +32,12 @@ const findByID = async (args) => {
|
||||
|
||||
const {
|
||||
depth,
|
||||
api,
|
||||
Model,
|
||||
query,
|
||||
req: {
|
||||
locale,
|
||||
fallbackLocale,
|
||||
payloadAPI,
|
||||
},
|
||||
} = options;
|
||||
|
||||
@@ -48,7 +48,7 @@ const findByID = async (args) => {
|
||||
// Only allow depth override within REST.
|
||||
// If allowed in GraphQL, it would break resolvers
|
||||
// as a full object will be returned instead of an ID string
|
||||
if (api === 'REST') {
|
||||
if (payloadAPI === 'REST') {
|
||||
if (depth && depth !== '0') {
|
||||
queryOptionsToExecute.options.autopopulate = {
|
||||
maxDepth: parseInt(depth, 10),
|
||||
|
||||
@@ -28,10 +28,10 @@ const findOne = async (args) => {
|
||||
|
||||
const {
|
||||
depth,
|
||||
api,
|
||||
Model,
|
||||
slug,
|
||||
req: {
|
||||
payloadAPI,
|
||||
locale,
|
||||
fallbackLocale,
|
||||
},
|
||||
@@ -44,7 +44,7 @@ const findOne = async (args) => {
|
||||
// Only allow depth override within REST.
|
||||
// If allowed in GraphQL, it would break resolvers
|
||||
// as a full object will be returned instead of an ID string
|
||||
if (api === 'REST') {
|
||||
if (payloadAPI === 'REST') {
|
||||
if (depth && depth !== '0') {
|
||||
queryOptionsToExecute.options.autopopulate = {
|
||||
maxDepth: parseInt(depth, 10),
|
||||
|
||||
Reference in New Issue
Block a user