below code is for mutation
field :companyUpdate, Types::CompanyType do
argument :id, !types.ID
argument :file, Types::FileType
resolve -> (obj, args, ctx) {
company = ::Network::Company.find(args[:id])
company.update!(logo: args[:file])
company
}
end
and file_type.rb is
Types::FileType = GraphQL::ScalarType.define do
name 'File'
description 'action_dispatch_uploaded_file'
coerce_input ->(action_dispatch_uploaded_file, ctx) {
action_dispatch_uploaded_file
}
end
it is not working. apollo client is using apollo-upload-client for uploading the file but it gives error as file is null. what's the solution?