Creating a document
You can use a mutation to create a document.
Note the following considerations:
- The document can be filed in a folder at the time it is created by specifying the
fileInFolderIdentifierargument. - The
documentPropertiesargument is an input type with fields corresponding to some common system properties that can be set. - The properties field of this type allows any scalar (non-object) custom properties to be set. The type of the properties field is an array of custom GraphQL scalars. Each custom scalar is a key and value pair with the key part as a property symbolic name and the value as whatever type of value is appropriate for that property.
- The document can be checked in at the time it is created by specifying the
checkinActionargument. The options in this field default to checking in a major version but thecheckinActionargument itself must be specified to check in the document.
The following example shows the
mutation:
mutation {
createDocument(
repositoryIdentifier:"OS1"
fileInFolderIdentifier: "/Folder for Browsing"
documentProperties: {
name: "Doc with Content"
properties:[
{CustomStringProperty:"Test value"}
{CustomIntegerProperty:12345}
]
}
checkinAction: {}
)
{
id
name
}
}