Class: ApolloUploadServer::Upload

Inherits:
GraphQL::Schema::Scalar
  • Object
show all
Defined in:
lib/apollo_upload_server/upload.rb

Class Method Summary collapse

Class Method Details

.coerce_input(value, _ctx) ⇒ Object

Raises:

  • (GraphQL::CoercionError)


9
10
11
12
13
# File 'lib/apollo_upload_server/upload.rb', line 9

def self.coerce_input(value, _ctx)
  return super if value.nil? || value.is_a?(::ApolloUploadServer::Wrappers::UploadedFile)

  raise GraphQL::CoercionError, "#{value.inspect} is not a valid upload"
end