Skip to main content
To get the list of all notifications available for the current API user, a getNotifications query should be called. Results will be returned with the pagination and possibility to change the order (default sorting is by the creation date, ascending). The following arguments can be used in the query:
ArgumentTypeDescriptionDefault
afterCursorReturns results that come after the specified cursor. Should be used together with first parameter. Cannot be used if before is set.
beforeCursorReturns results that come before the specified cursor. Should be used together with last parameter. Cannot be used if after is set.
firstIntegerReturns up to the first N elements from the list. Required if after parameter is set. Cannot be used together with last.
lastIntegerReturns up to the first N elements from the list. Required if before parameter is set. Cannot be used together with first.
reverseBooleanAllows to reverse the order of the underlying list (default order is ascending).false
typrNotificationTypeProvides a filter by the notification type. Multiple options can be selected.
statusNotificationStatusAllows to filter the results by the notification status. Available options: READ, UNREAD
The query returns a list of Notification objects.
query getNotifications {
  getNotifications(first: 20, reverse: true) {
    edges {
      node {
        id
        status
        text
        created
        type
        cta {
          actionId
          arguments {
            key
            value
          }
        }
        relatedEntity {
          __typename
          ... on LearningPath {
            training {
              image {
                imageStyle(id: IMAGE_200x200) {
                  url
                }
              }
            }
          }
          ... on Badge {
            picture {
              imageStyle(id: IMAGE_200x200) {
                url
              }
            }
          }
          ... on Post {
            authorUserContext {
              uuid
            }
          }
          ... on Like {
            userContext {
              uuid
            }
          }
          ... on UserInvitation {
            initiatorUserContext {
              uuid
            }
          }
          ... on UserContext {
            uuid
          }
        }
      }
    }
  }
}