Socket
Book a DemoInstallSign in
Socket

graphql_playground

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql_playground

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

This gem is a simple middleware wrapper for GraphQL Playground, a GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).

gem install graphql_playground

Usage

If you use rack, you can mount it like this

require 'graphql_playground'

map '/playground' do
  use GraphQLPlayground, endpoint: '/graphql' # endpoint to your graphql server endpoint
end

Example using graphql_server gem

# app.ru
require 'graphql_playground'
require 'graphql_server'

type_def = <<-GRAPHQL
  type Query {
    hello: String
  }
GRAPHQL

resolver = {
  "Query" => {
    "hello" => Proc.new { "world" }
  }
}

map '/playground' do
  use GraphQLPlayground
end

run GraphqlServer.new(type_def: type_def, resolver: resolver)

Launch it with

rackup app.ru

And then open http://localhost:9292/playground

(Reference https://github.com/betaflag/graphql-server-ruby)

FAQs

Package last updated on 21 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.