Answers.Body: <p>Currently, there’s no direct way of doing this. You can pass an existing folder ID but you can’t create folders on the fly.</p>
  <p>However, you can create folders via an asset field (with dynamic path) attached to an entry type so there is an option that could work if you really need this done.</p>
  <p>Create a section/entry type that has two fields, an Asset field with a dynamic path set to <code>{folderPath}</code> and a plain text one called <code>folderPath</code>.</p>
  <p>It would then happen in three steps:</p>
  <ol>
  <li>Mutate the Asset and get its <code>ID</code> back</li>
  <li>Mutate an entry in your new entry type where you set the Asset field to your (just uploaded) asset <code>ID</code> and set <code>folderPath</code> to whatever path you need, save and get its <code>id</code> back. This would create a folder and move your asset to it.</li>
  <li>Delete the entry you’ve just created via a mutation using its <code>id</code>.</li>
  </ol>
  <p>I know it’s not straight forward but if you really need to make it work, this would do the trick.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-18T07:05:45.253Z
Answers.LastActivityDate: 2020-12-18T07:05:45.253Z
Answers.UserDisplayName: Oli
Body: <p>Is it possible to create a subfolder within an asset volume via GraphQL? If yes, can you point me in the right direction?</p>
  <p>I just found mutations for file uploading, but nothing for folder creation.</p>
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-23T16:56:12.467Z
Comments.Text: Do you want to create a subfolder on file upload or _just_ create a subfolder on a volume?
Comments.UserDisplayName: Oli
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-23T19:02:47.353Z
Comments.Text: Both ways are fine, though I would prefer to have the creation separate from uploading. And also how to read available folders. Thanks
Comments.UserDisplayName: Matthias Redl-Mann
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-16T07:54:34.830Z
Comments.Text: @Oli can you still help me with this?
Comments.UserDisplayName: Matthias Redl-Mann
Tags: <assets><graphql><subfolder>
Title: Create folder in asset volume via GraphQL
ThreadText: # Create folder in asset volume via GraphQL
  
  (Asked by: username_0 on 2020-11-23)
  
  Is it possible to create a subfolder within an asset volume via GraphQL? If yes, can you point me in the right direction?
  
  I just found mutations for file uploading, but nothing for folder creation.
  
  Thanks!
  
  **Tags:** assets, graphql, subfolder
  
  > **Comments:**
  > **username_1**: Do you want to create a subfolder on file upload or _just_ create a subfolder on a volume?  
  > **username_0**: Both ways are fine, though I would prefer to have the creation separate from uploading. And also how to read available folders. Thanks  
  > **username_0**: @username_1 can you still help me with this?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-12-18. Score: 3 | Accepted answer
  
  Currently, there’s no direct way of doing this. You can pass an existing folder ID but you can’t create folders on the fly.
  
  However, you can create folders via an asset field (with dynamic path) attached to an entry type so there is an option that could work if you really need this done.
  
  Create a section/entry type that has two fields, an Asset field with a dynamic path set to `{folderPath}` and a plain text one called `folderPath`.
  
  It would then happen in three steps:
  
  1. Mutate the Asset and get its `ID` back
  2. Mutate an entry in your new entry type where you set the Asset field to your (just uploaded) asset `ID` and set `folderPath` to whatever path you need, save and get its `id` back. This would create a folder and move your asset to it.
  3. Delete the entry you’ve just created via a mutation using its `id`.
  
  I know it’s not straight forward but if you really need to make it work, this would do the trick.
  
  
  ---
  
  