Skip to content

Latest commit

 

History

History
66 lines (56 loc) · 2.74 KB

File metadata and controls

66 lines (56 loc) · 2.74 KB
copyright Copyright IBM Corp. 2017
link create-a-space
is published

Create a space

Spaces are where the collaboration magic happens. Let’s take a look at how a sample GraphQL mutation is used to create a space.

Starting small, the absolute minimum mutation to create a space and get the ID would be:

mutation createSpace {
  createSpace(input: { title: "Space title",  members: [""]}){
    space {
      id
    }
  }
}

Note: Only users can create spaces. Need your App to create a space? No problem! Checkout out Prepare your app to run to learn how to authorize your App to act on behalf of a user.

See it in action with our GraphQL tool and create a space.

If you need more info we’ve got you covered. Get as much additional information as you want by:

mutation createSpace {
  createSpace(input: { title: "Space title",  members: ["user1-id", "user2-id"]}){
    memberIdsChanged
    space {
      id
      title
      description
      membersUpdated
      members {
        items {
          email
          displayName
        }
      }
      conversation{
        messages{
          items {
            content
          }
        }
      }
    }
  }
}

See it in action with our GraphQL tool and create a space.