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

Check in groq query if array of objects contains a case insensitive string

I have an object that has an array called tags. It is array of objects. I need to query those objects that its tags contains a case insensitive string. [ { "_createdAt": "2022-02-18T09:16:27Z", "_id": "article-13000018493", "_rev":…
mahan
  • 12,366
  • 5
  • 48
  • 83
0
votes
1 answer

`part:` modifier in node import statement

I came across this code in a javascript / Node project but can't find any explanation online as to what it is and how it works. import PatchEvent, {set, unset} from 'part:@sanity/form-builder/patch-event';
0
votes
1 answer

Sanity.io webhook with body params

I added a webhook to Sanity and it works as expected, but I would like to pass a parameter in the body for {branch:"develop"} and I do not see an input field. I have tried appending ?branch=develop to the url, but that does not work. Any ideas on…
JL521
  • 41
  • 3
0
votes
1 answer

Sanity.io Fetching Through References

I'm trying to figure out how to access a full object reference through Sanity.io. Example code: const fetchExperience = async () => { const data = await sanityClient.fetch(`*[_type == 'experience'] { company, title, 'techStack':…
ryansle
  • 251
  • 2
  • 14
0
votes
2 answers

Using the Sanity client without specifying an API version is deprecated

I am getting this warning in the console and could not able to clearly understand the documentation. warnings.js:16 Using the Sanity client without specifying an API version is deprecated. See https://docs.sanity.io/help/js-client-api-version I…
harsha20599
  • 119
  • 3
  • 11
0
votes
1 answer

Switch to different sanity project

I have multiple sanity projects in my account. How can I switch to a particular account/project in my sanity cli for deploying the schema to correct project ?
user9040429
  • 690
  • 1
  • 8
  • 29
0
votes
0 answers

how to load data from sanitys desk

i am building MERN like app and using sanity as database when i try to load all the data that is not in array form in database then it goes well but if i try to load data that is in array form i am unable to do it (comments data) when i add a…
priyanshu
  • 5
  • 4
0
votes
1 answer

Render download link sanity.io result in a blank page

I'm new diving into sanity.io and I'm trying to figure out why is displaying a blank page. N.B. If I comment out the the JSON.stringify display everything correct, including the cvURL link. This is the code export default { name:…
Lloret82
  • 1
  • 2
0
votes
0 answers

Not redirecting to 404 when bad slug in URL with React

I'm building a blog using React and Sanity and in my Routes, the NotFound page works perfectly with static URLs but I found that it doesn't actually redirects for links with bad slug in URL: This is my App.js routes
Quentin C
  • 307
  • 3
  • 13
0
votes
2 answers

Can't delete a Sanity project

I recently set up a new Sanity project via the CLI, but accidentally used the wrong file path. Now I'm unable to delete the project from within Sanity via Project > Settings > Delete Project. I keep getting a vague error "Could not delete project."…
0
votes
1 answer

How do I turn a sanity io document field that is an array of objects to an array of strings

I have a recipes.js document that has a tag field: { name: 'tags', title: 'Tags', type: 'array', of: [{ type: 'reference', to: { type: 'tags' } }], options: { layout: 'tags', }, }, it references…
André Jarboe II
  • 558
  • 1
  • 5
  • 20
0
votes
1 answer

Sanity CMS, using type "object" as reference

Is it not possible to use an object type as a reference in sanity? For example this is not working. When I go to the field nothing shows up. If I can't do this how can I access the indexPage objects that have been created under other…
Taylor Austin
  • 5,407
  • 15
  • 58
  • 103
0
votes
1 answer

Sanity.io - Unknown field found: Encountered a field that is not defined in the schema

I'm trying to get external links working via Sanity studio, following the guide here https://www.sanity.io/guides/portable-text-internal-and-external-links. When working locally I can see the option to "Open in new window" in the editor, but in the…
Jacob Collins
  • 173
  • 5
  • 12
0
votes
2 answers

Why can't i map this array of objects within an object

Hi guy's i've been working with next.js, redux and sanity.io. It's been awful... Lol Anyways here's the code i'm stuck with ServiceCards.js import React from 'react'; import { useSelector } from 'react-redux'; import { getNavItems } from…
Tjs90
  • 61
  • 1
  • 10
0
votes
1 answer

useParams() not getting the userId and shows undefined in console when i console out userId

I am trying to access the userId of a user from the url (url looks something like this http://localhost:3000/user-profile/904900003354517617608). when i console out the userId it shows undefined. I have used useParams in some other components too…