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 #962, Enum internal value mapping #973

Merged
merged 1 commit into from
Oct 12, 2018
Merged

Conversation

tgriesser
Copy link
Contributor

Fixes enum internal value mapping regression shown in #962, I believe this is also the issue with apollographql/apollo-server#1721, includes tests.

Basically it should be:

enumValueMap[type.name] = enumValueMap[type.name] || {};
enumValueMap[type.name][fieldName] = resolverValue[fieldName];

not

enumValueMap[type.name] = {
  [fieldName]: resolverValue[fieldName],
};

Unrelated, it'd be nice to get a .prettierrc and/or prettier setup as a precommit hook so it runs with the project's preferred settings.

TODO:

  • If this PR is a new feature, 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
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change. Include a description of your change, link to PR (always) and issue (if applicable). Add your CHANGELOG entry under vNEXT. Do not create a new version number for your change yourself.

Copy link
Contributor

@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.

Awesome - thanks @tgriesser!

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