octokit / graphql-schema Goto Github PK
View Code? Open in Web Editor NEWGitHub’s GraphQL Schema with validation. Automatically updated.
License: MIT License
GitHub’s GraphQL Schema with validation. Automatically updated.
License: MIT License
Right now all the types are defined as type
so we can use them in program to get the types. But actually I think we can also use the types to generate the GraphQL SQL query string automatically.
So I think if we can define the types as class
and use a class instance as the parameter so the underlying program can generate query string from the instance and return the right type as well. Are there any side effects if we use class
instead of type
to do this?
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
I noticed this repository accepts PRs without a review approval.
Hello, we can no longer install and the entire registry for all versions seems to be missing...
https://registry.yarnpkg.com/@octokit/graphql-schema
All @octokit/graphql-schema versions
#19 4.935 error An unexpected error occurred: "https://registry.yarnpkg.com/@octokit/graphql-schema/-/graphql-schema-13.10.0.tgz: Request failed \"404 Not Found\"".
#19 4.935 info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
#19 4.935 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
semantic-release cannot push the version tag to the branch master
on remote Git repository with URL https://github.com/octokit/graphql-schema.git
.
Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment and make sure the repositoryUrl is configured with a valid Git URL.
Good luck with your project ✨
Your semantic-release bot 📦🚀
The fixedAt property is missing from the schema for the type RepositoryVulnerabilityAlert
There are some problems with the auto-update setup.
No response
No response
No response
14.2.0
to 14.2.1
.This version is covered by your current version range and after updating it in your project the build failed.
graphql is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 4 commits.
d2ffd7c
v14.2.1
3c79bed
buildClientSchema: Revert breaking change introduced in #1677 (#1808)
f289555
Update to ESLint 5.16 (#1807)
c1376e3
Enable Flow on more test files (#1806)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
This issue contains a list of Renovate updates and their statuses.
These updates are awaiting their schedule. Click on a checkbox to ignore the schedule.
Branch | Build failing 🚨 |
---|---|
Dependency |
semantic-release
|
Current Version | 15.4.2 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 5 commits.
a387c04
fix(package): update marked to version 0.4.0
228451b
docs: fix typo
3503407
docs: clarify which commit types trigger a release
5025fca
docs: fix FAQ heading level
6693080
style: fix table indentation
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! 💜 🚚💨 💚
Find out how to migrate to Snyk at greenkeeper.io
4.3.1
to 4.4.0
.This version is covered by your current version range and after updating it in your project the build failed.
@octokit/graphql is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: author, Invalid configuration option: codegen, Invalid configuration option: keywords, Invalid configuration option: license, Invalid configuration option: main, Invalid configuration option: name, Invalid configuration option: packageRules[0].graphql, Invalid configuration option: packageRules[0].graphql-tag, Invalid configuration option: packageRules[1].@graphql-codegen/cli, Invalid configuration option: packageRules[1].@graphql-codegen/typescript, Invalid configuration option: packageRules[1].@octokit/graphql, Invalid configuration option: packageRules[1].dotenv, Invalid configuration option: packageRules[1].execa, Invalid configuration option: packageRules[1].prettier, Invalid configuration option: packageRules[1].semantic-release, Invalid configuration option: packageRules[1].typescript, Invalid configuration option: publishConfig, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: sideEffects, Invalid configuration option: types, Invalid configuration option: version
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
semantic-release cannot push the version tag to the branch master
on the remote Git repository with URL https://x-access-token:[secure]@github.com/octokit/graphql-schema.git
.
This can be caused by:
Good luck with your project ✨
Your semantic-release bot 📦🚀
@heaths opened a discussion in May about how ProjectNext has no api for linking to a repository. This feature is still missing from ProjectV2.
await graphql(`
mutation {
linkRepositoryToProject(input: {projectId: "PVT_xxxxxxxxxxxxxxxx", repositoryId: "R_xxxxxxxxxx") {
project {
number,
id
}
}
}
`);
results in this error message:
Could not resolve to Project node with the global id of 'PVT_xxxxxxxxxxxxxxxx'
Some endpoint in the schema should allow linking a ProjectV2
to a repository. There is no REST API alternative for ProjectsV2, and there is currently no way to use the deprecated Project
object for new repositories.
Is this feature planned?
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project ✨
Your semantic-release bot 📦🚀
Hi,
The actor type seems to be generated incorrectly, based on the exported type:
/** Represents an object which can take actions on GitHub. Typically a User or Bot. */
export type Actor = {
/** A URL pointing to the actor's public avatar. */
avatarUrl: Scalars['URI'];
/** The username of the actor. */
login: Scalars['String'];
/** The HTTP path for this actor. */
resourcePath: Scalars['URI'];
/** The HTTP URL for this actor. */
url: Scalars['URI'];
};
https://github.com/octokit/graphql-schema/blob/master/schema.d.ts#L71-L80
However, I can also query user or bot properties off of this (as mentioned by the comment); seems as if the correct definition would be:
export type Actor = (User | Bot) & {
...
};
Happy to make a pull request; however this seems auto-generated by another package (https://github.com/dotansimha/graphql-code-generator#readme), so wanted to first ask if anyone here had any insight before escalating the problem there?
Node project has Typescript compile failing with:
node_modules/@octokit/graphql-schema/index.d.ts:1:30 - error TS2307: Cannot find module 'graphql' or its corresponding type declarations.
1 import { GraphQLError } from "graphql";
From the npm page for @octokit/graphql-schema, a similar problem occurs when using the runkit option. Opening the runkit page and trying to run the following gets an error.
var graphqlSchema = require("@octokit/graphql-schema")
console.log("hi");
graphql is installed as part of core. Missing export somewhere?
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
semantic-release cannot push the version tag to the branch master
on remote Git repository with URL https://[secure]@github.com/octokit/graphql-schema.git
.
Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment and make sure the repositoryUrl is configured with a valid Git URL.
Good luck with your project ✨
Your semantic-release bot 📦🚀
When running graphql-codegen --config codegen.yml
in this project after updating the @octokit/graphql-schema
from v14.46.1
to v15.15.0
. The error message shows that the schema cannot be loaded due to the absence of the "exports" main in the package.json of "@octokit/graphql-schema".
> [email protected] gen /home/runner/work/next-portfolio-dev/next-portfolio-dev
> graphql-codegen --config codegen.yml
[STARTED] Parse Configuration
[SUCCESS] Parse Configuration
[STARTED] Generate outputs
[STARTED] Generate to src/generated/graphql.ts
[STARTED] Load GraphQL schemas
[FAILED]
[FAILED] Failed to load schema from src/generated/github-schema-loader.cjs:
[FAILED]
[FAILED] Unable to load from file "/home/runner/work/next-portfolio-dev/next-portfolio-dev/src/generated/github-schema-loader.cjs": Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/@octokit/graphql-schema/package.json
[FAILED] at exportsNotFound (node:internal/modules/esm/resolve:304:10)
[FAILED] at packageExportsResolve (node:internal/modules/esm/resolve:594:13)
[FAILED] at resolveExports (node:internal/modules/cjs/loader:590:36)
[FAILED] at Module._findPath (node:internal/modules/cjs/loader:667:31)
[FAILED] at Module._resolveFilename (node:internal/modules/cjs/loader:1129:27)
[FAILED] at Module._load (node:internal/modules/cjs/loader:984:27)
[FAILED] at Module.require (node:internal/modules/cjs/loader:1231:19)
[FAILED] at require (node:internal/modules/helpers:179:18)
[FAILED] at Object.<anonymous> (/home/runner/work/next-portfolio-dev/next-portfolio-dev/src/generated/github-schema-loader.cjs:3:20)
[FAILED] at Module._compile (node:internal/modules/cjs/loader:1369:14)
[FAILED] Error: Unable to load from file "/home/runner/work/next-portfolio-dev/next-portfolio-dev/src/generated/github-schema-loader.cjs": Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/@octokit/graphql-schema/package.json
[FAILED] at exportsNotFound (node:internal/modules/esm/resolve:304:10)
[FAILED] at packageExportsResolve (node:internal/modules/esm/resolve:594:13)
[FAILED] at resolveExports (node:internal/modules/cjs/loader:590:36)
[FAILED] at Module._findPath (node:internal/modules/cjs/loader:667:31)
[FAILED] at Module._resolveFilename (node:internal/modules/cjs/loader:1129:27)
[FAILED] at Module._load (node:internal/modules/cjs/loader:984:27)
[FAILED] at Module.require (node:internal/modules/cjs/loader:1231:19)
[FAILED] at require (node:internal/modules/helpers:179:18)
[FAILED] at Object.<anonymous> (/home/runner/work/next-portfolio-dev/next-portfolio-dev/src/generated/github-schema-loader.cjs:3:20)
[FAILED] at Module._compile (node:internal/modules/cjs/loader:1369:14)
[FAILED] at tryToLoadFromExport (/home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/code-file-loader/cjs/load-from-module.js:38:15)
[FAILED] at async CodeFileLoader.handleSinglePath (/home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/code-file-loader/cjs/index.js:186:32)
[FAILED] at async /home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/code-file-loader/cjs/index.js:110:32
[FAILED] at async Promise.all (index 0)
[FAILED] at async CodeFileLoader.load (/home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/code-file-loader/cjs/index.js:108:9)
[FAILED] at async /home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:15:39
[FAILED] at async Promise.all (index 0)
[FAILED] at async loadFile (/home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:13:9)
[FAILED] at async /home/runner/work/next-portfolio-dev/next-portfolio-dev/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/load/cjs/load-typedefs/collect-sources.js:229:25
[FAILED]
[FAILED] GraphQL Code Generator supports:
[FAILED] - ES Modules and CommonJS exports (export as default or named export "schema")
[FAILED] - Introspection JSON File
[FAILED] - URL of GraphQL endpoint
[FAILED] - Multiple files with type definitions (glob expression)
[FAILED] - String in config file
[FAILED]
[FAILED] Try to use one of above options and run codegen again.
[FAILED]
[FAILED]
[SUCCESS] Generate outputs
Also there the failing test
I am loading the current schema directly as JSON in this github-schema-loader.cjs
file
require('@graphql-codegen/typescript');
require('@graphql-codegen/typescript-operations');
const { schema } = require('@octokit/graphql-schema');
module.exports = schema.json;
and using this github-schema-loader.cjs
in the schema for the GraphQL codegen in this yml
file
overwrite: true
schema: 'src/generated/github-schema-loader.cjs'
generates:
src/generated/graphql.ts:
plugins:
- 'typescript'
- 'typescript-operations'
Node.js v20.12.1
pnpm 9.0.6
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-operations": "^4.0.1",
"@octokit/graphql-schema": "15.15.0",
No response
Hi there! I was playing around with some queries in typescript. I was querying some trees/blobs off of the Repository object, and these results are typed like GitObject
.
However, I notice that the types are a bit prohibitive. In schema.d.ts
, I notice that Repository
is defined like so:
// This type definition snippet is truncated to be more legible.
// Really, this extends lots of interfaces and has lots more attributes.
export type Repository = {
/** A Git object in the repository */
object?: Maybe<GitObject>;
}
You'll see that, GitObject
is used here, although I'd like to tell TypeScript that its a Blob
or Tree
, both of which are types that can appear here. Instead of Maybe<GitObject>
, the type definition should be something like Maybe<GitObject | Tree | Blob | /* ...etc */>
. This lack of additional types is how its a bit prohibitive. I know I could use as
in typescript to work around this, but I don't like to do so.
Is there a way to do this currently, with this generated schema? Am I missing something?
I have a work-around, but its slightly verbose:
// This is just using graphql from octokit...
import {graphqlWithAuth} from "./graphql-with-auth"
import {
Blob,
GitObject as BaseGitObject,
Tree as BaseTree,
TreeEntry as BaseTreeEntry,
Repository as BaseRepository,
} from "@octokit/graphql-schema"
type Maybe<T> = T | null
// NOTE: Would be great if these types were powered by type-parameters sort of like this, out of the box!
type GitObject<T extends BaseGitObject = BaseGitObject> = T
interface Repository<Obj extends GitObject = GitObject> extends BaseRepository {
object?: Maybe<Obj>
}
interface Tree<Obj extends GitObject = GitObject> extends BaseTree {
entries?: Maybe<Array<TreeEntry<Obj>>>;
}
interface TreeEntry<Obj extends GitObject = GitObject> extends BaseTreeEntry {
object?: Maybe<Obj>;
}
const callAPI = async ( ) => {
const response = await graphqlWithAuth<{repository: Repository<Tree<Blob>>}>(MY_GITHUB_QUERY)
// Just a dummy example to show this type works just fine.
console.log(response.repository.object?.entries?.[0]?.object?.text)
}
This is sort of verbose, and it'd be lovely if I didn't have to write all these interfaces out.
For maintainers, if you don't find this relevant or something, feel free to just leave a comment and close this, I'm just trying to help! Thanks for your efforts!
Create a TypeScript file foo.ts
with the following code:
import { PullRequestState } from '@octokit/graphql-schema';
const x: PullRequestState = PullRequestState.Merged;
console.log(x === PullRequestState.Merged);
Run tsc foo.ts
which will generate foo.js
.
Run node foo.js
and you will receive the following error:
TypeError: Cannot read property 'Merged' of undefined
As title?
14.3.0
to 14.3.1
.This version is covered by your current version range and after updating it in your project the build failed.
graphql is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Hi,
It looks like the schema is not up-to-date. I see, for example, object ContributionsCollection
does not have a commitContributionsByRepository
field.
I tried running download.js
myself after cloning. The "git diff" operation seems to hang.
It would be great to have Typescript types along with this package.
Hi,
Github graphql recently added 'closeDiscussion' tab where discussions can be closed as OUTDATED, RESOLVED or DUPLICATE. I have a scenario where I need to close the current discussion as resolved or outdated based on reply. I have written this mutation -
mutation closeDiscussion($discussionId: ID!) { closeDiscussion(input: {discussionId: $discussionId, reason: RESOLVED}) { clientMutationId } }
On running npm run codegen, I am getting this error -
GraphQL Document Validation failed with 1 errors; Error 0: Cannot query field "closeDiscussion" on type "Mutation". Did you mean "createDiscussion", "deleteDiscussion", "updat…"
I have updated graphql schema using this command - npm update @octokit/graphql-schema
But graphql-schema is not updated with 'closeDiscussion()'
Could you please help here? Thanks
No response
13.7.0
> [email protected] codegen
> graphql-codegen --config codegen.yml
✔ Parse Configuration
⚠ Generate outputs
❯ Generate to src/generated/graphql.ts
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ GraphQL Document Validation failed with 1 errors;
Error 0: Cannot query field "closeDiscussion" on type "Mutation". Did you mean "createDiscussion", "deleteDiscussion", "updat…
at ......
Branch | Build failing 🚨 |
---|---|
Dependency |
[semantic-release](https://github.com/semantic-release/semantic-release)
|
Current Version | 15.5.5 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 1 commits.
4454d57
feat: allow to disable the publish plugin hook
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
The types and resolvers related to the project (beta) are not available yet in the library. Is it planned to add it ?
To give some context, I am currently building an integration with the new github project and I am using octokit as a client but I would have liked to be able to type my entities correctly with the @octokit/graphql-schema library.
The currently used custom scalar types are all strings, as noted in the comments.
Using unknown
instead of any
would also be the type safe way as described here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.