All Questions

Tagged with
Filter by
Sorted by
Tagged with
7 votes
2 answers
3k views

Old records still showing on Sanity

I have created a Sanity.io CMS, I have made some alterations to the schema after content had already been entered. The problem now is that the content is still saved somewhere inside the cms and I ...
Aiden Barrett's user avatar
4 votes
2 answers
2k views

Querying images from Sanity for GatsbyImage

I'm having trouble sourcing images from Sanity using the new gatsby-plugin-image. The documentation says to do the following: import React from 'react' import {getGatsbyImageData} from 'gatsby-source-...
Finnian Langham's user avatar
3 votes
1 answer
284 views

Gatsby development server stops working when repo is created on github. Sanity, Gatsby Error

I received a github repo backup from somebody elses account. The project is running gatsby, sanity cms and is hosted via netlify. When I extract the archive and saving the folder locally, I am ...
user5123123's user avatar
3 votes
1 answer
299 views

Escape HTML entities and render URL dynamically

The problem can be seen here I built a site using Sanity headless CMS and GatsbyJS on the frontend. I'm querying URLs dynamically so that it can be rendered inside the src attribute of an </iframe&...
Null isTrue's user avatar
  • 1,892
3 votes
1 answer
2k views

GraphQL - Gatsby.js- React component. - How to query with variables/arguments?

I have a React Component that needs to query data. And I want to pass arguments/variables to the query. But I don't know how to do that. For example. I have this blog item carousel that wants to query ...
Tim's user avatar
  • 881
2 votes
3 answers
3k views

My Gatsby GraphQL schema wont update with new Sanity schema

I am trying to update my CMS to enable a user-defined product slider. Upon adding the relevant schema to my sanity source files (This works) and adding the documents to the schema there is no update ...
Aiden Barrett's user avatar
2 votes
1 answer
978 views

Reasoning with _raw and normal data in Gatsby, GraphQL and Sanity

I've just started using Gatsby with the Sanity headless CMS. For the most part it's pretty straight forward; but knowing best practises for querying the data through GraphQL is still bothering me. ...
shennan's user avatar
  • 11.2k
2 votes
1 answer
1k views

How to create custom resolvers for Gatsby page queries?

I have a Gatsby application pulling data from Sanity. This is Sanity's schema for the course.js: import video from './video' export default { // Computer name name: `courses`, // Visible ...
André Casal's user avatar
  • 1,110
2 votes
1 answer
1k views

How to use internal links in sanity.io and gatsby with gatsby-source-sanity?

I have created an internalLink type following the sanity documentation and as per the gotcha note about using internalLinks with a graphql api, I have created it as a separate type as follows: export ...
aks94's user avatar
  • 375
2 votes
1 answer
683 views

Missing 'fixed' and 'fluid' fields on image asset with `gatsby-source-sanity`

