Skip to content

Commit fe741f2

Browse files
updating graphql queries
1 parent c5bbf87 commit fe741f2

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

graphql/README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ Some of the queries are provided as `.json` files, such as `list-enterprise-id.j
66
./post_gql.sh --file list-enterprise-id.json --pat xxx
77
```
88

9-
## list-enterprise-id.sh
10-
11-
Obtain the enterprise ID used for other GraphQL calls. Use the URL slug not the friendly name of the Enterprise.
12-
13-
[Documentation](https://docs.github.com/en/graphql/reference/queries#enterprise)
14-
159
## create-organization.sh
1610

1711
Creates the organization - you just need to pass in the enterprise ID (obtained [above](https://github.com/joshjohanning/github-misc-scripts/tree/main/graphql#list-enterprise-idjson)) along with billing email, admin logins, and organization name.
@@ -29,3 +23,33 @@ Script to download a file from the latest version of a GitHub Package
2923
Script to download a file from a specific version of a GitHub Package
3024

3125
[Documentation](https://docs.github.com/en/graphql/reference/objects#package)
26+
27+
## get-enterprise-id.sh
28+
29+
Get the enterprise ID used for other GraphQL calls. Use the URL slug not the friendly name of the Enterprise.
30+
31+
[Documentation](https://docs.github.com/en/graphql/reference/queries#enterprise)
32+
33+
## get-issue-id.sh
34+
35+
Get an issue ID - needed for transferring an sisue, example
36+
37+
[Documentation](https://docs.github.com/en/graphql/reference/objects#issue)
38+
39+
## get-organization.sh
40+
41+
Gets an organization
42+
43+
[Documentation](https://docs.github.com/en/graphql/reference/queries#organization)
44+
45+
## get-repository-id.sh
46+
47+
Gets a repository ID
48+
49+
[Documentation](https://docs.github.com/en/graphql/reference/queries#repository)
50+
51+
## transfer-issue.sh
52+
53+
Mutation to transfer an issue to a new repository
54+
55+
[Documentation](https://docs.github.com/en/graphql/reference/mutations#transferissue)
File renamed without changes.
File renamed without changes.

graphql/get-organization.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
curl -X POST 'https://api.github.com/graphql' \
4+
-H "Authorization: bearer ${PAT}" \
5+
--data-raw '{"query":"query getOrganization($org_name:String!) {organization(login: $org_name) {id name organizationBillingEmail}}","variables":{"org_name":"my-org-name"}}'

0 commit comments

Comments
 (0)