Proyek
Lihat di GitHub
octokit/graphql-schema
Tentang
GitHub’s GraphQL Schema with validation. Automatically updated.
Pengembangan web dan aplikasiPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- 0
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Asligraphql-schema
GitHub’s GraphQL Schema with validation. Automatically updated.
Usage
Validation
import { validate } from "@octokit/graphql-schema";
const errors = validate(`
{
viewer {
login
}
}
`);
// errors is array. Contains errors if any
You can also load the current Schema directly as JSON or IDL.
import { schema } from "@octokit/graphql-schema";
schema.json; // JSON version
schema.idl; // IDL version
Schema as Types
import { graphql } from "@octokit/graphql";
import { Repository } from "@octokit/graphql-schema";
const { repository } = await graphql<{ repository: Repository }>(
`
{
repository(owner: "octokit", name: "graphql.js") {
issues(last: 3) {
edges {
node {
title
}
}
}
}
}
`,
{
headers: {
authorization: `token secret123`,
},
},
);
Local setup
git clone https://github.com/octokit/graphql-schema.git
cd graphql-schema
npm install
npm test
Update schema files (GITHUB_TOKEN requires no scope)
GITHUB_TOKEN=... npm run update
See also
- octokit/openapi – GitHub's OpenAPI specification with
x-octokitextension - octokit/webhooks – GitHub Webhooks specifications
- octokit/app-permissions – GitHub App permission specifications
LICENSE
Jelajahi proyek terkait
Memuat…