Sha256: 2e262ea48f845959971353d1af56392c2255731412f6c25acaaafc4f3404adbb

Contents?: true

Size: 638 Bytes

Versions: 10

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

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

        argument :name, String, required: true

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

        def resolve(**args)
          oauth_client = Osso::Models::OauthClient.new(args)

          return response_data(oauth_client: oauth_client) if oauth_client.save

          response_error(errors: oauth_client.errors.full_messages)
        end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
osso-0.0.3.26 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.25 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.24 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.23 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.22 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.21 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.20 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.19 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.18 lib/osso/graphql/mutations/create_oauth_client.rb
osso-0.0.3.17 lib/osso/graphql/mutations/create_oauth_client.rb