Sha256: d2033d00d30f3c53686716bf47a563267640b8d3084854931f76267c56f8f83b
Contents?: true
Size: 1.23 KB
Versions: 28
Compression:
Stored size: 1.23 KB
Contents
# frozen_string_literal: true module GraphQL module StaticValidation class ArgumentLiteralsAreCompatibleError < StaticValidation::Error attr_reader :type_name attr_reader :argument_name def initialize(message, path: nil, nodes: [], type:, argument: nil, extensions: nil, coerce_extensions: nil) super(message, path: path, nodes: nodes) @type_name = type @argument_name = argument @extensions = extensions @coerce_extensions = coerce_extensions end # A hash representation of this Message def to_h if @coerce_extensions extensions = @coerce_extensions # This is for legacy compat -- but this key is supposed to be a GraphQL type name :confounded: extensions["typeName"] = "CoercionError" else extensions = { "code" => code, "typeName" => type_name } if argument_name extensions["argumentName"] = argument_name end end extensions.merge!(@extensions) unless @extensions.nil? super.merge({ "extensions" => extensions }) end def code "argumentLiteralsIncompatible" end end end end
Version data entries
28 entries across 28 versions & 1 rubygems