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)?
Yes you are right, looks like this was missed in the change log. You can raise a GitHub issue.
This particular Mutation docs reference is auto generated from the code I think ArchiveRepositoryInput
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With