diff options
Diffstat (limited to 'app/graphql/mutations/pages/mark_onboarding_complete.rb')
-rw-r--r-- | app/graphql/mutations/pages/mark_onboarding_complete.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/graphql/mutations/pages/mark_onboarding_complete.rb b/app/graphql/mutations/pages/mark_onboarding_complete.rb new file mode 100644 index 00000000000..2f5ce5db54a --- /dev/null +++ b/app/graphql/mutations/pages/mark_onboarding_complete.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Mutations + module Pages + class MarkOnboardingComplete < Base + graphql_name 'PagesMarkOnboardingComplete' + + field :onboarding_complete, + Boolean, + null: false, + description: "Indicates the new onboarding_complete state of the project's Pages metadata." + + authorize :admin_project + + def resolve(project_path:) + project = authorized_find!(project_path) + + project.mark_pages_onboarding_complete + + { + onboarding_complete: project.pages_metadatum.onboarding_complete, + errors: errors_on_object(project) + } + end + end + end +end |