> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get possible user connections

To establish a connection between two user contexts, an invitation should be created.

First, need to get the list of available user contexts. To do this, use `getPossibleUserConnections` query.
It returns the list of user contexts who can be invited to join the current user's network.
Results will be returned with pagination and sorted by the name (ascending by default, the order can be reversed).
The same pagination approach as in other queries is used (for example, [getCatalogData](/OpignoEnterpriseAPI/PaginatingCatalogItems)).

The following arguments can be used in the query:

| Argument  | Type      | Description                                                                                                                                                                                | Default |
| :-------- | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ |
| `after`   | `Cursor`  | Returns results that come after the specified cursor. Should be used together with `first` parameter. Cannot be used if `before` is set.                                                   | —       |
| `before`  | `Cursor`  | Returns results that come before the specified cursor. Should be used together with `last` parameter. Cannot be used if `after` is set.                                                    | —       |
| `first`   | `Integer` | Returns up to the first N elements from the list. Required if `after` parameter is set. Cannot be used together with `last`.                                                               | —       |
| `last`    | `Integer` | Returns up to the first N elements from the list. Required if `before` parameter is set. Cannot be used together with `first`.                                                             | —       |
| `reverse` | `Boolean` | Allows to change the order of the sorting to `DESC`.                                                                                                                                       | `false` |
| `name`    | `String`  | Provides the possibility to filter by the user context name. **Note:** it makes sense only if the real user name is sent to Opigno Enterprise API during the user context synchronization. | —       |

<CodeGroup>
  ```filename GraphQL theme={null}
    query getPossibleUserConnections {
      getPossibleUserConnections(first: 2, after: "TzozMzoiRHJ1cGFsXG9waWdub19hcGlcV3JhcHBlcnNcQ3Vyc29yIjo0OntzOjE0OiIAKgBiYWNraW5nVHlwZSI7czoxNDoib3BpZ25vX2NvbnRleHQiO3M6MTI6IgAqAGJhY2tpbmdJZCI7aToxNjA2O3M6MTA6IgAqAHNvcnRLZXkiO3M6NToibGFiZWwiO3M6MTI6IgAqAHNvcnRWYWx1ZSI7czoyMDoiYWxpbmFfdGVzdF8xIG9waWdubzQiO30=") {
        edges {
          node {
            userContext {
              id
              uuid
            }
            cta {
              actionId
              title
              arguments {
                key
                value
              }
              metadata {
                key
                value
              }
            }
          }
        }
        pageInfo {
          hasNextPage
          startCursor
          endCursor
        }
        totalItems
      }
    }
  ```

  ```File Query result [expandable] theme={null}
    {
      "data": {
        "getPossibleUserConnections": {
          "edges": [
            {
              "node": {
                "userContext": {
                  "id": "1904",
                  "uuid": "bdb5d2e4-35a0-4147-a2b5-58e438896801",
                },
                "cta": [
                  {
                    "actionId": "CREATE_USER_INVITATION",
                    "title": "Invite",
                    "arguments": [
                      {
                        "key": "userContextUuid",
                        "value": "bdb5d2e4-35a0-4147-a2b5-58e438896801"
                      }
                    ],
                    "metadata": [
                      {
                        "key": "type",
                        "value": "button"
                      }
                    ]
                  }
                ]
              }
            },
            {
              "node": {
                "userContext": {
                  "id": "2129",
                  "uuid": "68ea0a44-6b8d-4739-aaa2-25aaac861802",
                },
                "cta": [
                  {
                    "actionId": "CREATE_USER_INVITATION",
                    "title": "Invite",
                    "arguments": [
                      {
                        "key": "userContextUuid",
                        "value": "68ea0a44-6b8d-4739-aaa2-25aaac861802"
                      }
                    ],
                    "metadata": [
                      {
                        "key": "type",
                        "value": "button"
                      }
                    ]
                  }
                ]
              }
            },
          ],
          "pageInfo": {
            "hasNextPage": true,
            "startCursor": "TzozMzoiRHJ1cGFsXG9waWdub19hcGlcV3JhcHBlcnNcQ3Vyc29yIjo0OntzOjE0OiIAKgBiYWNraW5nVHlwZSI7czoxNDoib3BpZ25vX2NvbnRleHQiO3M6MTI6IgAqAGJhY2tpbmdJZCI7aToxOTA0O3M6MTA6IgAqAHNvcnRLZXkiO3M6NToibGFiZWwiO3M6MTI6IgAqAHNvcnRWYWx1ZSI7czoxMToiQW5kcmlpIHRlc3QiO30=",
            "endCursor": "TzozMzoiRHJ1cGFsXG9waWdub19hcGlcV3JhcHBlcnNcQ3Vyc29yIjo0OntzOjE0OiIAKgBiYWNraW5nVHlwZSI7czoxNDoib3BpZ25vX2NvbnRleHQiO3M6MTI6IgAqAGJhY2tpbmdJZCI7aTo5ODA7czoxMDoiACoAc29ydEtleSI7czo1OiJsYWJlbCI7czoxMjoiACoAc29ydFZhbHVlIjtzOjk6IkF4ZWwgVGVzdCI7fQ=="
          },
          "totalItems": 12
        }
      }
    }
  ```
</CodeGroup>
