Skip to content

Implement GraphQL Query to Fetch Available DuoChat Slash Commands

We need a GraphQL query that fetches available slash commands for a given user on a given URL. This will be consumed by the frontend to display relevant commands based on the user’s permissions and context.

Create a new GraphQL query in the monolith to handle the fetching of available slash commands for a user. The frontend will pass necessary inputs such as the URL (context of where the command is being issued) and the userId. The backend should return an array of available slash commands that the user is allowed to use in that context.

{
  getSlashCommands(url: "<context_url>", userId: "<user_id>") {
    commands {
      name
    }
  }
}