https://github.com/diberry/graphql-data-scrape-action
https://github.com/diberry/graphql-data-scrape-action
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/diberry/graphql-data-scrape-action
- Owner: diberry
- Created: 2022-11-28T14:19:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-02T16:13:46.000Z (over 3 years ago)
- Last Synced: 2024-03-14T13:42:19.843Z (over 2 years ago)
- Language: JavaScript
- Size: 1.14 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# GraphQL query javascript action
This action runs a GraphQL query and returns the data as JSON.
## Inputs
### `bearer-token`
The bearer token used to access the GraphQL endpoint. If your endpoint doesn't require a bearer token, set the `bearer-token-override` input to true. **Generally required**
### `bearer-token-override`
Set to true if your GraphQL endpoint doesn't require a bearer token for authentication. **Default** is false.
### `graphql-url`
Set to GraphQL endpoint URL. **Default** is `https://api.github.com/graphql`.
### `query`
Set to GraphQL query. **Default** fetches all repositories for `Azure-Samples` org.
### `query-variables`
Set to GraphQL variables.
### `github-graphql-default-org`
Set to GitHub org to use default query with a different GitHub org. **Default** is `Azure-Samples`.
## Outputs
### `data`
The data requested is returned in JSON object.
## Example usage - set bearer token
```yaml
uses: actions/graphql-data@v1.1
with:
bearer-token: 'PUT YOUR GITHUB PERSONAL ACCESS TOKEN HERE'
```
## Example usage - change GitHub org name
```yaml
uses: actions/graphql-data@v1.1
with:
bearer-token: 'PUT YOUR GITHUB PERSONAL ACCESS TOKEN HERE'
github-graphql-default-org: 'MicrosoftDocs'
```
## Example usage - query your own endpoint without authentication
```yaml
uses: actions/graphql-data@v1.1
with:
graphql-url: 'https://YOUR-DOMAIN.com/graphql'
bearer-token-override: true
query: `Query { whoami { name } }`
```