lib/graphql/schema/scalar.rb in graphql-1.8.2 vs lib/graphql/schema/scalar.rb in graphql-1.8.3
- old
+ new
@@ -21,14 +21,22 @@
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
end
def kind
GraphQL::TypeKinds::SCALAR
+ end
+
+ def default_scalar(is_default = nil)
+ if !is_default.nil?
+ @default_scalar = is_default
+ end
+ @default_scalar
end
end
end
end
end