fix: #1286, uses defaultDepth in graphql rich text depth

This commit is contained in:
James
2022-10-24 11:31:09 -04:00
parent 3967c1233f
commit 66bf8c3cbd

View File

@@ -117,11 +117,14 @@ function buildObjectType({
[field.name]: {
type: withNullableType(field, GraphQLJSON, forceNullable),
async resolve(parent, args, context) {
if (args.depth > 0) {
let depth = payload.config.defaultDepth;
if (typeof args.depth !== 'undefined') depth = args.depth;
if (depth > 0) {
await createRichTextRelationshipPromise({
req: context.req,
siblingDoc: parent,
depth: args.depth,
depth,
field,
showHiddenFields: false,
});