Workspace background

I would like to create an empty workspace using GraphQL API.
Previously we used copyFrom to clone a template workspace.
As our application becomes more complex, we have to dynamically initialize workspaces and I need to start from an empty workspace.

When I create a new workspace, I see a workspace with dark background regardless of “Display mode” in my profile

How can I create a workspace with light background? Do I have to use copyFrom to do this?

Hi @Amerehei,

Sorry for the delay. When creating a new workspace, the background should use the default user Display Mode that is set in their user profile. If you copy a workspace, the copied workspace will inherit the background theme from the copied workspace.

You can also manually change a workspace background color using the updateWorkspaceStyle mutation API to change the workspace backgroundTheme.

For Example:

mutation updateMyWorkspaceStyle($workspaceId:String!, $backgroundTheme:BackgroundTheme){
    updateWorkspaceStyle(workspaceId:$workspaceId, input:{
        backgroundTheme:$backgroundTheme
    })
    { workspaceId}
}

variables:

{
    "workspaceId":"{{workspaceID}}",
    "backgroundTheme":"light"
}

I hope this solves the problem for you. If you have any additional questions please let me know.

@kkoechley While I use “Light” display mode, it creates a workspace with dark background

I decided to use copyFrom option. updateMyWorkspaceStyle requires calling two APIs and copyFrom provides me more data consistency

hi @Amerehei,

That makes sense. I’ll check and see if there is a way to have this added to createWorkspace so it doesn’t require multiple API calls or a copyFrom. I’ll get back to you with more details when i get them.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.