-
-
Notifications
You must be signed in to change notification settings - Fork 459
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
(next-urql) Expose initUrqlClient function for manual usage in Next’s getServerSideProps methods #993
Conversation
🦋 Changeset is good to goLatest commit: 582c83f We got this. This PR includes changesets to release 1 package
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 |
ed0a166
to
65a4fa9
Compare
I'd love to get this merged, however can you remove the example from this PR for now please? A small addition like this is probably better for our documentation which I can take care of once this is merged and it's a lot of added example code to maintain for us (and also mostly duplicate) for a small additional API. On another note, can you please add a changeset? There's a guide on how to do this here, but I'm also happy to help if you run into any trouble 🙌 https://github.com/FormidableLabs/urql/blob/main/CONTRIBUTING.md#how-do-i-document-a-change-for-the-changelog |
@kitten I've added changeset and missing docs. As well as I removed the example from PR. |
f9f2276
to
5220e68
Compare
0fc2c9f
to
addec3e
Compare
…ly for use in Next's newer SSR methods manually, such as getServerSideProps
addec3e
to
fbea6b0
Compare
initUrqlClient
function so that a Client
can be created manually for use in Next's newer SSR methods manually, such as getServerSideProps
@kitten and @parkerziegler thanks for all your comments. I've updated PR with the latest requirements (fixing the changeset and renaming the commit and PR titles) |
Co-authored-by: Phil Pluckthun <[email protected]>
Co-authored-by: Phil Pluckthun <[email protected]>
Co-authored-by: Phil Pluckthun <[email protected]>
Last few grammatical and typo fixes, then we're good to go. Thanks @sunpietro! |
Co-authored-by: Parker Ziegler <[email protected]>
Co-authored-by: Parker Ziegler <[email protected]>
Co-authored-by: Parker Ziegler <[email protected]>
Co-authored-by: Parker Ziegler <[email protected]>
@parkerziegler thank you for your kind review. All your suggestions have been just applied :) |
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.
Sorry for that bit of back and forth! Let's get this in 🙌
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.
🎉 @kitten you wanna do the honors?
initUrqlClient
function so that a Client
can be created manually for use in Next's newer SSR methods manually, such as getServerSideProps
Thank you :) |
Summary
Expose
initUrqlClient
function in order to allow fetching data in SSR mode. Without it data can be fetched only in client-side rendered apps and in static pages.Set of changes
initUrqlClient
function in thepackages/next-urql/src/index.ts
file.1-with-urql-client
demo)Notes: The GraphQL server doesn't work, I had to use different ones in order to test the functionality. I kept the old Pokemon endpoints for consistency.