Home / Function/ getDocument() — supabase Function Reference

getDocument() — supabase Function Reference

Architecture documentation for the getDocument() function in getDocument.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  898e75d6_b289_83d1_ddd4_0b7fa7700ee7["getDocument()"]
  e77004fb_c899_5274_2cb1_829839a631c9["getCachedDocument()"]
  e77004fb_c899_5274_2cb1_829839a631c9 -->|calls| 898e75d6_b289_83d1_ddd4_0b7fa7700ee7
  style 898e75d6_b289_83d1_ddd4_0b7fa7700ee7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/cms/src/utilities/getDocument.ts lines 10–24

async function getDocument(collection: Collection, slug: string, depth = 0) {
  const payload = await getPayload({ config: configPromise })

  const page = await payload.find({
    collection,
    depth,
    where: {
      slug: {
        equals: slug,
      },
    },
  })

  return page.docs[0]
}

Subdomains

Frequently Asked Questions

What does getDocument() do?
getDocument() is a function in the supabase codebase.
What calls getDocument()?
getDocument() is called by 1 function(s): getCachedDocument.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free