exogen / graphbrainz

A fully-featured GraphQL interface for the MusicBrainz API.
MIT License
162 stars 31 forks source link

Potential expansion to be less MusicBrainz-centric #79

Open exogen opened 6 years ago

exogen commented 6 years ago

Currently, most of the extensions depend on being attached to a particular MusicBrainz entity, and don't offer many of their own fields on the root Query.

I'm considering rebranding this project to something like "MusiQL", which would be very similar, but not MusicBrainz-centric. Most of the existing queries would work exactly the same, but be under a musicBrainz field on the root query.

lukehedger commented 5 years ago

What are your latest thoughts on this @exogen? Would be interested to collaborate in some way if you are still planning to move to the MusiQL model.

exogen commented 5 years ago

Great question, it is still in the works and I would love to collaborate! I have a bunch of preliminary code written laying things out, but not in a state to push up yet.

Here is a rough outline of my latest thinking:

exogen commented 5 years ago

Timely article: https://www.prisma.io/blog/the-problems-of-schema-first-graphql-development-x1mn4cb0tyl3

lukehedger commented 5 years ago

That article certainly hits the nail on the head when it comes to schema-first. Had not seen graphql-nexus before but I think that approach is definitely the way to go. Prisma also seem to hint they will be introducing a similar tool next week 🤞 (EDIT: Looks like it is now https://github.com/prisma/nexus).

In general, I wonder if it makes sense to move to a schema/API that abstracts the sources away from the user? So, the API would just expose top-level entities like artists, tracks, releases etc etc (essentially, promoting the browse query fields and retaining MusicBrainz,'s ontology), as well as search. The response fields would be an amalgamation of available data from MusicBrainz, LastFM, Spotify and the extensions. Over time more sources could be added that augment the top-level entities without changing the API - the user just gets richer data.

The way search is designed right now feels flexible enough to support different use cases (eg. single entity and mixed entity searches), whereas the enum approach might be a bit restrictive I guess.

Agree on the monorepo too but not sure I understand enough about how the extensions work to comment on that!