lib/graphql/schema/scalar.rb in graphql-1.13.23 vs lib/graphql/schema/scalar.rb in graphql-2.0.0
- old
+ new
@@ -1,10 +1,9 @@
# frozen_string_literal: true
module GraphQL
class Schema
class Scalar < GraphQL::Schema::Member
- extend GraphQL::Schema::Member::AcceptsDefinition
extend GraphQL::Schema::Member::ValidatesInput
class << self
def coerce_input(val, ctx)
val
@@ -12,24 +11,10 @@
def coerce_result(val, ctx)
val
end
- prepend Schema::Member::CachedGraphQLDefinition::DeprecatedToGraphQL
-
- def to_graphql
- type_defn = GraphQL::ScalarType.new
- type_defn.name = graphql_name
- type_defn.description = description
- type_defn.coerce_result = method(:coerce_result)
- type_defn.coerce_input = method(:coerce_input)
- type_defn.metadata[:type_class] = self
- type_defn.default_scalar = default_scalar
- type_defn.ast_node = ast_node
- type_defn
- end
-
def kind
GraphQL::TypeKinds::SCALAR
end
def specified_by_url(new_url = nil)
@@ -53,10 +38,10 @@
def default_scalar?
@default_scalar ||= false
end
- def validate_non_null_input(value, ctx, max_errors: nil)
+ def validate_non_null_input(value, ctx)
result = Query::InputValidationResult.new
coerced_result = begin
ctx.query.with_error_handling do
coerce_input(value, ctx)
end