Created
November 23, 2020 19:41
-
-
Save hdoan741/68e4439407e005935235974dc179a2aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AddTeacherToSite < TypedMutation | |
| class Args < T::Struct | |
| const :site, Site | |
| const :teacher, Teacher | |
| end | |
| def policy | |
| # pass the privacy policy required | |
| end | |
| def commit | |
| # use passed in args to perform the update | |
| end | |
| end | |
| # no longer need to to validate args | |
| AddTeacherToSite.new( | |
| viewer, | |
| AddTeacherToSite::Args.new(site:…, teacher:…) | |
| ).execute! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment