8000 Remove setting the clientMutationId variable · github/platform-samples@10b3fb7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 10b3fb7

Browse files
committed
Remove setting the clientMutationId variable
This variable is always added, so it is not necessary to set it manually. Reference doc: https://graphql-ruby.org/api-doc/1.8.13/GraphQL/Schema/RelayClassicMutation Thanks to @sn2b for pointing this out!
1 parent aff3f7e commit 10b3fb7

6 files changed

+72
-74
lines changed

graphql/queries/enterprise-get-ip-allow-list.graphql

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
# - The IP allow list for GitHub Apps enabled setting
66

77
query GetEnterpriseIPAllowList {
8-
enterprise(slug: "ENTERPRISE_SLUG") {
9-
owner_id: id
10-
enterprise_slug: slug
11-
enterprise_owner_info: ownerInfo {
12-
is_ip_allow_list_enabled: ipAllowListEnabledSetting
13-
is_ip_allow_list_for_github_apps_enabled: ipAllowListForInstalledAppsEnabledSetting
14-
ipAllowListEntries(first: 100) {
15-
nodes {
16-
ip_allow_list_entry_id: id
17-
ip_allow_list_entry_name: name
18-
ip_allow_list_entry_value: allowListValue
19-
ip_allow_list_entry_created: createdAt
20-
is_ip_allow_list_entry_active: isActive
21-
}
22-
}
8+
enterprise(slug: "ENTERPRISE_SLUG") {
9+
owner_id: id
10+
enterprise_slug: slug
11+
enterprise_owner_info: ownerInfo {
12+
is_ip_allow_list_enabled: ipAllowListEnabledSetting
13+
is_ip_allow_list_for_github_apps_enabled: ipAllowListForInstalledAppsEnabledSetting
14+
ipAllowListEntries(first: 100) {
15+
nodes {
16+
ip_allow_list_entry_id: id
17+
ip_allow_list_entry_name: name
18+
ip_allow_list_entry_value: allowListValue
19+
ip_allow_list_entry_created: createdAt
20+
is_ip_allow_list_entry_active: isActive
2321
}
22+
}
2423
}
24+
}
2525
}

graphql/queries/ip-allow-list-add-ip.graphql

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@
99
# - enterprise accounts: https://github.com/github/platform-samples/blob/master/graphql/queries/enterprise-get-ip-allow-list.graphql
1010

1111
mutation AddIPAddressToIPAllowList {
12-
createIpAllowListEntry(
13-
input: {
14-
clientMutationId: "true"
15-
ownerId: "OWNER_ID"
16-
name: "DESCRIPTION_OF_IP_ADDRESS"
17-
allowListValue: "IP_ADDRESS"
18-
isActive: true
19-
}
20-
) {
21-
clientMutationId
22-
ipAllowListEntry {
23-
ip_allow_list_entry_id: id
24-
ip_allow_list_entry_name: name
25-
ip_allow_list_entry_ip_address: allowListValue
26-
ip_allow_list_entry_created: createdAt
27-
ip_allow_list_entry_updated: updatedAt
28-
is_ip_allow_list_entry_active: isActive
29-
}
12+
createIpAllowListEntry(
13+
input: {
14+
ownerId: "OWNER_ID"
15+
name: "DESCRIPTION_OF_IP_ADDRESS"
16+
allowListValue: "IP_ADDRESS"
17+
isActive: true
3018
}
19+
) {
20+
ipAllowListEntry {
21+
ip_allow_list_entry_id: id
22+
ip_allow_list_entry_name: name
23+
ip_allow_list_entry_ip_address: allowListValue
24+
ip_allow_list_entry_created: createdAt
25+
ip_allow_list_entry_updated: updatedAt
26+
is_ip_allow_list_entry_active: isActive
27+
}
28+
}
3129
}
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This query is used to disable the IP allow list feature.
1+
# This query is used to disable the IP allow list feature. This will apply to both IP addresses and GitHub Apps.
22
# This can be used on both organizations and enterprise accounts.
33
#
44
# The `OWNER_ID` is the ID of the organization or enterprise account. You can
@@ -8,14 +8,15 @@
88
# - organizations: https://github.com/github/platform-samples/blob/master/graphql/queries/org-get-ip-allow-list.graphql
99
# - enterprise accounts: https://github.com/github/platform-samples/blob/master/graphql/queries/enterprise-get-ip-allow-list.graphql
1010

11-
mutation EnableIPAllowList {
12-
updateIpAllowListEnabledSetting(
13-
input: {
14-
clientMutationId: "true"
15-
ownerId: "OWNER_ID"
16-
settingValue: DISABLED
17-
}
18-
) {
19-
clientMutationId
20-
}
11+
mutation DisableIPAllowList {
12+
updateIpAllowListEnabledSetting(
13+
input: { ownerId: "OWNER_ID", settingValue: DISABLED }
14+
) {
15+
clientMutationId
16+
}
17+
updateIpAllowListForInstalledAppsEnabledSetting(
18+
input: { ownerId: "OWNER_ID", settingValue: DISABLED }
19+
) {
20+
clientMutationId
21+
}
2122
}
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This query is used to enable the IP allow list feature.
1+
# This query is used to enable the IP allow list feature. This will apply to both IP addresses and GitHub Apps.
22
# This can be used on both organizations and enterprise accounts.
33
#
44
# The `OWNER_ID` is the ID of the organization or enterprise account. You can
@@ -9,13 +9,14 @@
99
# - enterprise accounts: https://github.com/github/platform-samples/blob/master/graphql/queries/enterprise-get-ip-allow-list.graphql
1010

1111
mutation EnableIPAllowList {
12-
updateIpAllowListEnabledSetting(
13-
input: {
14-
clientMutationId: "true"
15-
ownerId: "OWNER_ID"
16-
settingValue: ENABLED
17-
}
18-
) {
19-
clientMutationId
20-
}
12+
updateIpAllowListEnabledSetting(
13+
input: { ownerId: "OWNER_ID", settingValue: ENABLED }
14+
) {
15+
clientMutationId
16+
}
17+
updateIpAllowListForInstalledAppsEnabledSetting(
18+
input: { ownerId: "OWNER_ID", settingValue: ENABLED }
19+
) {
20+
clientMutationId
21+
}
2122
}

graphql/queries/ip-allow-list-remove-ip-entry.graphql

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
# - enterprise accounts: https://github.com/github/platform-samples/blob/master/graphql/queries/enterprise-get-ip-allow-list.graphql
1010

1111
mutation DeleteIPAddressFromIPAllowList {
12-
deleteIpAllowListEntry(
13-
input: { clientMutationId: "true", ipAllowListEntryId: "IP_ENTRY_ID" }
14-
) {
15-
clientMutationId
16-
}
12+
deleteIpAllowListEntry(input: { ipAllowListEntryId: "IP_ENTRY_ID" }) {
13+
clientMutationId
14+
}
1715
}

graphql/queries/org-get-ip-allow-list.graphql

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
# - The IP allow list for GitHub Apps enabled setting
66

77
query GetOrganizationIPAllowList {
8-
organization(login: "ORG_NAME") {
9-
owner_id: id
10-
organization_slug: login
11-
is_ip_allow_list_enabled: ipAllowListEnabledSetting
12-
is_ip_allow_list_for_github_apps_enabled: ipAllowListForInstalledAppsEnabledSetting
13-
ipAllowListEntries(first: 100) {
14-
totalCount
15-
nodes {
16-
ip_allow_list_entry_id: id
17-
ip_allow_list_entry_name: name
18-
ip_allow_list_entry_ip_address: allowListValue
19-
ip_allow_list_entry_created: createdAt
20-
is_ip_allow_list_entry_active: isActive
21-
}
22-
}
8+
organization(login: "ORG_NAME") {
9+
owner_id: id
10+
organization_slug: login
11+
is_ip_allow_list_enabled: ipAllowListEnabledSetting
12+
is_ip_allow_list_for_github_apps_enabled: ipAllowListForInstalledAppsEnabledSetting
13+
ipAllowListEntries(first: 100) {
14+
totalCount
15+
nodes {
16+
ip_allow_list_entry_id: id
17+
ip_allow_list_entry_name: name
18+
ip_allow_list_entry_ip_address: allowListValue
19+
ip_allow_list_entry_created: createdAt
20+
is_ip_allow_list_entry_active: isActive
21+
}
2322
}
23+
}
2424
}

0 commit comments

Comments
 (0)
0