How to use the @sanity/schema/lib/sanity/groupProblems function in @sanity/schema

To help you get started, we’ve selected a few @sanity/schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / sanity / packages / @sanity / base / src / schema / createSchema.js View on Github external
module.exports = schemaDef => {
  const validated = validateSchema(schemaDef.types).getTypes()

  const validation = groupProblems(validated)
  const hasErrors = validation.some(group => group.problems.some(isError))

  let types = []
  if (!hasErrors) {
    types = [
      ...schemaDef.types,
      assetSourceData,
      slug,
      geopoint,
      legacyRichDate,
      imageAsset,
      fileAsset,
      imageCrop,
      imageHotspot,
      imageMetadata,
      imageDimensions,

@sanity/schema

## Terminology

MIT
Latest version published 3 days ago

Package Health Score

98 / 100
Full package analysis