Retrieve Spaces
Retrieve Information about a Space
space
query is used to retrieve information about a space.
It takes id
, path
or slug
as an input.
- GraphQL
- JS Client
{
space(id: "ChLtv0osEWyi") {
id
type
slug
name
}
}
client.query({
name: 'space',
args: {
variables: {
id: 'ChLtv0osEWyi',
},
fields: 'basic',
},
})
List of Spaces
spaces
query is used to get a list of spaces.
It returns a paginated list of spaces. It takes pagination parameters as inputs.
You can also filter the list using query
, collectionId
, or memberId
input.
- GraphQL
- JS Client
{
spaces(limit: 10, query: "bettermode") {
nodes {
id
type
slug
name
}
}
}
client.query({
name: 'spaces',
args: {
variables: {
limit: 10,
query: 'bettermode',
},
fields: 'basic',
},
})
Get Spaces of a Member
memberSpaces
query is used to get a list of spaces for a member and their roles.
It returns a paginated list of spaceMembers which contains member, role, and space.
It takes pagination parameters as inputs. You can also filter the list using collectionId
input.
- GraphQL
- JS Client
{
memberSpaces(limit: 10, memberId: "mRyzC8CiUe") {
nodes {
space {
id
name
}
}
}
}
client.query({
name: 'spaces',
args: {
variables: {
limit: 10,
memberId: 'mRyzC8CiUe',
},
fields: 'basic',
},
})