Closed jesperbjerke closed 1 day ago
Name | Link |
---|---|
Latest commit | ab51f84188873d66c03cabb6267ca459351500e9 |
Latest deploy log | https://app.netlify.com/sites/nuxt-sanity-module/deploys/66953028712f97000860538b |
Should we just move the query up into fetchOptions?
Hah, good point! Completely missed that 😅 Changed now
Noticed the RequestInit type doesn't allow for query
. And changing it to FetchOptions conflicts with the POST method 🙃
I'll see if I find the correct type to use..
Actually ... Maybe we need to add it to the
qs
as&perspective=
rather than viaquery
for theget
request... Seems like it would produce a double query otherwise.
When I tested it just appended perspective to the existing query params and worked as expected. But I can double check again. What do you mean with "double query" though? 🤔
Just tested again, both with and without defining perspective in my config. Looks to me as it behaves as expected and just appends the perspective to the existing query params. Perspective defaults to "raw" if not defined.
This is the query params it produces for me:
data/query/staging?query=*%5B_type+==+%22article%22+%26%26+language+==+$language+%26%26+slug.current+==+$slug%5D%5B0%5D%7Btitle,+animal_type,+intro,+seo,+body,+image%7D&$language=%22en%22&$slug=%22invaertes-parasiter-hos-kanin-test%22&perspective=previewDrafts
This is the same issue as here: https://github.com/nuxt-modules/sanity/pull/930 but with GET queries. This appends perspective there as well.