Skip to content

Is it possible to create array of images using GraphQL API? #248

Answered by jmikrut
fabcodingzest asked this question in Q&A
Discussion options

You must be logged in to vote

@fabcodingzest you are awesome! You are doing some serious learning and skill development. I'm blown away.

Sooo, the long and short of file uploading in GraphQL is that it's hard, and fairly nonsensical to do given the nature of GraphQL.

For that reason, Payload does not support uploading files through GraphQL at this time.

So, being that file uploads are actually just documents in a collection, to upload multiple files you'd need to do something like the following:

  1. For each file you need to upload, make a REST call to your collection's create endpoint, uploading files and creating documents accordingly
  2. Store the IDs that come back from each one of the successfully created documents in y…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jmikrut
Comment options

@fabcodingzest
Comment options

Answer selected by zubricks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants