Questions tagged [sanity]

Sanity is a structured content platform and API that also offers an open source, React-based Studio that functions as like a headless CMS on top of the Sanity APIs.

Sanity treats content as structured data and makes it easily available over an API. The collaborative editor, called the Content Studio, is a fully customizable, client-side web application. Documentation here.

833 questions
0
votes
1 answer

Filter an array of dates (datetime) with GROQ (sanity) (React App)

I have a list of movies that could be shown more than once. I decided to provide a user with an option to select multiple dates for a single movie (sanity studio interface). The schema for movies is as follows: export default { name: 'movie', …
0
votes
1 answer

How to explicitly set schema field type to [SanityImage]

I want to set an images field in my document to an array of type [SanityImage]. I have tried setting it to type: 'image' but when I query the field I get that the type is [SanityCollectionItemsImages] The images field is found inside an object…
Harry Theo
  • 784
  • 1
  • 8
  • 28
0
votes
1 answer

How to create a custom endpoint in Sanity CMS?

I have a Sanity CMS with some data and a Gatsby frontend which fetches the data from Sanity via GraphQL. This works well in most cases but I would need a custom endpoint which gives back a document based on some arbitrary logic. I've tried the…
laszlo_kiss
  • 436
  • 4
  • 5
0
votes
2 answers

How to change field style in the sanity io user interface?

How can I change a style of a component easy? I just want limit a text-field height in a sanity user inerface. It is uncomfortable to scroll all the text every time. Where can I write something like that: { overflow-y: auto; height:…
kizoso
  • 1,216
  • 2
  • 15
  • 30
0
votes
0 answers

How to configure Babel when unit testing a Sanity Studio project

I'm using sanity.io as a headless CMS and am trying to unit test some of my code. Sanity internally uses babel to pre-compile the source code. For my unit tests I am using mocha and am invoking it with the following script (in…
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
-1
votes
0 answers

How to make a POST request from Nuxt to Sanity CMS

I am new to working with Nuxt and sanity and have a question regarding post requests. The frontend of my application is build using Nuxt and for the backend I use sanity. I would like to make post requests from the frontend to automatically create…
Emma
  • 1
-1
votes
1 answer

Displaying image from sanity in Vue (nuxt project)

i am new to sanity, i am struggling for displaying image from sanity this is the code for my frontend is this the problem? and this is the result and lastly this is the sanity…
kiroo
  • 9
  • 2
-1
votes
0 answers

Sanity.io schema type number can't store numbers after decimal point that end with 0

In my Sanity.io project I have a schema with input field with type number. I am trying to use it to represent currency or money. The issue is that when I publish value that has number ending with 0, the zero gets removed Example: 3.00 is stored as 3…
-1
votes
1 answer

Facing this issue when initalizing sanity in vscode for my react app

npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! errno ERR_SOCKET_TIMEOUT npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/babel-p at makeError$1…
-1
votes
1 answer

Issue with post request in sanity.io and Next.js 13

I have been trying to post a new user to my sanity content lake using the sanity mutation but for almost a week now, I kept on getting same error. This is the error: http://localhost:3000/api/register net::ERR_ABORTED 500 (Internal Server…
Rengkat
  • 23
  • 8
-1
votes
2 answers

Error when fetching data. Sanity studio v3 and React

It can't find any reason why this wouldn't work. I have watched all tutorials doing the same. Any one have an idea?
-1
votes
1 answer

I am using Sanity.io and came across this error in the database...Encountered a field that is not defined in the schema

This is my data.js file where I have mentioned all the queries export const userQuery = (userId) => { const query = `*[_type == "user" && _id == '${userId}']`; return query; } export const searchQuery = (searchTerm) => { const query =…
-1
votes
2 answers

Sanity unauthorized Issue

I have created a project in next.js with sanity. When I run sanity studio, it gives unauthorized error You are not authorized to access this studio. Maybe you could ask someone to invite you to collaborate on this project? If you think this is an…
Raja Ahsan
  • 23
  • 6
-1
votes
1 answer

How to solve this error: Failed to resolve import "part:@sanity/base/schema-creator" from "schemas/schema.js"

I have the following error: plugin:vite:import-analysis] Failed to resolve import "part:@sanity/base/schema-creator" from "schemas/schema.js". Does the file exist? It looks like sanity/base dependency is non existent but every time I go to install…
Jerm
  • 39
  • 8
-1
votes
1 answer

TypeScript Sanity syntax error screams unexpected token

In my localhost it screams that there is a syntax error in my utils folders where I am fetching skills, I have a few more fetch files setup the same way but this one screams in the local host as such Next I ran my build to see what he terminal…
BLCKSTRT
  • 41
  • 6