An initial repo to build out basic GraphQL functionality in Ruby on Rails!
I've been a big fan of Apollo for a while now so I've been following this tutorial which adds Taylor Swift queries and mutations to a rails endpoint.
Following on from that I wanted to wrap GraphQL around some of my existing RESTful API endpoints. With the intention of securing them up a little more (even though they're all on free tiers) and expanding out to other APIs (e.g. Github, PSN, Spotify) to have a single GraphQL service for ME!
There are some conditional Queries and Mutations based on available environment variables. These are typically token based but some are URLs too to obfuscate accessible endpoints.
This service utilises dotenv-rails
for dev and test so just pop the ones you want in /.env
otherwise set them in your preferred hosting provider.
PODCAST_URL
- URL for the hosted instance of this RESTful RSS-based podcast collator
CURRENCY_API_KEY
- an API key for Fixer currency converter
- Link to my latest activities on Github using their API
- Link up to recent plays using Spotifys API
- Trickier but having a link to gameplay on my PSN account would be cool. Might need to spin up a separate REST API using this community driven npm package 😬
I've never been much of a lover of GraphiQL interface, so I use the Apollo sandbox whenever I need to do a little digging. Just add the localhost URL to the top and BAM it'll load it in.
The docs and guides here have been a constant stream of help