Sha256: c0d39962898b05e97e129524cf209f1aa266120336b25380a9428910851db33b

Contents?: true

Size: 658 Bytes

Versions: 19

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true

module Osso
  module GraphQL
    module Mutations
      class RegenerateOauthCredentials < BaseMutation
        null false

        argument :id, ID, required: true

        field :oauth_client, Types::OauthClient, null: false
        field :errors, [String], null: false

        def resolve(id:)
          oauth_client = Osso::Models::OauthClient.find(id)
          oauth_client.regenerate_secrets!

          return response_data(oauth_client: oauth_client) if oauth_client.save

          response_error(oauth_client.errors)
        end

        def ready?(*)
          admin_ready?
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
osso-0.0.10 lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.8 lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.7 lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.6 lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.6.alpha lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5 lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.lambda lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.kappa lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.iota lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.theta lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.eta lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.zeta lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.epsilon lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.delta lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.gamma lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.beta lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.5.pre.alpha lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.4 lib/osso/graphql/mutations/regenerate_oauth_credentials.rb
osso-0.0.3.27 lib/osso/graphql/mutations/regenerate_oauth_credentials.rb