I have been trying to get the open graph images from my repositories through the GraphQL API that GitHub exposes, but I always get my avatar back. I have tried querying the repositories node, the search, and the user node to no avail.
For example, for the query:
query {
repository(name: "rust-algorithms", owner: "alexfertel") {
openGraphImageUrl
nameWithOwner
}
}
I get:
"repository": {
"openGraphImageUrl": "https://avatars.githubusercontent.com/u/22298999?s=400&v=4",
"nameWithOwner": "alexfertel/rust-algorithms"
},
Which you can tell gives an avatar and not the open graph image generated by GitHub for the repository.
Is there a way to get this image that doesn't involve scraping GitHub?