Sanity image blurhash returns null in GROQ query
I can see your issue! Looking at the official Sanity documentation, the correct field name is blurHash with a capital H. However, there's a more common reason why you're getting null values.
Based on the image metadata documentation, here are the most likely causes:
1. Images uploaded before metadata was configured
This is the most common cause. If your images were uploaded before you added metadata: ['lqip', 'blurhash'] to your schema, they won't have blurhash data. Sanity only generates metadata for images uploaded after the metadata options are configured in your schema.
Solution: You'll need to re-upload the images. The metadata is generated at upload time and isn't retroactively applied to existing assets.
2. Metadata processing still in progress
Metadata is generated asynchronously after upload. If images were just uploaded, the blurhash might not be available yet. Wait a few moments and refresh your query.
3. Your GROQ query is correct
Your query uses "blurhash": asset->metadata.blurHash (with capital H), which is correct according to the documentation. The field is stored as blurHash with a capital H in the asset metadata, as shown in the image type documentation.
Quick test to diagnose:
Try uploading a brand new image after confirming your schema has metadata: ['lqip', 'blurhash'] configured. If that new image gets a blurhash value but old ones don't, you'll know you need to re-upload your existing images.
Your schema configuration looks perfect - you've correctly specified metadata: ['lqip', 'blurhash'] in the options, which tells Sanity to generate both metadata types for newly uploaded images. The issue is almost certainly that your existing images were uploaded before this configuration was in place, so they're missing the blurhash data entirely.
Show original thread3 replies
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.