Skip to content

Update GraphQL endpoint to support sorting group variables

What does this MR do and why?

Update GraphQL endpoint to support sorting group variables by created_at and key

Related to the issue: #416441 (closed)

Add extra line Fix graphql name and default sort value Update graphql documentation

Changelog: changed

Database queries

CREATED_DESC

SELECT "ci_group_variables".* FROM "ci_group_variables" WHERE "ci_group_variables"."group_id" IN (62954852, 56722522) ORDER BY "ci_group_variables"."created_at" DESC LIMIT 16

Time: 25.234 ms

query plan

CREATED_ASC

SELECT "ci_group_variables".* FROM "ci_group_variables" WHERE "ci_group_variables"."group_id" IN (62954852, 56722522) ORDER BY "ci_group_variables"."created_at" ASC LIMIT 16

Time: 9.500 ms

query plan

KEY_DESC

SELECT "ci_group_variables".* FROM "ci_group_variables" WHERE "ci_group_variables"."group_id" IN (62954852, 56722522) ORDER BY "ci_group_variables"."key" DESC LIMIT 16

Time: 3.241 ms

query plan

KEY_ASC

SELECT "ci_group_variables".* FROM "ci_group_variables" WHERE "ci_group_variables"."group_id" IN (62954852, 56722522) ORDER BY "ci_group_variables"."key" ASC LIMIT 16

Time: 3.279 ms

query plan

How to set up and validate locally

  1. Navigate to the graphql explorer
http://localhost:3000/-/graphql-explorer. # can be different based on gdk config
No sort provided (same as sort: CREATED_DESC)

Query:

query getInheritedCiVariables {
  project(fullPath: "gnuwget/subwget/projsubwget") {
    id
    inheritedCiVariables(first: 15) {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      nodes {
        __typename
        id
        key
        variableType
        environmentScope
        groupCiCdSettingsPath
        groupName
        masked
        protected
      }
    }
  }
}

Response:


{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/25",
      "inheritedCiVariables": {
        "pageInfo": {
          "hasNextPage": true,
          "hasPreviousPage": false,
          "startCursor": "eyJjcmVhdGVkX2F0IjoiMjAyMy0wNi0yMiAxMzozMjo1MS45NzExMzYwMDAgKzAwMDAiLCJpZCI6IjIwIn0",
          "endCursor": "eyJjcmVhdGVkX2F0IjoiMjAyMy0wNi0yMSAxNDo1MTo0NC4zMjAxNzcwMDAgKzAwMDAiLCJpZCI6IjYifQ"
        },
        "nodes": [
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/20",
            "key": "sdfsdfdsfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/19",
            "key": "dsfsdfsdfdsf",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/18",
            "key": "sdfsdfsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/17",
            "key": "sdfsdfsdfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/16",
            "key": "sdfdsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/15",
            "key": "xcvxcvcxvcx",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/14",
            "key": "dfgdfgfdgfd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/13",
            "key": "ytuytuytuty",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/12",
            "key": "yyyyy",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/11",
            "key": "rrfffff",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/10",
            "key": "werwerewr",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/9",
            "key": "eewewe",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/8",
            "key": "ccc",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/7",
            "key": "groupsubwgetvar2",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/6",
            "key": "groupsubwgetvar1",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          }
        ]
      }
    }
  }
}
created_at descending sort provided sort: CREATED_DESC

Query:

query getInheritedCiVariables {
  project(fullPath: "gnuwget/subwget/projsubwget") {
    id
    inheritedCiVariables(first: 15, sort: CREATED_DESC) {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      nodes {
        __typename
        id
        key
        variableType
        environmentScope
        groupCiCdSettingsPath
        groupName
        masked
        protected
      }
    }
  }
}

Response:

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/25",
      "inheritedCiVariables": {
        "pageInfo": {
          "hasNextPage": true,
          "hasPreviousPage": false,
          "startCursor": "eyJjcmVhdGVkX2F0IjoiMjAyMy0wNi0yMiAxMzozMjo1MS45NzExMzYwMDAgKzAwMDAiLCJpZCI6IjIwIn0",
          "endCursor": "eyJjcmVhdGVkX2F0IjoiMjAyMy0wNi0yMSAxNDo1MTo0NC4zMjAxNzcwMDAgKzAwMDAiLCJpZCI6IjYifQ"
        },
        "nodes": [
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/20",
            "key": "sdfsdfdsfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/19",
            "key": "dsfsdfsdfdsf",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/18",
            "key": "sdfsdfsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/17",
            "key": "sdfsdfsdfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/16",
            "key": "sdfdsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/15",
            "key": "xcvxcvcxvcx",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/14",
            "key": "dfgdfgfdgfd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/13",
            "key": "ytuytuytuty",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/12",
            "key": "yyyyy",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/11",
            "key": "rrfffff",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/10",
            "key": "werwerewr",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/9",
            "key": "eewewe",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/8",
            "key": "ccc",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/7",
            "key": "groupsubwgetvar2",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/6",
            "key": "groupsubwgetvar1",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          }
        ]
      }
    }
  }
}
created_at ascending sort provided sort: CREATED_ASC

Query:

