Once the community invitation is created, the user associated with the invitee context can accept or decline it. Also, the community owner or users associated with the ADMINISTRATOR scope can cancel it, if it is still in the pending state (was not accepted yet). The list of operations is available under the cta parameter in the CommuntiyInvitation object.

Accept community invitation

Only pending community invitations can be accepted by the user associated with invitee context. If invitation is accepted, the invitee user becomes the member of the associated community. To accept an invitation, acceptCommunityInvitation mutation should be executed. It has one required incoming argument - invitationId.
  mutation acceptCommunityInvitation {
    acceptCommunityInvitation(invitationId: 1) {
      response {
        id
      }
      errors
    }
  }
If the mutation executed successfully, a Community object will be returned in the response.

Decline community invitation

Pending community invitation can be declined by the user associated with the invitee context. If the invitation is declined, the invitee user does not become the community member, and the new community invitation can be sent to the same user again. To decline an invitation, use declineCommuntiyInvitation mutation. As in the previous example, this mutation accepts only one required incoming argument - invitationId.
  mutation declineCommunityInvitation {
    declineCommunityInvitation(invitationId: 2) {
      response
      errors
    }
  }
If the mutation is executed without any errors, the boolean value will be returned in the response, indicating the execution status. If true returned, mutation has been executed without any issues, and the community invitation has been declined.

Cancel community invitation

Pending community invitations can be cancelled by the user associated with the community owner context or the user associated with the ASMINISTRATOR scope. To cancel the community invitation, use cancelCommuntiyInvitation mutation. This mutation also accepts one required incoming argument - invitationId.
  mutation cancelCommunityInvitation {
    cancelCommunityInvitation(invitationId: 3) {
      response
       errors
    }
  }
If the mutation is executed without any errors, the boolean value will be returned in the response, indicating the execution status.