Elm Package API & Github API combined (using GraphQL Schema Stitching)

I completely agree, metrics are inherently imperfect because they answer a shallow question (is this highly starred), and become stand-ins for deeper questions (is this a quality API) (Kahneman talks about this idea of substitution bias). And I really like your thinking about putting the focus on choosing the best API for the task, rather than the one with the best marketing.

I also love how the elm community tends to rally behind projects and make them better, rather than sprouting out tons of competing libraries and approaches. Some variety is useful, but the NPM ecosystem takes it to an extreme that I think many find overwhelming. Overall, I find it to be much easier and more enjoyable to look for good Elm packages compared to looking for good NPM packages.

There are a few tricky things when navigating elm packages that I’ve found. For example, if someone forks and publishes the package, it will show up in the search results (sometimes even above the original, while the fork may become inactive and fall behind). I’ve had that happen before, though fortunately the fork dropped out of the search results after 0.19. And it would be nice if there was a better package discovery story (though 3rd party curated lists could probably fill that gap as well as anything).

The goal of this GraphQL endpoint

This GraphQL API isn’t production-ready because it doesn’t play nicely with Github’s rate limiting policy. It’s more of a fun GraphQL endpoint to play around with, rather than a tool for building a new elm package search. Also, I think that people sometimes don’t realize how easy it is to wrap existing REST APIs (whether they’re 3rd party or internal) with a simple GraphQL interface. I’m biased, but I find it so nice to interface with APIs through GraphQL! :slight_smile: And with schema stitching, you can have a single source of truth for multiple services, which makes that story even more compelling. That makes it much more declarative because you don’t have to think about intermediary states where data is partially loaded as it makes requests for a different service. That was my main goal: to show some fun things you can do with GraphQL, and to show how easy it is!

4 Likes