Is Sanity's syntax difficult to read?

9 replies
Last updated: Oct 22, 2020
Am I the only one that thinks this is a pain to read?:
AI Update

I totally understand the frustration! Without seeing the specific code or documentation you're referring to, I can't pinpoint the exact issue, but you're definitely not alone in finding certain aspects of Sanity challenging to read at first.

Here are the most common readability pain points in the Sanity ecosystem:

GROQ Queries - This is often what people find hardest to read initially. The syntax can look dense, especially with projections, filters, and joins. If this is what you're struggling with:

  • Use the Vision plugin in Studio to test queries interactively and see results in real-time
  • Break complex queries into smaller parts with comments
  • Use defineQuery wrapper for syntax highlighting and TypeScript support

Schema Definitions - Nested field configurations can get verbose with all the options. Consider:

  • Breaking large schemas into smaller, reusable components
  • Using TypeScript for better IntelliSense
  • Leveraging schema helpers and custom field components

TypeScript Types - The generated types can be overwhelming, especially for complex schemas. The newer TypeGen system helps, but there's still a learning curve.

Configuration Files - sanity.config.ts and sanity.blueprint.ts can get cluttered quickly with plugins and options.

Documentation Structure - Sometimes finding the right info takes a few searches.

The good news is that most of these improve significantly with familiarity. The Sanity community on Slack is super helpful if you want to share what you're looking at - often someone can suggest a clearer way to structure or format it.

What specifically are you finding hard to read? If you can share a snippet or describe it, I or others can offer more targeted suggestions!

Show original thread
9 replies
No! That seems like an oversight from our part
[flipping the switch under the sidenav might make it a bit better meanwhile]
Hm. It looks like this in my browser. What browser are you in?
chrome
Maybe I've flipped a setting i dont rember
oh, now it works as you intended.
We just updated the color scheme a few minutes ago, but it seems like they are parsed as links with the browser default CSS color. But they shouldn't be links. Maybe you have an extension that auto-discover URLs and make them clickable?
Hm. It looks like this in my browser. What browser are you in?
We just updated the color scheme a few minutes ago, but it seems like they are parsed as links with the browser default CSS color. But they shouldn't be links. Maybe you have an extension that auto-discover URLs and make them clickable?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?