diff options
Diffstat (limited to 'app/graphql/mutations/base_mutation.rb')
-rw-r--r-- | app/graphql/mutations/base_mutation.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/graphql/mutations/base_mutation.rb b/app/graphql/mutations/base_mutation.rb new file mode 100644 index 00000000000..eb03dfe1624 --- /dev/null +++ b/app/graphql/mutations/base_mutation.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Mutations + class BaseMutation < GraphQL::Schema::RelayClassicMutation + field :errors, [GraphQL::STRING_TYPE], + null: false, + description: "Reasons why the mutation failed." + + def current_user + context[:current_user] + end + end +end |