Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jack0pan/graphql-playground-rails
Mount GraphQL Playground for Rails App
https://github.com/jack0pan/graphql-playground-rails
graphiql graphql graphql-playground graphql-playground-rails ide rails
Last synced: 23 days ago
JSON representation
Mount GraphQL Playground for Rails App
- Host: GitHub
- URL: https://github.com/jack0pan/graphql-playground-rails
- Owner: jack0pan
- License: mit
- Created: 2019-06-25T07:19:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-22T03:28:48.000Z (over 2 years ago)
- Last Synced: 2024-04-25T01:42:07.738Z (7 months ago)
- Topics: graphiql, graphql, graphql-playground, graphql-playground-rails, ide, rails
- Language: Ruby
- Homepage:
- Size: 43.9 KB
- Stars: 6
- Watchers: 0
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: MIT-LICENSE
Awesome Lists containing this project
README
# GraphQL Playground
Mount the [GraphQL Playground](https://github.com/prisma/graphql-playground) in Ruby on Rails.## Requirement
Rails >= 5.2.0## Installation
Add this line to your application's Gemfile:```ruby
gem 'graphql-playground'
```And then execute:
```bash
$ bundle
```Or install it yourself as:
```bash
$ gem install graphql-playground
```
## Usage
### Mount the Engine
Add the engine to routes.rb:```ruby
# config/routes.rb
Rails.application.routes.draw do
# ...
if Rails.env.development?
mount GraphQL::Playground::Engine, at: "/graphql-playground", graphql_path: "/graphql"
end
end
```- at: is the path where GraphQL Playground will be served. You can access GraphQL Playground by visiting that path in your app.
- graphql_path: is the path to the GraphQL endpoint. GraphQL Playground will send queries to this path.If you're using Rails 5 in "API mode", you'll also need to add require "sprockets/railtie" to your application.rb.
## Contributing
Contribution directions go here.## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).