Skip to content

Missing ssrMode setting in ssr Quick Example / Fix Typescript type #329

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

Merged
merged 5 commits into from
Nov 25, 2019

Conversation

helloguille
Copy link
Contributor

Without ssrMode enabled the system will not dispatch the right Promise on cache-miss.

What does this PR do?

Updates documentation for ssr.

Checklist

  • [Y] I have checked the contributing document
  • [Y] I have added or updated any relevant documentation
  • [N] I have added or updated any relevant tests

Without ssrMode enabled the system will not dispatch the right Promise on cache-miss.
@helloguille
Copy link
Contributor Author

Added a new Typescript type fix.

@helloguille helloguille reopened this Jul 10, 2019
@helloguille helloguille changed the title Missing ssrMode setting in ssr Quick Example Missing ssrMode setting in ssr Quick Example / Fix Typescript type Jul 11, 2019
Copy link
Contributor

@bmullan91 bmullan91 left a comment

Choose a reason for hiding this comment

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

One small change otherwise LGTM

@@ -27,7 +27,8 @@ app.get('/', async (req, reply) => {
const client = new GraphQLClient({
url: 'https://domain.com/graphql',
cache: memCache() // NOTE: a cache is required for SSR,
fetch
fetch,
ssrMode: true
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't required when using graphql-hooks-ssr, see https://github.com/nearform/graphql-hooks/blob/master/packages/graphql-hooks-ssr/index.js#L13. Perhaps a comment here to say that graphql-hooks-ssr set the flag will make it clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, will fix pull request

@@ -29,7 +29,7 @@ export class GraphQLClient {
options: UseClientRequestOptions
): CacheKeyObject
getFetchOptions(operation: Operation, fetchOptionsOverrides?: object): object
request(operation: Operation, options: object): Promise<Result>
request(operation: Operation, options?: object): Promise<Result>
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@helloguille
Copy link
Contributor Author

Sorry, first time margin a pull request into an open source project.

Is it better I add a commit reversing the ssrMode change or should I start a new pull request with a clean commit history?

@jackdclark
Copy link
Contributor

@helloguille another commit is fine, we always squash the commits when merging to master anyway!

@helloguille
Copy link
Contributor Author

Hi:
Fixed to comply with changes requested.

@bmullan91 bmullan91 merged commit 5de13b1 into nearform:master Nov 25, 2019
@bmullan91
Copy link
Contributor

@all-contributors please add @helloguille for code

@allcontributors
Copy link
Contributor

@bmullan91

I've put up a pull request to add @helloguille! 🎉

@helloguille
Copy link
Contributor Author

@bmullan91 Thanks for merging! I also authored: #406

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.

3 participants