
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see the issue! You're getting this error because you have a nested image type inside your logoImage object, and the image type itself has fields (the alt text). This creates what GraphQL sees as an "anonymous inline" structure that's too deeply nested.
The problem is in your logoImage.js schema - you have an object type that contains an image field with additional fields. GraphQL needs flatter structures.
Here's how to fix it:
Option 1: Simplify by using the image type directly (Recommended)
Instead of wrapping the image in an object, just use the image type with its fields directly in your homepage.js:
// In homepage.js
{
name: "logoImageWhite",
type: "image",
title: "Logo White Image",
fields: [
{
name: "alt",
type: "string",
title: "Alt Tag",
options: {
isHighlighted: true,
},
},
],
},
{
name: "logoImageColor",
type: "image",
title: "Logo Color Image",
fields: [
{
name: "alt",
type: "string",
title: "Alt Tag",
options: {
isHighlighted: true,
},
},
],
}Option 2: Flatten your logoImage object
If you need the object wrapper for other reasons, flatten it by removing the nested image and putting the fields at the object level:
// logoImage.js
export default {
title: "Logo Image",
type: "object",
name: "logoImage",
fields: [
{
name: "asset",
type: "reference",
to: [{type: "sanity.imageAsset"}],
title: "Image Asset",
},
{
name: "alt",
type: "string",
title: "Alt Tag",
},
],
};The core issue is that GraphQL can't handle the nesting pattern of object → image → fields. As explained in the Sanity documentation on object types and this answer about GraphQL inline images, you need to avoid deeply nested anonymous structures when using GraphQL.
After making these changes, redeploy your GraphQL schema and the error should be resolved!
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store