Minor Changes
-
abort underlying EventSource request when response fails validation (#1340) (ba3de6b)
-
add per-resource schema, query and projection registries (#1334) (b43e033)
SanitySchemasByResource,SanityQueriesByResourceandSanityProjectionsByResourcejoin the existingSanityQueriesregistry, following the same pattern: a global interface that the interface exported from@sanity/clientinherits from, so a generated file can register either way and does not depend on module resolution.Each is keyed by a resource, using the same string the App SDK already uses for its runtime cache,
projectId.datasetfor a dataset. This is what lets two datasets whose schemas disagree register different result types for the same query text, which the flatSanityQueriesregistry cannot express. Projections add a document-type level, because a projection resolves against whichever document the caller's handle names.All three are empty by default and nothing in the client reads them yet.
client.fetchandClientReturnare unchanged, and keep resolving through the flat registry. They exist for consumers that do resource-aware lookups themselves, starting with the App SDK's hooks.