Coder Social home page Coder Social logo

nopain1210 / graphql_playground-rails Goto Github PK

View Code? Open in Web Editor NEW

This project forked from papodaca/graphql_playground-rails

0.0 0.0 0.0 56 KB

An engine to provide GraphQL Playground on Rails

Home Page: https://rubygems.org/gems/graphql_playground-rails

License: MIT License

Ruby 47.05% JavaScript 2.38% CSS 1.42% HTML 49.14%

graphql_playground-rails's Introduction

Gem Version

GraphqlPlayground::Rails

A blatant copy of GraphiQL::Rails with much less functionality but with GraphQL Playground instead.

Installation

Add this line to your application's Gemfile:

gem 'graphql_playground-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install graphql_playground-rails

Mount the Engine

Add the engine to routes.rb:

# config/routes.rb
Rails.application.routes.draw do
  # ...
  if Rails.env.development?
    mount GraphqlPlayground::Rails::Engine, at: "/graphql_playground", graphql_path: "/your/endpoint"
  end
end

Configure

# config/initializers/graphql_playground.rb
# All config options have a default that sould work out of the box
GraphqlPlayground::Rails.configure do |config|
  config.headers = {
    'X-Auth-Header' => ->(view_context) { "123" }
  }
  config.title = "Playground"
  config.csrf = true
  config.playground_version = "latest"
  # Ideally the assets would be added to your projects `vendor/assets` directories
  config.favicon = "/assets/playground.ico"
  config.playground_js_url = "/assets/playground.js"
  config.playground_css_url = "/assets/playground.css"
  # see: https://github.com/prisma-labs/graphql-playground#settings
  config.settings = {
    "editor.polling.enable": false
  }
end

Contributing

Submit a PR.

License

The gem is available as open source under the terms of the MIT License.

graphql_playground-rails's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.