Rails is really great for building quick APIs out of the box. In this drill, we'll be implementing a couple of standards and GraphQL.
CompanyAPI is the new hotness in Silicon Valley. The founders of the company Mike & Jim have a great idea to disrupt LinkedIn by creating a free REST JSON Api that stores important data provided by companies throughout the country. The founders don't know how to code and have no money but fortunately they have you to do all of the work.
- setup ruby & rails (>5)
- run
bundle install
- run
rake db:setup
- inspect the schema
or
Try my repl.it setup for this exercise
- Visit PairColumbus-Build-An-API
- Fork the environment (which makes a copy for yourself)
- Click the
Start
button - Send a request to your custom URL found in the top box on the right-hand side of the screen
- (Task #1) implement a standard (see below)
- (Task #2) convert your standard to graphql
"Hey would you mind adding the various addresses a company might have in the api response? Customers are upset that they can't find out where any of the companies are located or even who works there."
- Mike & Jim
- what are some best practices for building api's?
- try implementing 1-2 key things missing in this api
- http://jsonapi.org/
- https://github.com/WhiteHouse/api-standards
- https://labs.omniti.com/labs/jsend
- https://google.github.io/styleguide/jsoncstyleguide.xml
- graphql
- graphql-ruby: a ruby library for building graphql apis
- graphql-js: a js library for building graphql apis
- graphiql: an interactive in-browser IDE
- Article with a lot of great GraphQL info