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

changeValue function in mutators #6

Open
alex-shatalov opened this issue Jan 22, 2018 · 3 comments
Open

changeValue function in mutators #6

alex-shatalov opened this issue Jan 22, 2018 · 3 comments

Comments

@alex-shatalov
Copy link

bug report or a feature

Hi, find that function changeValue, checks state.fields[name]. In my case form has routes and some mutation logic take place in component that does not have any or component. So mutators don't work.

@erikras
Copy link
Member

erikras commented Jan 22, 2018

It, by design, does not allow setting values for fields that are not registered. You have fields that are not registered for which you would like to modify the value?

@alex-shatalov
Copy link
Author

We have something like wizard form. Pages of form renders by it own routes. And final save page has it own route. So when submitting, we need to do some logic, and yes fields are not registered in moment when save page is active.

@rosskevin
Copy link
Contributor

We have the same use case and ran into it with File uploads. The graphql/model representation of an uploaded file vs an HTML File object are different, so we had to manipulate the underlying values model. We ended up adding Field components that have no visibility so we could subscribe, and mutate.

I'm about to hit another:
We have arrays of Affiliations and Addresses, each has a transient field deleted which is never visible, but allows a user to add/delete at-will then submit at the end of their work (contact form). The backend processes the additions/deletions based on this transient field, but we would never want to show it.

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

3 participants