Skip to content

Instantly share code, notes, and snippets.

@ghorbanzade
Created November 22, 2019 08:08
Show Gist options
  • Save ghorbanzade/284f5167279f40a94264330f2af6bbba to your computer and use it in GitHub Desktop.
Save ghorbanzade/284f5167279f40a94264330f2af6bbba to your computer and use it in GitHub Desktop.
registryPackagesForQuery and deletePackageVersion
curl -X POST \
-H "Accept: application/vnd.github.package-deletes-preview+json" \
-H "Authorization: bearer <PERSONAL_ACCESS_TOKEN>" \
-d '{"query":"mutation { deletePackageVersion(input:{packageVersionId:\"<PACKAGE_VERSION>\"}) { success }}"}' \
https://api.github.com/graphql
curl -X POST \
-H "Authorization: bearer <ACCESS_TOKEN>" \
-H "Accept: application/vnd.github.packages-preview+json" \
-d '{"query": "{user(login: \"<USERNAME>\") { registryPackagesForQuery(packageType: DOCKER, first: 100) { edges { node { name id versions(first: 100) { nodes {id} } } } } } }"}' \
https://api.github.com/graphql
@affemaen
Copy link

affemaen commented Jun 22, 2020

Changes scheduled for 2020-04-01
Breaking A change will be made to Organization.registryPackagesForQuery.

Description: registryPackagesForQuery will be removed. Use the PackageSearch object instead.

Reason: Renaming GitHub Packages fields and objects.

Github Breaking Changes

Does anyone have the updated query?

@kmikko
Copy link

kmikko commented Jul 30, 2020

Try

{"query": "{user(login: \"<USERNAME>\") { packages(packageType: DOCKER, first: 100) { edges { node { name id versions(first: 100) { nodes {id version} } } } } } }"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment