hey again folks,
I’m excited to announce a new feature I’ve been working on in GraphBrainz (an unofficial GraphQL interface for MusicBrainz). I just posted a prerelease containing a new Extension API, which allows developers to easily extend the GraphBrainz schema and integrate with whatever music-related services they want.
You can use this to add any number of fields to the existing MusicBrainz types, and those fields can pull in data from anywhere. GraphQL will then orchestrate all the fetching from multiple sources and give you a single query response. There are a few built-in extensions to give you an idea of what’s possible:
- The MediaWiki extension finds URL relationships pointing to wiki image pages and retrieves the actual image file URL and properties like the title, description, license, etc.
- The fanart.tv extension lets you retrieve various types of artwork.
- TheAudioDB extension lets you retrieve biographies, images, ratings, music videos, etc.
- Cover Art Archive support is now implemented as an extension.
This whole feature was prompted by my frustration with fetching artist images and such (like those that appear on the MB site) purely from MusicBrainz data. Even if an entity has a relationship with a URL of type “image”, it’s often a Wikimedia Commons page describing the image and not something you can put in <img src={…}>
– that’s why I made the MediaWiki extension and will probably add a WikiData extension soon. Anyway, my frustration is to everyone’s benefit now.
Here’s an example query using the new extensions: let’s get some Tom Petty images and a bio…
query TomPettyImages {
lookup {
artist(mbid: "5ca3f318-d028-4151-ac73-78e2b2d6cdcc") {
name
mediaWikiImages {
url
objectName
descriptionHTML
licenseShortName
}
fanArt {
thumbnails {
url
likeCount
}
}
theAudioDB {
logo
biography
}
}
}
}
(see what happens when you run this query)
If you’re actually interested in any of this, let me know how I can help you try it out!