Skip to content

Commit 0862276

Browse files
committed
Use generic variables for orgs and enterprises
The existing variables are too specific to the GitHub org. This commit addresses this in the following files: - org-repos-fragment-directive-2.graphql - org-repos-fragment-directive.graphql --- In addition, the following files have references to variable usage, but was not explicitly declared anywhere: - enterprise-saml-identities.graphql - org-branches-and-commits-by-repository.graphql - org-members-by-team.graphql - org-pr-merged-info-by-repository.graphql - repo-get-all-branches.graphql - repos-get-last-issue-comment.graphql I've updated the above files to just use simple strings to replace prior to using the queries in them.
1 parent 58cbb38 commit 0862276

8 files changed

Lines changed: 17 additions & 17 deletions

graphql/queries/enterprise-saml-identities.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# If the Identity Provider has sent an `emails` attribute/value in a previous SAML response for enterprise member(s), it also possible to add the `emails` attribute in the `samlIdentity` section right below `nameID` and query for this SAML identity attribute value as well.
44
# If there are a large number of identities/users (greater than 100), pagination will need to be used. See https://graphql.org/learn/pagination/ for details on pagination. There is an example of pagination in simple-pagination-example.graphql.
55

6-
query listSSOUserIdentities($enterpriseSlug: String!) {
7-
enterprise(slug: $enterpriseSlug) {
6+
query listSSOUserIdentities {
7+
enterprise(slug: "ENTERPRISE_SLUG") {
88
ownerInfo {
99
samlIdentityProvider {
1010
externalIdentities(first: 100) {

graphql/queries/org-branches-and-commits-by-repository.graphql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
query getCommitsByBranchByRepo($orgName:String!, $repoName:String!) {
2-
organization(login:$orgName) {
1+
query getCommitsByBranchByRepo {
2+
organization(login: "ORGANIZATION_SLUG") {
33
name
4-
repository(name:$repoName) {
4+
repository(name: "REPO_NAME") {
55
name
66
refs(refPrefix: "refs/heads/", first: 10) {
77
nodes {

graphql/queries/org-members-by-team.graphql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
query getMembersByTeam($orgName: String!, $teamName: String!) {
2-
organization(login: $orgName) {
1+
query getMembersByTeam {
2+
organization(login: "ORGANIZATION_SLUG") {
33
id
44
name
5-
teams(first: 1, query: $teamName) {
5+
teams(first: 1, query: "TEAM_NAME") {
66
edges {
77
node {
88
id

graphql/queries/org-pr-merged-info-by-repository.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
query getRepoMergedPRDetails($orgName: String!, $repoName: String!) {
2-
repository(owner: $orgName, name: $repoName) {
1+
query getRepoMergedPRDetails {
2+
repository(owner: "ORGANIZATION_SLUG, name: "REPO_NAME") {
33
pullRequests(first: 100, states: MERGED) {
44
pageInfo {
55
endCursor #use this value in the pullRequests argument list

graphql/queries/org-repos-fragment-directive-2.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
query orgInfo($showRepoInfo: Boolean!) {
2-
organization(login: "github") {
2+
organization(login: "ORGANIZATION_SLUG") {
33
...orgFrag
44
}
55
}

graphql/queries/org-repos-fragment-directive.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
query orgInfo($showRepoInfo: Boolean!) {
2-
organization(login: "github") {
2+
organization(login: "ORGANIZATION_SLUG") {
33
login
44
name
55
repositories @include(if: $showRepoInfo) {

graphql/queries/repo-get-all-branches.graphql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
query getExistingRepoBranches($orgName: String!, $repoName: String!) {
2-
organization(login: $orgName) {
3-
repository(name: $repoName) {
1+
query getExistingRepoBranches {
2+
organization(login: "ORGANIZATION_SLUG") {
3+
repository(name: "REPO_NAME") {
44
id
55
name
66
refs(refPrefix: "refs/heads/", first: 10) {

graphql/queries/repos-get-last-issue-comment.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
query getRepoIssue($orgName: String!, $repoName: String!) {
2-
repository(owner: $orgName, name: $repoName) {
1+
query getRepoIssue {
2+
repository(owner: "ORGANIZATION_SLUG", name: "REPO_NAME") {
33
issues(last: 1) {
44
edges {
55
node {

0 commit comments

Comments
 (0)