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.4.8 lib/graphql/schema/directive/one_of.rb
graphql-2.4.7 lib/graphql/schema/directive/one_of.rb
graphql-2.4.6 lib/graphql/schema/directive/one_of.rb
graphql-2.4.5 lib/graphql/schema/directive/one_of.rb
graphql-2.4.4 lib/graphql/schema/directive/one_of.rb
graphql-2.4.3 lib/graphql/schema/directive/one_of.rb
graphql-2.4.2 lib/graphql/schema/directive/one_of.rb
graphql-2.4.1 lib/graphql/schema/directive/one_of.rb
graphql-2.4.0 lib/graphql/schema/directive/one_of.rb
graphql-2.3.20 lib/graphql/schema/directive/one_of.rb
graphql-2.3.19 lib/graphql/schema/directive/one_of.rb
graphql-2.3.18 lib/graphql/schema/directive/one_of.rb
graphql-2.3.17 lib/graphql/schema/directive/one_of.rb
graphql-2.3.16 lib/graphql/schema/directive/one_of.rb
graphql-2.3.15 lib/graphql/schema/directive/one_of.rb
graphql-2.3.14 lib/graphql/schema/directive/one_of.rb
graphql-2.3.13 lib/graphql/schema/directive/one_of.rb
graphql-2.3.12 lib/graphql/schema/directive/one_of.rb
graphql-2.3.11 lib/graphql/schema/directive/one_of.rb
graphql-2.3.10 lib/graphql/schema/directive/one_of.rb