radar/twist-v2

View on GitHub
backend/lib/twist/web/graphql/mutations/invitations/invite_permission_result.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'twist_web/graphql/objects/permission_denied'

module Twist
  module Web
    module GraphQL
      module Mutations
        module Invitations
          class InvitePermissionResult < BaseUnion
            description "The result from attempting an invite"
            possible_types Types::Invitation, Types::PermissionDenied

            def self.resolve_type(object, _context)
              if object.success?
                Types::Invitation
              else
                Types::PermissionDenied
              end
            end
          end
        end
      end
    end
  end
end