'Where can I find out type changes in GitHub's GraphQL Api
Recently a script I had written to archive/unarchive repos stopped working. The relevant part of the script used this graphql:
mutation ArchiveRepository($mutationId: String!, $repoID: String!) {
archiveRepository(input: {
clientMutationId: $mutationId,
repositoryId: $repoID
})
{
repository {
isArchived
}
}
}
This had worked for months without any code changes. It last worked on 2022-02-24 and first failed on 2022-03-02, with this error:
{
"errors": [{
"path": [
"mutation ArchiveRepository",
"archiveRepository",
"input",
"repositoryId"
],
"extensions": {
"code": "variableMismatch",
"variableName": "repoID",
"typeName": "String!",
"argumentName": "repositoryId",
"errorMessage": "Type mismatch"
}, "locations": [{
"line": 4,
"column": 9
}],
"message": "Type mismatch on variable $repoID and argument repositoryId (String! / ID!)"
}]
}
Changing the type of the mutation:
- mutation ArchiveRepository($mutationId: String!, $repoID: String!) {
+ mutation ArchiveRepository($mutationId: String!, $repoID: ID!) {
Resolved the problem.
So, empirically, there was an backwards incompatible API change that took effect between those two dates. However, I'm unable to find where it's documented. GitHub is normally very good about documenting their changes, which makes this suspicious.
GitHub announces breaking changes ahead of time and retains a historical changelog as well.
Is this change documented any official place (either in GitHub's own documentation that I missed, or in a the documentation for an underlying system such as GraphQL specs or libraries that GitHub uses)?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
