A fully-featured GraphQL interface for the MusicBrainz API.
MIT License
Bot releases are hidden (Show)
exports
field. No more reaching into graphbrainz/lib
to import various helpers; instead, most helpers are exported from the package root (including everything necessary to implement extensions). The built-in extensions are still available as graphbrainz/extensions/cover-art-archive
, graphbrainz/extensions/fanart-tv
, graphbrainz/extensions/mediawiki
, and graphbrainz/extensions/the-audio-db
.middleware
.createSchema
or createContext
, the extensions
option must contain the already resolved extension objects to apply, rather than the module paths to import. Using module paths with dynamic import()
would require making these functions asynchronous, which was too difficult to work with. You can still supply a list of module names to the GraphBrainz middleware
function, since that can work asynchronously.Client
class now uses got instead of request (which has been deprecated). Extensions subclassing Client
will potentially need to update the options they pass when making calls.Client
are now deprecated. It now uses got’s retry support via the retry
option, and will use got’s defaults if not specified.isrcs
field is null, assume it is because it was not fetched with isrcs
included, and perform a new lookup request to get them. There are likely many other fields suffering from this problem, but it will not be fixed until a large refactor.Promise.all
), limiting the number of null fields and errors returned.Int
to Float
, since Int
only supports 32-bit integers. It turns out people have watched Despacito on YouTube an absurd number of times.
salesCount
, scoreVotes
, viewCount
, likeCount
, dislikeCount
, commentCount
, scoreVotes
.lang
argument in TheAudioDB extension.gql
template tag, which parses them into a GraphQL AST. I didn't use graphql-tag because it currently doesn't support parsing descriptions. Instead I made a very simple tag that just uses graphql.parse()
. This tag is exported as graphbrainz/lib/tag
for any third-party extensions to use. The benefits of using it are ensuring syntactic correctness, allowing syntax highlighting of the schema literal, and allowing Prettier to format them.defaultExtensions
export. This makes it easier to add extensions while keeping the defaults.resolveType
function for Node and Entity would return type instances that had been overwritten by extending the schema. See #49.type
and typeID
fields.start()
function (for starting the standalone server) now accepts options, which it passes along to the middleware. This makes demoing third-party extension modules easier.typeID
field but it wasn't returned by the endpoint that generated the entity, fetch the entity from a lookup. In the future this should be done for all fields, as different endpoints return a mishmash of fields and GraphBrainz should be agnostic of this.updateSchema
feature of graphql-markdown
.deep-diff
dependency.GraphBrainz 7.0.0 is here with amazing new features! (This is the final release of everything added in the recent prereleases. Their release notes are consolidated here for convenience.)
⚠️ This release contains breaking schema changes.
extensions
, specifies the list of extensions to load.GRAPHBRAINZ_EXTENSIONS
, specifies the default list of extensions to load.GRAPHBRAINZ_CORS_ORIGIN
environment variable. The default is to disable CORS.coverArt
field was renamed to coverArtArchive
. This more closely matches the name of the actual field on releases in the MusicBrainz API, and is more consistent with other extensions.schema.json
, output the full result of the introspection query (the top-level data
property) instead of a top-level __schema
field. This makes the schema.json
file compatible with Relay tools like relay-compiler
.darkened
cover art field was removed. This may be re-added in the future.GRAPHBRAINZ_CORS_ORIGIN
environment variable. The default is to disable CORS.schema.json
, output the full result of the introspection query (the top-level data
property) instead of a top-level __schema
field. This makes the schema.json
file compatible with Relay tools like relay-compiler
.⚠️ This release contains breaking schema changes.
Try out this prerelease like so:
$ npm install graphbrainz@next
extensions
, specifies the list of extensions to load.GRAPHBRAINZ_EXTENSIONS
, specifies the default list of extensions to load.coverArt
field was renamed to coverArtArchive
. This more closely matches the name of the actual field on releases in the MusicBrainz API, and is more consistent with other extensions.darkened
cover art field was removed. This may be re-added in the future if there is demand.