copyright | link | is |
---|---|---|
Copyright IBM Corp. 2017 |
create-a-space |
published |
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. Try it now
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. Try it now