Skip to content

Commit 4292fb1

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: GitSponsorshipTiers.gql ( Fixes #25 )
1 parent 5c4ec3b commit 4292fb1

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

docs/_data/Help/Get-GQL.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"Synopsis": "Gets a GraphQL query.",
3+
"Description": "Gets a GraphQL query and returns the results as a PowerShell object.",
4+
"Parameters": [
5+
{
6+
"Name": null,
7+
"Type": null,
8+
"Description": "",
9+
"Required": false,
10+
"Position": 0,
11+
"Aliases": null,
12+
"DefaultValue": null,
13+
"Globbing": false,
14+
"PipelineInput": null,
15+
"variableLength": false
16+
}
17+
],
18+
"Notes": [
19+
null
20+
],
21+
"CommandType": "Function",
22+
"Component": [
23+
null
24+
],
25+
"Inputs": [
26+
null
27+
],
28+
"Outputs": [
29+
null
30+
],
31+
"Links": [],
32+
"Examples": [
33+
{
34+
"Title": "EXAMPLE 1",
35+
"Markdown": "Getting git sponsorship information from GitHub GraphQL.\n**To use this example, we'll need to provide `$MyPat` with a Personal Access Token.** ",
36+
"Code": "Get-GQL -Query ./Examples/GitSponsors.gql -PersonalAccessToken $myPat"
37+
},
38+
{
39+
"Title": "EXAMPLE 2",
40+
"Markdown": "We can decorate graph object results to customize them.\nLet's add a Sponsors property to the output object that returns the sponsor nodes.",
41+
"Code": "Update-TypeData -TypeName 'GitSponsors' -MemberName 'Sponsors' -MemberType ScriptProperty -Value {\n $this.viewer.sponsors.nodes\n} -Force\n\n# And let's add a Sponsoring property to the output object that returns the sponsoring nodes.\nUpdate-TypeData -TypeName 'GitSponsors' -MemberName 'Sponsoring' -MemberType ScriptProperty -Value {\n $this.viewer.sponsoring.nodes\n} -Force\n\n# And let's display sponsoring and sponsors by default\nUpdate-TypeData -TypeName 'GitSponsors' -DefaultDisplayPropertySet 'Sponsors','Sponsoring' -Force\n\n# Now we can run the query and get the results.\nGet-GQL -Query ./Examples/GitSponsors.gql -PersonalAccessToken $myPat -PSTypeName 'GitSponsors' | \n Select-Object -Property Sponsors,Sponsoring"
42+
}
43+
]
44+
}

0 commit comments

Comments
 (0)