Sha256: d2cdb748c7592d549e5c19fa8d9d807a09a0d6e151e24956ca625712281e2128

Contents?: true

Size: 557 Bytes

Versions: 54

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  class Schema
    class Directive < GraphQL::Schema::Member
      class OneOf < GraphQL::Schema::Directive
        description "Requires that exactly one field must be supplied and that field must not be `null`."
        locations(GraphQL::Schema::Directive::INPUT_OBJECT)
        default_directive true

        def initialize(...)
          super

          owner.extend(IsOneOf)
        end

        module IsOneOf
          def one_of?
            true
          end
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
graphql-2.1.11 lib/graphql/schema/directive/one_of.rb
graphql-2.2.5 lib/graphql/schema/directive/one_of.rb
graphql-2.2.4 lib/graphql/schema/directive/one_of.rb
graphql-2.2.3 lib/graphql/schema/directive/one_of.rb
graphql-2.1.10 lib/graphql/schema/directive/one_of.rb
graphql-2.2.2 lib/graphql/schema/directive/one_of.rb
graphql-2.1.9 lib/graphql/schema/directive/one_of.rb
graphql-2.2.1 lib/graphql/schema/directive/one_of.rb
graphql-2.2.0 lib/graphql/schema/directive/one_of.rb
graphql-2.1.8 lib/graphql/schema/directive/one_of.rb
graphql-2.1.7 lib/graphql/schema/directive/one_of.rb
graphql-2.1.6 lib/graphql/schema/directive/one_of.rb
graphql-2.1.5 lib/graphql/schema/directive/one_of.rb
graphql-2.1.4 lib/graphql/schema/directive/one_of.rb