dre1080/wp-graphql-upload

How does multiple upload work?

Closed this issue · 2 comments

Hello,

Thank you very much for your plugin. Saved lives in file uploads.

But I have a problem, I cannot upload multiple files.

First, I made my species definition. There is no problem in single installation, but the field named "attachments" must be multiple.

I am sharing the screenshots below, I would be very happy if you could help.

CleanShot 2022-08-17 at 14 49 56@2x

CleanShot 2022-08-17 at 14 50 47@2x

Thank you.

Hi! Thanks for the kind words!

Try this:

$input_fields['attachments'] = [
  'type' => ['list_of' => ['non_null' => 'Upload']], // or ['list_of' =>'Upload']
  'description' => __('Comment attachments', 'dr'),
];

Thank you. It's done.