在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:tamino-martinius/node-github-graphql-api开源软件地址:https://github.com/tamino-martinius/node-github-graphql-api开源编程语言:TypeScript 100.0%开源软件介绍:GitHub GraphQL APIA node client for the GitHub GraphQL API with minimal dependencies created with TypeScript. Table of contentsSimple QueriesWith this package you can more or less just copy and paste the query and the variables from the GitHub GraphQL Explorer for immediate results. import { GitHub } from 'github-graphql-api';
const github = new GitHub({ token: 'xxx' })
github.query(`
query {
rateLimit {
remaining
}
}
`).then(console.log); Passing variablesWith this package you can more or less just copy and paste the query and the variables from the GitHub GraphQL Explorer for immediate results. import { GitHub } from 'github-graphql-api';
const github = new GitHub({ token: 'xxx' })
const getUserBio = async (username) => {
return await github.query(`
query (
$username: String!
) {
user(login: $username) {
bio
}
}
`, {
username,
});
} Constructor optionsnew GitHub({
token: 'xxx', // required
apiUrl: 'https://example.com', // default: https://api.github.com/graphql
}) The GitHub API Token can be created on your Developer Settings page. You are able to define the Permissions of the Access Token. The Api URL can be changed for GitHub Enterprise Users which run them on their own domain. Require / Import// ES6
import { GitHub } from 'github-graphql-api';
import GithubGraphQLApi from 'github-graphql-api';
// CommonJs
const { Github } = require('github-graphql-api');
const GithubGraphQLApi = require('github-graphql-api').default; ChangelogSee history for more details.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论