-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: suspense support for usePublication hook #930
Conversation
🦋 Changeset detectedLatest commit: b1cb9e7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request has been linked to 1 task:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
44840df
to
b1cb9e7
Compare
@@ -131,7 +131,7 @@ export function useSuspenseReadResult<TResult, TVariables extends OperationVaria | |||
} | |||
|
|||
return { | |||
data: data?.result ?? never('Data should be available in suspense mode.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both profile
and publication
queries can return NULL and that's a valid response
loading: false, | ||
}; | ||
} | ||
// if (request.forId && !isValidPublicationId(request.forId)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a problem, that with wrong publicationId the API returns error, but it's not handled anywhere so it's thrown in the example app, would it make sense to do simple publicationId validation, the same as on the API side? the other thing is, it is not possible before useSuspendableQuery hook and later is too late as the API error is already thrown. any idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or that use case shouldn't really exist? I made this UI and it breaks badly when using a wrong publication Id https://lens-sdk-example-web-wagmi-q0w3lfali-avaraxyz.vercel.app/publications/usePublication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to me this is a case of wrong usage, a wrong Id (from a format perspective) to me should throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebased my branch on top of this one. I polished this aspect there. Will merge both now.
No description provided.