Creating Folders
Intro
In this guide, we want to solve the problem of creating and syncing projects to MemoMeister. First, we cover the basics of creating a simple folder and then how to use our template functionality.
Creating a simple Folder
The following mutation shows the most basic version of how to create a folder. With the given example variables below, it will create a folder named "Test Folder" on the root level.
# The base Mutation we are using to create any folder/project
mutation CreateFolder($input: CreateFolderInputType!) {
createFolder(input: $input) {
id
name
description
labels
emoteIcon
}
}
// variables
{
"input": {
"name": "Test Folder", // this is the only field that is required. all other could be omitted
"description": "This is a test",
"labels": ["P202255"],
"emoteIcon": "🧑💻",
"parentId": ""
}
}
Name | Info |
---|---|
name | String - is required |
description | String |
labels | An array of Strings - can be any string. If the label is currently not used in the account, we will add it to the label management. |
emoteIcon | String - you can set any Emoji here, which will be prepended to the name but does not affect the sorting. |
parentId | String - if you provided none, the folder will be created on the root level. You can obtain this ID via the API with a search query or go into the web application and click on the folder you want to create. In the URL, the id is then after the /folder/ , which looks like Zm9sZGVyOjVjMzM4ODRlMWNiNmMxMjkwY2JhMWFkZA== |
While you can set the name as you want, we only allow the name once per parent folder. Similar to how a normal folder structure works. So if the creation of a folder fails, it might be a DUPLICATE_FOLDER_NAME
error.
More information about what you can send over at CreateFolderInputType
Creating Project from a template
- obtain folder templates
query FolderTemplates {
folderTemplates {
id # this is the important bit we need later
name
description
labels
}
}
- Creating the Folder itself
// variables
{
"input": {
// ... like with creating folders above, but now we add a templateId too from the first step
"templateId": "dGVtcGxhdGU6NjI3MTI1MTg0ZjljMTFhOWU3NDY1NWE5"
}
}
Now you should have a folder with subfolders inside from the template.
We did not cover all the options to keep this page as simple as possible. Especially the permissions topic and how to replace the template labels/permissions. If you want to go deeper into that topic, please read this page Folder Permissions