To retrieve the list of the community invitations that were sent to the current API user and were not accepted yet,getPendingCommunityInvitations query should be called. The query result contains pagination and it is possible to change the sorting order and key. Supports cursor-based (after, before) or limit-based (first, last) pagination. 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 change the order of the sorting to DESC.false
sortKeyCommunityInvitationSortKeyProvides the possibility to change the query sorting key. Available options: CREATED (sorting by the invitation creation date) or NAME (by the invitee user context name).CREATED
  query getPendingCommunityInvitations {
    getPendingCommunityInvitations(first: 1) {
      edges {
        node {
          id
          created
          community {
            id
            title
          }
        }
      }
      totalItems
    }
  }
The list of nodes in the response contains CommunityInvatation object, the full description can be found here.