Class: Ibrain::Extentions::ActiveRequired

Inherits:
GraphQL::Schema::FieldExtension
  • Object
show all
Defined in:
app/graphql/ibrain/extentions/active_required.rb

Instance Method Summary collapse

Instance Method Details

#resolve(object:, arguments:, **rest) {|object, arguments, rest| ... } ⇒ Object

Yields:

  • (object, arguments, rest)

Raises:

  • (ActionController::InvalidAuthenticityToken)


6
7
8
9
10
11
# File 'app/graphql/ibrain/extentions/active_required.rb', line 6

def resolve(object:, arguments:, **rest)
  raise ActionController::InvalidAuthenticityToken, I18n.t('ibrain.errors.session.is_deactivated') unless is_activated(object)

  # yield the current time as `memo`
  yield(object, arguments, rest)
end