Created
November 23, 2020 19:38
-
-
Save hdoan741/bf51e5283b31dcb20f24f7b8a57913b5 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 < Mutation | |
| def required_arguments | |
| [ | |
| model_or_id(:site, Site), | |
| model_or_id(:teacher, Teacher), | |
| ] | |
| end | |
| def policy | |
| # list the privacy policy required for this | |
| end | |
| def commit | |
| # use passed in args to perform the update | |
| end | |
| end | |
| # this call checks privacy policy, validates the args, and then calls commit | |
| AddTeacherToSite.execute!(viewer, site: …, teacher: …) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment