Skip to content

Conversation

@rcmoret
Copy link
Contributor

@rcmoret rcmoret commented Mar 22, 2025

In a rails console if I do this:

groq = "*[ _id in $uuids] { _id }"
variables = {uuids: ["15af9fc6-bbaf-4368-ab4d-62206a35f5f5", "2703512d-c1c7-49e4-9d20-c70e85cf2ec3", "46071c04-756b-4ad3-9a8e-2cad0652a24d", "7a02ec75-ba7c-4a44-927c-1a56459cda7e", "c2f69b8b-7f24-45d5-be2c-eb48c2b12901", "fe842bc1-d532-498c-be2f-466ce924b67e"]}
# then 
Sanity::Document.where(groq: groq, variables: variables)
# => 
{"error"=>
  {"description"=>
    "Unable to parse value of \"$uuids=\"[\"15af9fc6-bbaf-4368-ab4d-62206a35f5f5\", \"2703512d-c1c7-49e4-9d20-c70e85cf2ec3\", \"46071c04-756b-4ad3-9a8e-2cad0652a24d\", \"7a02ec75-ba7c-4a44-927c-1a56459cda7e\", \"c2f
69b8b-7f24-45d5-be2c-eb48c2b12901\", \"fe842bc1-d532-498c-be2f-466ce924b67e\"]\"\". Please quote string values.",
   "type"=>"httpBadRequest"}}

This fixes that issue

@dvmonroe
Copy link
Owner

ty @rcmoret

Copy link
Owner

@dvmonroe dvmonroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding tests in #42

@dvmonroe dvmonroe merged commit 5521870 into dvmonroe:main Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants