diff --git a/app/lib/sanity/sanity.server.ts b/app/lib/sanity/sanity.server.ts index b354d5b..85279c6 100644 --- a/app/lib/sanity/sanity.server.ts +++ b/app/lib/sanity/sanity.server.ts @@ -3,7 +3,7 @@ import type { ContentSourceMap, FilteredResponseQueryOptions, QueryParams, - SanityStegaClient, + SanityClient, UnfilteredResponseQueryOptions, } from '@sanity/client/stega'; import type {BaseQuery, InferType, z} from 'groqd'; @@ -31,7 +31,7 @@ type BaseType = z.ZodType; type GroqdQuery = BaseQuery>; export type Sanity = { - client: SanityStegaClient; + client: SanityClient; query(options: { cache?: CachingStrategy; groqdQuery: T; @@ -56,9 +56,7 @@ export function createSanityClient(options: CreateSanityClientOptions) { typeof projectId === 'undefined' || typeof apiVersion === 'undefined' || typeof dataset === 'undefined' || - typeof studioUrl === 'undefined' || - typeof useCdn === 'undefined' || - typeof useStega === 'undefined' + typeof studioUrl === 'undefined' ) { throw new Error('Missing required configuration for Sanity client'); } @@ -68,8 +66,8 @@ export function createSanityClient(options: CreateSanityClientOptions) { dataset, projectId, studioUrl, - useCdn, - useStega, + useCdn: useCdn ?? true, + useStega: useStega ?? 'true', }); if (!sanityServerClientHasBeenInitialized) {