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: check window is defined before using it #962

Merged
merged 3 commits into from
Sep 24, 2019

Conversation

assimelha
Copy link
Contributor

Hi !

I was trying to use GraphiQL with Gatsby but I got window is not defined issue.

@codecov
Copy link

codecov bot commented Sep 24, 2019

Codecov Report

Merging #962 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #962   +/-   ##
=======================================
  Coverage   33.78%   33.78%           
=======================================
  Files          79       79           
  Lines        3481     3481           
  Branches      753      752    -1     
=======================================
  Hits         1176     1176           
  Misses       1814     1814           
  Partials      491      491
Impacted Files Coverage Δ
packages/graphiql/src/utility/StorageAPI.js 31.25% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7762c3d...e00d833. Read the comment docs.

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

Minor tweak required.

Have you tested that this now works with SSR?

packages/graphiql/src/utility/StorageAPI.js Outdated Show resolved Hide resolved
Co-Authored-By: Benjie Gillam <benjie@jemjie.com>
@assimelha
Copy link
Contributor Author

@benjie Yes now working. I exported the package with the fix and used it here https://www.assim.me/resume

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

Looks good to me; thanks! 🙏

@benjie benjie changed the title fix(ssr): enable building on the server fix: check window is defined before using it Sep 24, 2019
@benjie benjie merged commit e4866ad into graphql:master Sep 24, 2019
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.

2 participants