Skip to content

Upload of two and more scalars #67

@dgorobets

Description

@dgorobets

Hi! Thanks for repository.

I'm having a problem with uploading of two scalars.

My input with two scalars for mutation is:

input createTrainingInput {
  name: String!
  level: TrainingLevel!
  introduction: String!
  workoutDuration: String!
  description: String!
  goals: [String]!
  requirements: [String]!
  overallDuration: Int!
  intensity: Int!
  price: Int!
  promotionalVideo: Upload!
  coverPhoto: Upload!
}

When I upload small plain text files, everything is ok.

But when I'm trying to upload video one of the promises is in 'pending' state for a long time, until FileStreamDisconnectUploadError is thrown.

Resolvers code:

const { coverPhoto, promotionalVideo, ...properties } = input;

const [
    { stream: coverPhotoStream, filename: coverPhotoFilename },
    { stream: promotionalVideoStream, filename: promotionalVideoFilename },
] = await Promise.all([
    coverPhoto,
    promotionalVideo
]);

Version of apollo-upload-server is 5.0.0.

Please, advice what can be done in this situation.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions