Home / Function/ rpcSpy() — supabase Function Reference

rpcSpy() — supabase Function Reference

Architecture documentation for the rpcSpy() function in searchDocs.test.ts from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/docs/app/api/graphql/tests/searchDocs.test.ts lines 17–52

const rpcSpy = vi.fn().mockImplementation((funcName, params) => {
  if (funcName === 'search_content_hybrid') {
    const limit = params?.max_result || 2
    const mockResults = [
      {
        type: 'markdown',
        page_title: 'Test Guide',
        href: '/guides/test',
        content: params?.include_full_content ? 'Test content' : null,
        subsections: [
          { title: 'Introduction', content: 'Introduction content' },
          { title: 'Details', content: 'Details content' },
        ],
      },
      {
        type: 'markdown',
        page_title: 'Another Guide',
        href: '/guides/another',
        content: params?.include_full_content ? 'Another content' : null,
        subsections: [{ title: 'Getting Started', content: 'Getting Started content' }],
      },
      {
        type: 'reference',
        page_title: 'Create a SSO provider',
        href: 'https://supabase.com/docs/reference/api/v1-create-a-sso-provider',
        content: params?.include_full_content ? 'Creates a new SSO provider for a project' : null,
        metadata: {
          title: 'Create a SSO provider',
          subtitle: 'Management API Reference: Create a SSO provider',
        },
      },
    ]
    return Promise.resolve({ data: mockResults.slice(0, limit), error: null })
  }
  return Promise.resolve({ data: [], error: null })
})

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free