2.0.0 • Published 9 months ago
screwdriver-scm-github-graphql v2.0.0
scm-github-graphql
Usage
npm install screwdriver-scm-github-graphqlInitialization
The class interacts with (GitHub GraphQL API)https://docs.github.com/en/enterprise-cloud@latest/graphql/overview/about-the-graphql-api The following configuration is needed
| Parameter | Type | Default | Description |
|---|---|---|---|
| config | Object | Configuration Object | |
| config.graphQlUrl | String | https://api.github.com/graphql | Github GraphQL API Endpoint |
const scm = new GithubScmGraphQL({
graphQlUrl: 'https://api.github.com/graphql'
});Methods
getEnterpriseUserAccount
Required parameters:
| Parameter | Type | Description |
|---|---|---|
| schema | Object | The schema object |
| schema.slug | String | The github enterprise slug |
| schema.login | String | The github user's login name |
| schema.token | String | The github token to interact with the graphql api |
Expected Outcome
Gets the enterprise user account based on schema https://docs.github.com/en/enterprise-cloud@latest/graphql/reference/objects#enterpriseuseraccount
listEnterpriseMembers
Required parameters:
| Parameter | Type | Description |
|---|---|---|
| schema | Object | The schema object |
| schema.slug | String | The github enterprise slug |
| schema.token | String | The github token to interact with the graphql api |
Expected Outcome
This method retrieves a list of enterprise members based on schema https://docs.github.com/en/enterprise-cloud@latest/graphql/reference/unions#enterprisemember.
getUser
Required parameters:
| Parameter | Type | Description |
|---|---|---|
| schema | Object | The schema object |
| schema.login | String | The github user's login name |
| schema.token | String | The github token to interact with the graphql api |
Expected Outcome
Returns the github user based on schema https://docs.github.com/en/enterprise-cloud@latest/graphql/reference/objects#user
Testing
npm testLicense
Code licensed under the BSD 3-Clause license. See LICENSE file for terms.