import { useParams } from 'common' import { DocSection } from '../../DocSection' import PublicSchemaNotEnabledAlert from '../../PublicSchemaNotEnabledAlert' import CodeSnippet from '@/components/interfaces/Docs/CodeSnippet' import { GeneratingTypes } from '@/components/interfaces/Docs/GeneratingTypes' import { InlineLink } from '@/components/ui/InlineLink' import { useProjectPostgrestConfigQuery } from '@/data/config/project-postgrest-config-query' interface IntroductionProps { selectedLang: 'bash' | 'js' } const Introduction = ({ selectedLang }: IntroductionProps) => { const { ref: projectRef } = useParams() const { data: config, isSuccess } = useProjectPostgrestConfigQuery({ projectRef }) const isPublicSchemaEnabled = config?.db_schema .split(',') .map((name) => name.trim()) .includes('public') return (
public schema and accessible by the active
database role for a request are available for querying.
}
snippets={isSuccess && !isPublicSchemaEnabled && public schema).
}
/>
If you have a GraphQL background, you might be wondering if you can fetch your data in a single round-trip. The answer is yes!
The syntax is very similar. This example shows how you might achieve the same thing with Apollo GraphQL and Briven.
If you still want to use GraphQL, you can. Briven provides you with a full Postgres
database, so as long as your middleware can connect to the database then you can still
use the tools you love. You can find the database connection details{' '}