Notifications
Test Notifications

Test Notifications

To test the notifications we created earlier we need to query data from the GraphQL server. The URL for this GraphQL server is in Project Details in the ROQ console.

This page shows all the credentials to access the GraphQL server.

Project details for graphql api

To test or trigger the notifications, we can use a GraphQL query like this:

mutation {
  notify(
    notification: {
      key: "translated-file-conversion"
      recipients: {
        userIds: ["163ae909-b611-423c-b105-67f86a8870ac"]
        userGroups: { operator: AND, userGroupIds: ["325a3bc5-3d65-4868-b4af-85d4f8f206b8"] }
        allUsers: false
      },
      data: [{ key: 'downloadLink', value: 'https://roq.ai' }]
    }
  ) {
    usersNotified {
      count
    }
  }
}

If you execute the GraphQL query above in the GraphQL API server sandbox, you will get 1 user notified.

Graphql query sandbox

and the triggered notifications will show to any recipients.

Triggered notification