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

return terms parameter type mismatch #137

Closed
CarsonF opened this issue Jan 17, 2020 · 1 comment · Fixed by #166
Closed

return terms parameter type mismatch #137

CarsonF opened this issue Jan 17, 2020 · 1 comment · Fixed by #166
Labels

Comments

@CarsonF
Copy link

CarsonF commented Jan 17, 2020

In the .return docs you say this is valid:

query.return({
  people: {
    name: 'personName',
    age: 'personAge',
  },
})

But Term doesn't allow a Dictionary of Dictionary's. people has to be an array of objects.
https://github.com/jamesfer/cypher-query-builder/blob/master/src/clauses/term-list-clause.ts#L14

jamesfer added a commit that referenced this issue Dec 12, 2020
The documentation described the behaviour of `with` and `return` when given a nested set of
dictionaries:
```javascript
query.with({
  people: {
    name: 'personName',
    age: 'personAge',
  },
});
// WITH people.name AS personName, people.age AS personAge
```

However the types forbade this. If using Javascript, no error was returned, however the
result was very different to the documentation. It now behaves as documentated.

If you are using Typescript this is not a breaking change as the types would have
prevented you from using the faulty behaviour.

If you as using Javascript then there is a chance that this will change the behaviour
of your code but it is unlikely and the other behaviour is a bug.

fixes #137
jamesfer added a commit that referenced this issue Dec 12, 2020
The documentation described the behaviour of `with` and `return` when given a nested set of
dictionaries:
```javascript
query.with({
  people: {
    name: 'personName',
    age: 'personAge',
  },
});
// WITH people.name AS personName, people.age AS personAge
```

However the types forbade this. If using Javascript, no error was returned, however the
result was very different to the documentation. It now behaves as documentated.

If you are using Typescript this is not a breaking change as the types would have
prevented you from using the faulty behaviour.

If you as using Javascript then there is a chance that this will change the behaviour
of your code but it is unlikely and the other behaviour is a bug.

fixes #137
jamesfer pushed a commit that referenced this issue Dec 12, 2020
## [6.0.2](v6.0.1...v6.0.2) (2020-12-12)

### Bug Fixes

* **termlist:** fix handling of nested dictionaries ([93a5cd4](93a5cd4)), closes [#137](#137)

[skip ci]
@jamesfer
Copy link
Owner

🎉 This issue has been resolved in version 6.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants