Skip to content
Landbnb - An example application implementing a GraphQL API in Rails
Ruby HTML JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db
lib
log
public
spec
tmp
vendor
.gitignore
.rspec
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
package.json

README.md

Landbnb

This is an example Rails application which implements a GraphQL API.

Installation

After cloning the repository, run the following commands:

  • bundle install
  • bundle exec rails db:create
  • bundle exec rails db:migrate
  • bundle exec rake db:seed

The last command will provide you with some sample data to play around with.

You also need to create a .env file in the root of the project that contains a JWT_TOKEN entry for your user.

  • Create a .env file in the root of the project.
  • rails console
  • AuthToken.token(User.last)
  • Use the token that is output and create a JWT_TOKEN entry in the .env file.

Development

Start the Rails app with rails server and you can visit http://localhost:3000/graphiql to explore the API locally.

Requests requiring authentication

Both the createUser and signInUser mutations return a token field. This is a JWT token which should be submitted in all subsequent requests in the format:

Authentication: bearer TOKEN_HERE

You can’t perform that action at this time.