Skip to content

Latest commit

 

History

History
100 lines (79 loc) · 2.6 KB

V1_space_template_info.md

File metadata and controls

100 lines (79 loc) · 2.6 KB
copyright link is
Copyright IBM Corp. 2018
space-template-info
beta

Space Template Info

A number of additional properties of a Space object are exposed when you add BETA to the x-graphql-view header.

type Space {
...
  templateInfo: SpaceTemplateInfo
  statusValueId: String
  propertyValueIds: [SavedPropertyIds]
}

You can add templateInfo to your space request in order to fetch information about the template associated with the space.

The SpaceTemplateInfo object comprises a subset of the fields in the SpaceTemplate type.

type SpaceTemplateInfo {
  id: ID!
  name: String!
  description: String!
  spaceStatus: SpaceStatus!
  requiredApps: SpaceRequiredApplicationCollection
  properties: SpacePropertyCollection
  labelIds: [String]
  created: Date
  createdBy: Person
  updated: Date
  updatedBy: Person
}

The information returned by templateInfo can be used to interpret statusValueId and propertyValueIds.

statusValueId represents the current status value assigned to the space in the form of an ID. The displayName associated with that ID can be obtained by looking at the acceptableValues for the spaceStatus as listed under templateInfo.

type SpaceStatus {
...
  acceptableValues: [SpaceStatusAcceptableValue]
}

type SpaceStatusAcceptableValue {
...
  id: ID!
  displayName: String!
}

propertyValueIds lists the IDs of the properties of the space and the values currently assigned to each.

type SavedPropertyIds {
  propertyId: String
  propertyValueId: String
}

The displayName associated with each property ID can be obtained by looking at the collection of properties listed under templateInfo.

type SpacePropertyCollection {
  items: [SpaceProperty]!
}

interface SpaceProperty {
...
  id: ID!
  displayName: String!
}

In the case of text and boolean properties, the propertyValueId displayed will be a straightforwardly readable value. In the case of list properties, the value will be an ID; the display name associated with the ID can be obtained by looking at the acceptableValues for the property under templateInfo.

type SpaceListProperty implements SpaceProperty {
...
  acceptableValues: [SpaceListPropertyAcceptableValue]!
}

type SpaceListPropertyAcceptableValue {
...
  id: ID!
  displayName: String!
}

Try adding these fields to a space query in our GraphQL Explorer - copy above and click below to construct one.