fix: threads draft arg through for child resolvers in GraphQL queries (#6196)

This commit is contained in:
Jarrod Flesch
2024-05-04 16:43:17 -04:00
committed by GitHub
parent 56bedb821f
commit 51149c75ff
50 changed files with 375 additions and 92 deletions

View File

@@ -11,6 +11,7 @@ type Args = {
currentDepth?: number
depth: number
doc: Record<string, unknown>
draft: boolean
fallbackLocale: null | string
findMany?: boolean
flattenLocales?: boolean
@@ -38,6 +39,7 @@ export async function afterRead<T = any>(args: Args): Promise<T> {
currentDepth: incomingCurrentDepth,
depth: incomingDepth,
doc: incomingDoc,
draft,
fallbackLocale,
findMany,
flattenLocales = true,
@@ -66,6 +68,7 @@ export async function afterRead<T = any>(args: Args): Promise<T> {
currentDepth,
depth,
doc,
draft,
fallbackLocale,
fieldPromises,
fields: collection?.fields || global?.fields,