Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update RawQueryResponse response type properties #232

Merged

Conversation

dankreiger
Copy link
Contributor

Hello everyone 👋

I've noticed a type definition issue while utilizing the fetch method on @sanity/client. The response returned from the API seems to have a slight discrepancy from what's defined in the RawQueryResponse type.

On the RawQueryResponse:

  • Rather than receiving q, I'm receiving query.
  • The resultSourceMap is optional and doesn't appear as a property unless it's part of the input parameters.

CleanShot 2023-05-23 at 11 31 53

The URL structure produced by the fetch method adheres to the standard format from the Sanity API:

https://[projectId].api.sanity.io/[apiVersion]/data/query/[dataset]?query=[groqString]

I've also attempted to test this with varying API versions, and both with and without the CDN.


Could I possibly be doing something incorrectly or using the wrong type? If that's the case, feel free to close this discussion.

Thank you very much for maintaining this package!

Copy link
Member

@stipsan stipsan left a comment

Choose a reason for hiding this comment

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

Thanks, great find! 🙌

@stipsan stipsan changed the title chore: update RawQueryResponse response type properties fix: update RawQueryResponse response type properties May 23, 2023
@stipsan stipsan merged commit 5eb0272 into sanity-io:main May 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants