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

Merging objects at the root results in a no-op #32

Open
kirkbyo opened this issue Mar 14, 2022 · 0 comments
Open

Merging objects at the root results in a no-op #32

kirkbyo opened this issue Mar 14, 2022 · 0 comments

Comments

@kirkbyo
Copy link

kirkbyo commented Mar 14, 2022

👋 I believe I have discovered a bug in this library based on GraphiQL usage of the library. If given:

import { dset } from "dset/merge"
let input = {};
dset(input, [], { hero: { id: "A" }});
console.log(input)
// output: {}
// expected: { hero: { id: "A" } }

In the case of GraphQL, this can happen if a field is deferred at the root level (example test case from the reference implementation).

Example commit with test case and a fix:
kirkbyo@ffc84ff

Happy to open that commit as a PR here if you would prefer.

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

No branches or pull requests

1 participant