I'm trying to source images from Sanity with gatsby-source-sanity and gatsby-image. In the past I've had no issue querying the fluid image asset like so: export const query = graphql` query { ...
Finnian Langham's user avatar
2 votes
1 answer
82 views

Dynamic pages at load time, not build time

I'm building an editorial site that regularly adds new content. As such, they've requested that articles and article content is loaded in at load time rather than having to run a build and wait for it....
Chrish D's user avatar
2 votes
1 answer
423 views

...GatsbySanityImageFluid - Cannot read property 'fluid' of null

I'm working with Sanity and Gatsby I'm trying to map over an array of images to display them in an image gallery. My GraphQL query is working, I am able to display a single image but I receive the ...
aglasier's user avatar
  • 199
1 vote
1 answer
2k views

Passing CSS classes into sanity block-content root

Imagine following situation: I retrieve rich text as block-content from sanity CMS. The block-content contains a single block, which could be for example <h2>Hello World</h2>. This HTML is ...
MucoBey's user avatar
  • 191
1 vote
1 answer
1k views

Sanity.io - Add custom date to slug url

I'm building a Gatsby portfolio site with a Sanity back-end. The homepage of the site is going to feature a grid of tiles which link through to blog posts. I want the blog post URLS to have the ...
James Howell's user avatar
  • 1,422
1 vote
1 answer
2k views

Problem with rich text that I get from Sanity

import React from "react" import { Link, graphql } from "gatsby" import Image from "gatsby-image" import BlockContent from "@sanity/block-content-to-react" import Layout from "../components/...
Mario93's user avatar
  • 55
1 vote
1 answer
268 views

Lunr - gatsby-plugin-lunr - Can I alter data / index on build?

I've got a Gatsy-Sanity project that needs a search component. For this I though of using gatsby-plugin-lunr. I run into a problem that my nodes are multilingual. For example one of my fields is ...
Tim's user avatar
  • 881
1 vote
3 answers
4k views

React-Router-Bootstrap <LinkContainer> Error: You should not use <withRouter(LinkContainer) /> outside a <Router> - Gatsby problem?

'm creating a project using Sanity and Gatsby.js. I'm theming using react-bootstrap. The Link I'm tying to create with LinkContainer from react-router-bootstrap But I can't seem to get it to work. In ...
Tim's user avatar
  • 881
1 vote
1 answer
371 views

How to query Sanity blog post with Gatsby

I have a Gatsby site set up with Sanity CMS for blogging. Current I am unable to properly target individual blog post(clicking on "First Blog" link will render content from "Second Blog&...
simonxcode's user avatar
1 vote
0 answers
654 views

Loading SVG images in Gatsby from Sanity

What is the right approach to load SVG images from a Sanity CMS in a Gatsby (v3) website? The Sanity documentation states that GIF and SVG pass through the image pipeline untouched, but if you want ...
alentejo's user avatar
  • 1,060
1 vote
1 answer
486 views

How can I filter child arrays in Gatsby GraphQL?

This gets me all events with showOnSite === true: query MyQuery { allSanityP2Event(filter: {showOnSite: {eq: true}}) { edges { node { showOnSite title relatedEvents ...
Adam Palmer's user avatar
1 vote
1 answer
1k views

Sourcing a Gatsby image from Sanity.io is rendering a low quality and small image

I am working on a Gatsby site and sourcing my content from Sanity.io. Some of the images I am getting back from the Sanity.io CDN are of a significantly reduced quality when compared to images that I ...
Matthew Nelson's user avatar
0 votes
1 answer
823 views

Gatsby not watching sanity for new published changes

I have a Gatsby site deployed to netlify. In development mode I set the option watchMode:true of gatsby-source-sanity in gatsby-config.js and this works fine to watch sanity studio for changes but in ...
Inioluwa Sogelola's user avatar
0 votes
2 answers
5k views

How do i fix "npm does not support Node.js v12.14.1" when they came from the same LTS download?

Truthfully this has never happened with me on any development environment My node version: 12.14.1 My npm version: 6.13.4 I was building a Gatsby Site using Sanity.io as a CRM and Im getting this ...
thelovesmith's user avatar
0 votes
1 answer
775 views

Gatsby.js - Export sanity.io data ( And maybe to netlify-cms in markdown files)

The goal I want to migrate (maybe convert) the pages data from the old site to the new site. The outline I'm going to do a rebrand on an existing Gatsby website for a client. The client has provided ...
Tim's user avatar
  • 881
0 votes
1 answer
1k views

Gatsby Query for specific post using slug

I'm attempting to query for a specific blog post using the slug - so that a specific post is shown depending on the slug. I have encountered the following error: TypeError: Cannot read property 'Title'...
JordanMiguel's user avatar
0 votes
1 answer
699 views

React async data fetch does not fetch data on static build

I'm building a static site using Sanity.io and Gatsby.js. The data is hosted through Sanity and I'm fetching it via GROQ. Host and build is on Netlify. The problem is that when I build I only get a ...
Tim's user avatar
  • 881
0 votes
0 answers
24 views

Probably caching issue with static Gatsby website

I have a gatsby react website hosted in azure blob storage, this static website is generated by Sanity. Users access this web site throught an azure CDN. Whenever a change is made in sanity we see ...
Sainyam Chandra's user avatar
0 votes
1 answer
33 views

Error: Unable to serialize object as a key

I am trying to deploy a Gatsby+Sanity homepage to Netlify. Both the Gatsby homepage and the Sanity CRM is runnig fine locally but I keep getting this error when I try to deploy it online. deploy log 1 ...
Nullflow's user avatar
0 votes
1 answer
154 views

Sanity environment variable

Hi I am currently trying to set a sanity environment variable in the sanity folder. According to the sanity documentation, it says to use process.env.SANITY_STUDIO_VARIABLE_NAME but looks like it ...
Kris's user avatar
  • 1
0 votes
0 answers
77 views

Static Webpages Served by Gatsby on Netlify

I'm using Gatsby for my website (worksetup.xyz) and it is deployed on Netlify. I run gatsby build to build the website. But when I access it, I can see that it loads the empty page and then makes an ...
Ashit Vora's user avatar
  • 2,942
0 votes
2 answers
529 views

How do you do CRUD in Gatsby with Sanity as my backend

I am now about knee-deep in a new Gatsby 4 project and may have hit a wall. I can't figure how to do CRUD in Gatsby with Sanity as my backend. Can I do GQL mutations in Gatsby GraphQL? I can't find ...
Tithos's user avatar
  • 1,239
0 votes
1 answer
137 views

Gatsby watchMode and overlayDrafts not working on S3 static website

I have a project with Gatsby that its 'build' is deployed to AWS S3 bucket with static website hosting. My Gatsby project is using gatsby-source-sanity plugin, that is getting data from Sanity.io ...
ROKIKOKI's user avatar
  • 601
0 votes
0 answers
318 views

Loading (StaticQuery) - Gatsby site doesn't load in Netlify production but works fine in development

This one has stumped me. I'm using Gatsby, Sanity, and Netlify and everything in development has worked as expected. Now, when I load my site on Netlify (no build errors) all I see is a white screen ...
Riley Cook's user avatar
0 votes
1 answer
257 views

Gatsby Styled Components plugin: window is not defined

I'm getting the following error inside my Gatsby with Sanity app on running npm run build: WebpackError: ReferenceError: window is not defined (from plugin: gatsby-plugi n-styled-components) Seems ...
sanderdebr's user avatar
0 votes
1 answer
2k views

Unsupported style property with React-Awesome-Slider and Gatsby

I've added React Awesomeslider into my project, which is built with Gatsby.js, Next.js and using Sanity.io as a CMS. The css is currently configured by post css. https://github.com/rcaferati/react-...
LAT89's user avatar
  • 161
0 votes
2 answers
471 views

Use (nested) prop value to reference another prop

I'm attempting to consume a nested prop value, then use that value to dynamically fetch another prop. This works for shallow (first level) props, but it fails when the prop is nested. function ...
bzmills's user avatar
  • 19
0 votes
1 answer
932 views

Can i merge/combine graphql API arrays into one?

Hey i'm using Sanity and have created both a allSanityPost (for my blog posts) and allSanityCases (for all my cases). Do anyone know how to combine these categories into one array and order them by ...
morgietalkie's user avatar
0 votes
0 answers
683 views

Internal Server Error - An internal server error occurred // SANITY // GATSBY

community - can anyone tell me, why i'm getting this error message every time i try to deploy my sanity graphQl? (See image and code snippet). u: Internal Server Error - An internal server error ...
morgietalkie's user avatar
-1 votes
1 answer
762 views

How to remove GraphQL fields according to other fields, in Gatsby?

I have a page query that returns a video playlist. Some videos have 'public' set to true, some false. For the videos that have their public field set to false, I do not want to include the URL of that ...
André Casal's user avatar
  • 1,110