query getInheritedCiVariables {
  project(fullPath: "gnuwget/subwget/projsubwget") {
    id
    inheritedCiVariables(first: 15, sort: CREATED_ASC) {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      nodes {
        __typename
        id
        key
        variableType
        environmentScope
        groupCiCdSettingsPath
        groupName
        masked
        protected
      }
    }
  }
}

Response:

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/25",
      "inheritedCiVariables": {
        "pageInfo": {
          "hasNextPage": true,
          "hasPreviousPage": false,
          "startCursor": "eyJjcmVhdGVkX2F0IjoiMjAyMy0wNi0yMCAyMjoyNzozNy4xOTY3OTUwMDAgKzAwMDAiLCJpZCI6IjQifQ",
          "endCursor": "eyJjcmVhdGVkX2F0IjoiMjAyMy0wNi0yMiAxMzozMjo0Mi4xODQ4MjcwMDAgKzAwMDAiLCJpZCI6IjE4In0"
        },
        "nodes": [
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/4",
            "key": "aaa",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/5",
            "key": "bbb",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/6",
            "key": "groupsubwgetvar1",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/7",
            "key": "groupsubwgetvar2",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/8",
            "key": "ccc",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/9",
            "key": "eewewe",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/10",
            "key": "werwerewr",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/11",
            "key": "rrfffff",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/12",
            "key": "yyyyy",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/13",
            "key": "ytuytuytuty",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/14",
            "key": "dfgdfgfdgfd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/15",
            "key": "xcvxcvcxvcx",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/16",
            "key": "sdfdsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/17",
            "key": "sdfsdfsdfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/18",
            "key": "sdfsdfsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          }
        ]
      }
    }
  }
}
key descending sort provided sort: KEY_DESC

Query:

query getInheritedCiVariables {
  project(fullPath: "gnuwget/subwget/projsubwget") {
    id
    inheritedCiVariables(first: 15, sort: KEY_DESC) {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      nodes {
        __typename
        id
        key
        variableType
        environmentScope
        groupCiCdSettingsPath
        groupName
        masked
        protected
      }
    }
  }
}

Response:

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/25",
      "inheritedCiVariables": {
        "pageInfo": {
          "hasNextPage": true,
          "hasPreviousPage": false,
          "startCursor": "eyJrZXkiOiJ5eXl5eSIsImlkIjoiMTIifQ",
          "endCursor": "eyJrZXkiOiJjY2MiLCJpZCI6IjgifQ"
        },
        "nodes": [
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/12",
            "key": "yyyyy",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/13",
            "key": "ytuytuytuty",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/15",
            "key": "xcvxcvcxvcx",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/10",
            "key": "werwerewr",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/17",
            "key": "sdfsdfsdfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/18",
            "key": "sdfsdfsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/20",
            "key": "sdfsdfdsfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/16",
            "key": "sdfdsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/11",
            "key": "rrfffff",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/7",
            "key": "groupsubwgetvar2",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/6",
            "key": "groupsubwgetvar1",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/9",
            "key": "eewewe",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/19",
            "key": "dsfsdfsdfdsf",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/14",
            "key": "dfgdfgfdgfd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/8",
            "key": "ccc",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          }
        ]
      }
    }
  }
}
key ascending sort provided sort: KEY_ASC

Query:

query getInheritedCiVariables {
  project(fullPath: "gnuwget/subwget/projsubwget") {
    id
    inheritedCiVariables(first: 15, sort: KEY_ASC) {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      nodes {
        __typename
        id
        key
        variableType
        environmentScope
        groupCiCdSettingsPath
        groupName
        masked
        protected
      }
    }
  }
}

Response:

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/25",
      "inheritedCiVariables": {
        "pageInfo": {
          "hasNextPage": true,
          "hasPreviousPage": false,
          "startCursor": "eyJrZXkiOiJhYWEiLCJpZCI6IjQifQ",
          "endCursor": "eyJrZXkiOiJ4Y3Z4Y3ZjeHZjeCIsImlkIjoiMTUifQ"
        },
        "nodes": [
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/4",
            "key": "aaa",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/5",
            "key": "bbb",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/8",
            "key": "ccc",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/14",
            "key": "dfgdfgfdgfd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/19",
            "key": "dsfsdfsdfdsf",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/9",
            "key": "eewewe",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/6",
            "key": "groupsubwgetvar1",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/7",
            "key": "groupsubwgetvar2",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/subwget/-/settings/ci_cd",
            "groupName": "subwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/11",
            "key": "rrfffff",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/16",
            "key": "sdfdsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/20",
            "key": "sdfsdfdsfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/18",
            "key": "sdfsdfsdfds",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/17",
            "key": "sdfsdfsdfsd",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/10",
            "key": "werwerewr",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          },
          {
            "__typename": "InheritedCiVariable",
            "id": "gid://gitlab/Ci::GroupVariable/15",
            "key": "xcvxcvcxvcx",
            "variableType": "ENV_VAR",
            "environmentScope": "*",
            "groupCiCdSettingsPath": "/groups/gnuwget/-/settings/ci_cd",
            "groupName": "Gnuwget",
            "masked": false,
            "protected": true
          }
        ]
      }
    }
  }
}
## MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Dmytro Biryukov

Merge request reports