Sha256: 2d3d94796e0672df2c9ef448d862c57144febc4d293e8f276d0e0cf6079e599a

Contents?: true

Size: 815 Bytes

Versions: 24

Compression:

Stored size: 815 Bytes

Contents

# frozen_string_literal: true

module GraphQL
  class Schema
    class Member
      module ValidatesInput
        def valid_input?(val, ctx)
          validate_input(val, ctx).valid?
        end

        def validate_input(val, ctx, max_errors: nil)
          if val.nil?
            Query::InputValidationResult::VALID
          else
            validate_non_null_input(val, ctx, max_errors: max_errors) || Query::InputValidationResult::VALID
          end
        end

        def valid_isolated_input?(v)
          valid_input?(v, GraphQL::Query::NullContext)
        end

        def coerce_isolated_input(v)
          coerce_input(v, GraphQL::Query::NullContext)
        end

        def coerce_isolated_result(v)
          coerce_result(v, GraphQL::Query::NullContext)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
graphql-2.0.31 lib/graphql/schema/member/validates_input.rb
graphql-2.0.29 lib/graphql/schema/member/validates_input.rb
graphql-2.0.28 lib/graphql/schema/member/validates_input.rb
graphql-2.1.3 lib/graphql/schema/member/validates_input.rb
graphql-2.1.2 lib/graphql/schema/member/validates_input.rb
graphql-2.1.1 lib/graphql/schema/member/validates_input.rb
graphql-2.1.0 lib/graphql/schema/member/validates_input.rb
graphql-2.0.27 lib/graphql/schema/member/validates_input.rb
graphql-2.0.26 lib/graphql/schema/member/validates_input.rb
graphql-2.0.25 lib/graphql/schema/member/validates_input.rb
graphql-2.0.24 lib/graphql/schema/member/validates_input.rb
graphql-2.0.23 lib/graphql/schema/member/validates_input.rb
graphql-2.0.22 lib/graphql/schema/member/validates_input.rb
graphql-2.0.21 lib/graphql/schema/member/validates_input.rb
graphql-2.0.20 lib/graphql/schema/member/validates_input.rb
graphql-2.0.17.2 lib/graphql/schema/member/validates_input.rb
graphql-2.0.17.1 lib/graphql/schema/member/validates_input.rb
graphql-2.0.19 lib/graphql/schema/member/validates_input.rb
graphql-2.0.18 lib/graphql/schema/member/validates_input.rb
graphql-2.0.17 lib/graphql/schema/member/validates_input.rb