Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 2.34 KB

V1_create_space_from_template.md

File metadata and controls

51 lines (38 loc) · 2.34 KB
copyright link is
Copyright IBM Corp. 2018
create-space-from-template
beta

Create a Space from a Template

When you add BETA to the x-graphql-view header, a number of additional properties are exposed in the CreateSpaceInput object.

input CreateSpaceInput {
...
  templateId: String
  propertyValues: [SpacePropertyValueInput]
}

If you set as templateId the id of a template to which you have access, the space created will inherit the properties and apps configured as part of that template.

Values for the custom properties may be assigned using the propertyValues field, which takes a list of SpacePropertyValueInput objects.

input SpacePropertyValueInput {
  propertyId: String!
  propertyValueId: String!
}

The propertyId of the object identifies the property whose value is to be set and the propertyValueId identifies the value to be assigned.

  • In the case of a text property the propertyValueId should simply be the string value you want to assign to the property.
  • In the case of a boolean property the propertyValueId should be one of the the upper-case strings "TRUE" or "FALSE".
  • In the case of a list property the propertyValueId should be the id of one of the acceptable values specified for the property.

Space properties may similarly be updated by adding a propertyValues field as above to the input object passed to the updateSpace mutation. Only those properties which you actually want to update need be included in this case. Properties for which no new values are specified will retain the values previously assigned.

When a space is created from a template it will automatically be assigned the initial status value defined for all spaces created from that template. The status of the space may subsequently be updated by adding a statusValue field to the input object passed to the updateSpace mutation. This field takes a SpaceStatusValueInput object with a single statusValueId property.

input SpaceStatusValueInput {
  statusValueId: String!
}

The statusValueId should be the id of one of the acceptable status values defined in the template.

Try creating and updating a space from a template in our GraphQL Explorer