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

feat(form): allow Answers with empty value #791

Merged
merged 1 commit into from Nov 18, 2019

Conversation

open-dynaMIX
Copy link
Member

@open-dynaMIX open-dynaMIX commented Nov 15, 2019

This commit adds the possibility to save/query Answers with null
values.

It also adds a new lookup mode ISNULL to the HasAnswerFilter. If
this lookup mode is used, the provided value (if any) is ignored.

Since graphql-core doesn't support null literals yet, the way for setting
the value of an Answer to None is to omit the value field
altogether.

Closes #790 and #800

BREAKING CHANGE: Answers are now allowed to have null values.

@open-dynaMIX open-dynaMIX changed the title feat(form): allow Answers with empty value WIP: feat(form): allow Answers with empty value Nov 15, 2019
This commit adds the possibility to save/query Answers with `null`
values.

It also adds a new lookup mode `ISNULL` to the `HasAnswerFilter`. If
this lookup mode is used, the provided `value` (if any) is ignored.

Since graphql-core doesn't support `null` literals yet, the way for setting
the value of an Answer to `None` is to omit the `value` field
altogether.

Closes projectcaluma#790

BREAKING CHANGE: `Answers` are now allowed to have `null` values.
Copy link
Contributor

@winged winged left a comment

Choose a reason for hiding this comment

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

Awesome work!

@czosel
Copy link
Contributor

czosel commented Nov 15, 2019

Why is this a breaking change? Aren’t we just being more permissive?

@open-dynaMIX
Copy link
Member Author

Why is this a breaking change? Aren’t we just being more permissive?

I'm not 100% sure about that.

You could've relied on the backend to prevent null values in Answers. This won't work anymore.

To be safe, I'd consider all changes on the optionality of existing fields as potentially breaking.

@czosel
Copy link
Contributor

czosel commented Nov 18, 2019

In general this sounds reasonable, in this specific case I'm not so sure, since most of the code that relies on this is in ember-caluma anyway. I wonder what @kaldras and @anehx say about it?

@open-dynaMIX
Copy link
Member Author

open-dynaMIX commented Nov 18, 2019

We claim to be web framework agnostic. So I don't think ember-caluma should have anything to do with the decision if this is a breaking change.

Of course I'm aware of the fact that noone is using caluma without ember-caluma atm ;)

@winged
Copy link
Contributor

winged commented Nov 18, 2019

In general this sounds reasonable, in this specific case I'm not so sure, since most of the code that relies on this is in ember-caluma anyway. I wonder what @kaldras and @anehx say about it?

It's also (and mainly) about the type system. The value types changed from String! to String (where the missing ! denotes nullability). This by itself implies a breaking change, as you need to change the types in the mutations/queries as well.

@open-dynaMIX open-dynaMIX changed the title WIP: feat(form): allow Answers with empty value feat(form): allow Answers with empty value Nov 18, 2019
@winged winged merged commit 652bc63 into projectcaluma:master Nov 18, 2019
anehx pushed a commit to anehx/ember-caluma that referenced this pull request Nov 20, 2019
This adds compatibility for
projectcaluma/caluma#791. Instead of removing
answers with an empty value, we now save the empty value.

BREAKING CHANGE: Only works with caluma v4.0.0 (projectcaluma/caluma#791)
czosel pushed a commit to projectcaluma/ember-caluma that referenced this pull request Nov 21, 2019
This adds compatibility for
projectcaluma/caluma#791. Instead of removing
answers with an empty value, we now save the empty value.

BREAKING CHANGE: Only works with caluma v4.0.0 (projectcaluma/caluma#791)
czosel pushed a commit to projectcaluma/ember-caluma that referenced this pull request Nov 21, 2019
# [4.0.0](v3.0.1...v4.0.0) (2019-11-21)

### Bug Fixes

* **form:** transform empty string answers to null ([d3a736c](d3a736c))

### Features

* **form:** allow empty values for answers ([7e52e23](7e52e23))

### BREAKING CHANGES

* **form:** Only works with caluma v4.0.0 (projectcaluma/caluma#791)
@open-dynaMIX open-dynaMIX deleted the allow_empty_answers branch November 22, 2019 13:33
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.

Allow empty answers
3 participants