Skip to content

Instantly share code, notes, and snippets.

@hdoan741
Created November 23, 2020 19:41
Show Gist options
  • Select an option

  • Save hdoan741/68e4439407e005935235974dc179a2aa to your computer and use it in GitHub Desktop.

Select an option

Save hdoan741/68e4439407e005935235974dc179a2aa to your computer and use it in GitHub Desktop.
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