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

Team Mutations #800

Merged
merged 23 commits into from
Jul 17, 2018
Merged

Team Mutations #800

merged 23 commits into from
Jul 17, 2018

Conversation

kevinhughes27
Copy link
Owner

@kevinhughes27 kevinhughes27 commented Jul 12, 2018

part of #750

This PR adds the first mutation and hopes to establish some good patterns around Forms and Mutations for Admin Next.

Relay mutations are cool and I like the optimistic update feature that is built in. I played around with the cache to figure out how it works and I learned that mutations always pass the force option which clears the whole cache after any mutation in my current setup. This is simple and easy for now. Eventually I might add https://github.com/relay-tools/react-relay-network-modern to do some more advanced things.

I got a fragmentContainer working for the division select. This pattern is more interesting that I most recently thought (#785) because even though you have to wire it all together manually Relay seems to add some nice checks to make sure you did it right. If your fragment container isn't passed what it asked for it throws an error.

In the diff right now you can see that I had to make the mutation public to test this locally. It would work on production because of how Rails serves the app it can set the session but locally there is no way for rails to set the session. To fix this I will have to add JWT auth to the app. This is unexpected but its how most people are doing things for their frontends these days. Long term jwt will be needed for my multi client and static pages on custom domains vision. It may also let us remove devise or some devise magic eventually.

Next

  • update + confirm pattern
  • form to create a new Team, how will this affect code / component re-use?

Future

  • Now that I sort of understand fragmentContainers I should revisit using them for Show Pages

@kevinhughes27 kevinhughes27 merged commit 091d126 into master Jul 17, 2018
@kevinhughes27 kevinhughes27 deleted the team-mutations branch July 17, 2018 09:41
This was referenced Jul 17, 2018
This pull request was closed.
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.

1 participant