Sanity not showing the content

Viewed 38

I wrote my first sanity schema in javascript but it's not showing on the site here is the code:

export default {
name: 'testimonials',
title: 'Testimonials',
type: 'document',
fields: [
    {
        name: 'name',
        title: 'Name',
        type: 'string',
    },
    {
        name: 'company',
        title: 'Company',
        type: 'string',
    },
    {
        name: 'imageurl',
        title: 'ImgUrl',
        type: 'image',
        option: {
            hotspot: true,
        }
    },
    {
        name: 'feedback',
        title: 'Feedback',
        type: 'string',
    },
],  

}

then I imported it into the schema.js file here is the code:

// First, we must import the schema creator
import createSchema from 'part:@sanity/base/schema-creator'

// Then import schema types from any plugins that might expose them
import schemaTypes from 'all:part:@sanity/base/schema-type'
import testimonials from './testimonials'


// Then we give our schema to the builder and provide the result to Sanity
export default createSchema({
  // We name our schema
  name: 'default',
  // Then proceed to concatenate our document type
  // to the ones provided by any plugins that are installed
  types: schemaTypes.concat([
    testimonials
  ]),
})

If anyone has this very annoying problem and resolved please share

1 Answers

not a direct answer, but I had a similar issue, and on Sanity's community Slack channel was advised to get the Vision plugin to check on your GROQ query. Hope that would help! https://www.sanity.io/docs/the-vision-plugin

Related