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 Cannot convert object to primitive value #3618

Merged
merged 2 commits into from
Jul 16, 2018

Conversation

benjie
Copy link
Contributor

@benjie benjie commented Jun 27, 2018

If root is created from Object.create(null) then String(root) throws Cannot convert object to primitive value which results in the confusing error Failed prop type: Cannot convert object to primitive value instead of the expected error Failed prop type: currentUser missing on {}

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • If this was a change that affects the external API used in GitHunt-React, update GitHunt-React and post a link to the PR in the discussion.

If `root` is created from `Object.create(null)` then `String(root)` throws `Cannot convert object to primitive value` which results in the confusing error `Failed prop type: Cannot convert object to primitive value` instead of the expected error `Failed prop type: currentUser missing on {}`
@apollo-cla
Copy link

apollo-cla commented Jun 27, 2018

Fails
🚫

No CHANGELOG added.

Warnings
⚠️

There are library changes, but not tests. That's OK as long as you're refactoring existing code

Generated by 🚫 dangerJS

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

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

Great point - thanks @benjie!

@hwillson hwillson merged commit e6c5a62 into apollographql:master Jul 16, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 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.

3 participants