I have a very simple GraphQL server running that grabs packages from the Elm Package API (i.e. the endpoint that gives you search results at https://package.elm-lang.org).
You can try some queries in this interactive GraphQL playground here.
Here’s an example query using this Elm Package GraphQL API. Notice that it jumps from data in the Elm Package API (package name) to data in the Github API (stargazer count):
It connects up these two APIs using GraphQL Schema stitching, which is effectively like a SQL join, but between two APIs rather than two DB tables.
This is just a fun example that I use in my elm-graphql
workshop. I hope you enjoy playing around with it! If you haven’t seen GraphQL in action, you can open the query playground and you’ll get autocompletion and error highlighting to help guide you toward building up your first query. This is a nice introduction if you want to read a little more about the basics: https://graphql.org/learn/
Github API Rate Limiting
I’m running this with the token for a Github account I created. The rate limiting policy doesn’t play nicely with some of these queries, so if it gets blocked you can just use your own Github token in a fork of my sandbox. Or you can just check out the code and tweak it for fun if you’d like, too!
Querying From Elm
And if you’re so inclined, you can point the elm-graphql
code generator CLI to https://vxw01.sse.codesandbox.io/graphql and then start making some type-safe queries against the API from elm!
Let me know what you think if you end up trying it out!