graphql_playground-rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7ea42c2cf211c96d1a91e622883708277786b49c
4
+ data.tar.gz: c8c68c1063964f9b32a260ec4ce1070fe898a2dc
5
+ SHA512:
6
+ metadata.gz: 1f85bccf3def8c63e1655cb709d7f12d41c9ee791690212793c2e9a799097bd6b6793cb87d8d104ee7ce6ad8d35d462afacf25563778024380868c45b5d1f4fe
7
+ data.tar.gz: af5feea1ec0dcbc301568710c4cfa473163e32ac00867dbdcb2c56f00f6df1e3599ccdd89828bb0606b34cd6886e5c2a57de917681a0427519802e39e7fdbf77
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2018 Ethan Apodaca
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # GraphqlPlayground::Rails
2
+ A blatant copy of [GraphiQL::Rails](https://github.com/rmosolgo/graphiql-rails) with much less functionality but with [GraphQL Playground](https://github.com/graphcool/graphql-playground) instead.
3
+
4
+ ## Installation
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'graphql_playground-rails'
9
+ ```
10
+
11
+ And then execute:
12
+ ```bash
13
+ $ bundle
14
+ ```
15
+
16
+ Or install it yourself as:
17
+ ```bash
18
+ $ gem install graphql_playground-rails
19
+ ```
20
+
21
+ ### Mount the Engine
22
+
23
+ Add the engine to `routes.rb`:
24
+
25
+ ```ruby
26
+ # config/routes.rb
27
+ Rails.application.routes.draw do
28
+ # ...
29
+ if Rails.env.development?
30
+ mount GraphqlPlayground::Rails::Engine, at: "/graphiql", graphql_path: "/your/endpoint"
31
+ end
32
+ end
33
+ ```
34
+
35
+ ## Contributing
36
+ Contribution directions go here.
37
+
38
+ ## License
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'GraphqlPlayground::Rails'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+ load 'rails/tasks/statistics.rake'
21
+
22
+ require 'bundler/gem_tasks'
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'test'
28
+ t.pattern = 'test/**/*_test.rb'
29
+ t.verbose = false
30
+ end
31
+
32
+ task default: :test
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/graphql_playground/rails .js
2
+ //= link_directory ../stylesheets/graphql_playground/rails .css
@@ -0,0 +1,4 @@
1
+ /*
2
+ *= require_tree .
3
+ *= require_self
4
+ */
@@ -0,0 +1,464 @@
1
+ html {
2
+ font-family: "Open Sans", sans-serif;
3
+ overflow: hidden;
4
+ }
5
+
6
+ body {
7
+ margin: 0;
8
+ background: #172a3a;
9
+ }
10
+
11
+ .playgroundIn {
12
+ -webkit-animation: playgroundIn 0.5s ease-out forwards;
13
+ animation: playgroundIn 0.5s ease-out forwards;
14
+ }
15
+
16
+ @-webkit-keyframes playgroundIn {
17
+ from {
18
+ opacity: 0;
19
+ -webkit-transform: translateY(10px);
20
+ -ms-transform: translateY(10px);
21
+ transform: translateY(10px);
22
+ }
23
+ to {
24
+ opacity: 1;
25
+ -webkit-transform: translateY(0);
26
+ -ms-transform: translateY(0);
27
+ transform: translateY(0);
28
+ }
29
+ }
30
+
31
+ @keyframes playgroundIn {
32
+ from {
33
+ opacity: 0;
34
+ -webkit-transform: translateY(10px);
35
+ -ms-transform: translateY(10px);
36
+ transform: translateY(10px);
37
+ }
38
+ to {
39
+ opacity: 1;
40
+ -webkit-transform: translateY(0);
41
+ -ms-transform: translateY(0);
42
+ transform: translateY(0);
43
+ }
44
+ }
45
+
46
+ .fadeOut {
47
+ -webkit-animation: fadeOut 0.5s ease-out forwards;
48
+ animation: fadeOut 0.5s ease-out forwards;
49
+ }
50
+
51
+ @-webkit-keyframes fadeIn {
52
+ from {
53
+ opacity: 0;
54
+ -webkit-transform: translateY(-10px);
55
+ -ms-transform: translateY(-10px);
56
+ transform: translateY(-10px);
57
+ }
58
+ to {
59
+ opacity: 1;
60
+ -webkit-transform: translateY(0);
61
+ -ms-transform: translateY(0);
62
+ transform: translateY(0);
63
+ }
64
+ }
65
+
66
+ @keyframes fadeIn {
67
+ from {
68
+ opacity: 0;
69
+ -webkit-transform: translateY(-10px);
70
+ -ms-transform: translateY(-10px);
71
+ transform: translateY(-10px);
72
+ }
73
+ to {
74
+ opacity: 1;
75
+ -webkit-transform: translateY(0);
76
+ -ms-transform: translateY(0);
77
+ transform: translateY(0);
78
+ }
79
+ }
80
+
81
+ @-webkit-keyframes fadeOut {
82
+ from {
83
+ opacity: 1;
84
+ -webkit-transform: translateY(0);
85
+ -ms-transform: translateY(0);
86
+ transform: translateY(0);
87
+ }
88
+ to {
89
+ opacity: 0;
90
+ -webkit-transform: translateY(-10px);
91
+ -ms-transform: translateY(-10px);
92
+ transform: translateY(-10px);
93
+ }
94
+ }
95
+
96
+ @keyframes fadeOut {
97
+ from {
98
+ opacity: 1;
99
+ -webkit-transform: translateY(0);
100
+ -ms-transform: translateY(0);
101
+ transform: translateY(0);
102
+ }
103
+ to {
104
+ opacity: 0;
105
+ -webkit-transform: translateY(-10px);
106
+ -ms-transform: translateY(-10px);
107
+ transform: translateY(-10px);
108
+ }
109
+ }
110
+
111
+ @-webkit-keyframes appearIn {
112
+ from {
113
+ opacity: 0;
114
+ -webkit-transform: translateY(0px);
115
+ -ms-transform: translateY(0px);
116
+ transform: translateY(0px);
117
+ }
118
+ to {
119
+ opacity: 1;
120
+ -webkit-transform: translateY(0);
121
+ -ms-transform: translateY(0);
122
+ transform: translateY(0);
123
+ }
124
+ }
125
+
126
+ @keyframes appearIn {
127
+ from {
128
+ opacity: 0;
129
+ -webkit-transform: translateY(0px);
130
+ -ms-transform: translateY(0px);
131
+ transform: translateY(0px);
132
+ }
133
+ to {
134
+ opacity: 1;
135
+ -webkit-transform: translateY(0);
136
+ -ms-transform: translateY(0);
137
+ transform: translateY(0);
138
+ }
139
+ }
140
+
141
+ @-webkit-keyframes scaleIn {
142
+ from {
143
+ -webkit-transform: scale(0);
144
+ -ms-transform: scale(0);
145
+ transform: scale(0);
146
+ }
147
+ to {
148
+ -webkit-transform: scale(1);
149
+ -ms-transform: scale(1);
150
+ transform: scale(1);
151
+ }
152
+ }
153
+
154
+ @keyframes scaleIn {
155
+ from {
156
+ -webkit-transform: scale(0);
157
+ -ms-transform: scale(0);
158
+ transform: scale(0);
159
+ }
160
+ to {
161
+ -webkit-transform: scale(1);
162
+ -ms-transform: scale(1);
163
+ transform: scale(1);
164
+ }
165
+ }
166
+
167
+ @-webkit-keyframes innerDrawIn {
168
+ 0% {
169
+ stroke-dashoffset: 70;
170
+ }
171
+ 50% {
172
+ stroke-dashoffset: 140;
173
+ }
174
+ 100% {
175
+ stroke-dashoffset: 210;
176
+ }
177
+ }
178
+
179
+ @keyframes innerDrawIn {
180
+ 0% {
181
+ stroke-dashoffset: 70;
182
+ }
183
+ 50% {
184
+ stroke-dashoffset: 140;
185
+ }
186
+ 100% {
187
+ stroke-dashoffset: 210;
188
+ }
189
+ }
190
+
191
+ @-webkit-keyframes outerDrawIn {
192
+ 0% {
193
+ stroke-dashoffset: 76;
194
+ }
195
+ 100% {
196
+ stroke-dashoffset: 152;
197
+ }
198
+ }
199
+
200
+ @keyframes outerDrawIn {
201
+ 0% {
202
+ stroke-dashoffset: 76;
203
+ }
204
+ 100% {
205
+ stroke-dashoffset: 152;
206
+ }
207
+ }
208
+
209
+ .hHWjkv {
210
+ -webkit-transform-origin: 0px 0px;
211
+ -ms-transform-origin: 0px 0px;
212
+ transform-origin: 0px 0px;
213
+ -webkit-transform: scale(0);
214
+ -ms-transform: scale(0);
215
+ transform: scale(0);
216
+ -webkit-animation: scaleIn 0.25s linear forwards 0.2222222222222222s;
217
+ animation: scaleIn 0.25s linear forwards 0.2222222222222222s;
218
+ }
219
+
220
+ .gCDOzd {
221
+ -webkit-transform-origin: 0px 0px;
222
+ -ms-transform-origin: 0px 0px;
223
+ transform-origin: 0px 0px;
224
+ -webkit-transform: scale(0);
225
+ -ms-transform: scale(0);
226
+ transform: scale(0);
227
+ -webkit-animation: scaleIn 0.25s linear forwards 0.4222222222222222s;
228
+ animation: scaleIn 0.25s linear forwards 0.4222222222222222s;
229
+ }
230
+
231
+ .hmCcxi {
232
+ -webkit-transform-origin: 0px 0px;
233
+ -ms-transform-origin: 0px 0px;
234
+ transform-origin: 0px 0px;
235
+ -webkit-transform: scale(0);
236
+ -ms-transform: scale(0);
237
+ transform: scale(0);
238
+ -webkit-animation: scaleIn 0.25s linear forwards 0.6222222222222222s;
239
+ animation: scaleIn 0.25s linear forwards 0.6222222222222222s;
240
+ }
241
+
242
+ .eHamQi {
243
+ -webkit-transform-origin: 0px 0px;
244
+ -ms-transform-origin: 0px 0px;
245
+ transform-origin: 0px 0px;
246
+ -webkit-transform: scale(0);
247
+ -ms-transform: scale(0);
248
+ transform: scale(0);
249
+ -webkit-animation: scaleIn 0.25s linear forwards 0.8222222222222223s;
250
+ animation: scaleIn 0.25s linear forwards 0.8222222222222223s;
251
+ }
252
+
253
+ .byhgGu {
254
+ -webkit-transform-origin: 0px 0px;
255
+ -ms-transform-origin: 0px 0px;
256
+ transform-origin: 0px 0px;
257
+ -webkit-transform: scale(0);
258
+ -ms-transform: scale(0);
259
+ transform: scale(0);
260
+ -webkit-animation: scaleIn 0.25s linear forwards 1.0222222222222221s;
261
+ animation: scaleIn 0.25s linear forwards 1.0222222222222221s;
262
+ }
263
+
264
+ .llAKP {
265
+ -webkit-transform-origin: 0px 0px;
266
+ -ms-transform-origin: 0px 0px;
267
+ transform-origin: 0px 0px;
268
+ -webkit-transform: scale(0);
269
+ -ms-transform: scale(0);
270
+ transform: scale(0);
271
+ -webkit-animation: scaleIn 0.25s linear forwards 1.2222222222222223s;
272
+ animation: scaleIn 0.25s linear forwards 1.2222222222222223s;
273
+ }
274
+
275
+ .bglIGM {
276
+ -webkit-transform-origin: 64px 28px;
277
+ -ms-transform-origin: 64px 28px;
278
+ transform-origin: 64px 28px;
279
+ -webkit-transform: scale(0);
280
+ -ms-transform: scale(0);
281
+ transform: scale(0);
282
+ -webkit-animation: scaleIn 0.25s linear forwards 0.2222222222222222s;
283
+ animation: scaleIn 0.25s linear forwards 0.2222222222222222s;
284
+ }
285
+
286
+ .ksxRII {
287
+ -webkit-transform-origin: 95.98500061035156px 46.510000228881836px;
288
+ -ms-transform-origin: 95.98500061035156px 46.510000228881836px;
289
+ transform-origin: 95.98500061035156px 46.510000228881836px;
290
+ -webkit-transform: scale(0);
291
+ -ms-transform: scale(0);
292
+ transform: scale(0);
293
+ -webkit-animation: scaleIn 0.25s linear forwards 0.4222222222222222s;
294
+ animation: scaleIn 0.25s linear forwards 0.4222222222222222s;
295
+ }
296
+
297
+ .cWrBmb {
298
+ -webkit-transform-origin: 95.97162628173828px 83.4900016784668px;
299
+ -ms-transform-origin: 95.97162628173828px 83.4900016784668px;
300
+ transform-origin: 95.97162628173828px 83.4900016784668px;
301
+ -webkit-transform: scale(0);
302
+ -ms-transform: scale(0);
303
+ transform: scale(0);
304
+ -webkit-animation: scaleIn 0.25s linear forwards 0.6222222222222222s;
305
+ animation: scaleIn 0.25s linear forwards 0.6222222222222222s;
306
+ }
307
+
308
+ .Wnusb {
309
+ -webkit-transform-origin: 64px 101.97999572753906px;
310
+ -ms-transform-origin: 64px 101.97999572753906px;
311
+ transform-origin: 64px 101.97999572753906px;
312
+ -webkit-transform: scale(0);
313
+ -ms-transform: scale(0);
314
+ transform: scale(0);
315
+ -webkit-animation: scaleIn 0.25s linear forwards 0.8222222222222223s;
316
+ animation: scaleIn 0.25s linear forwards 0.8222222222222223s;
317
+ }
318
+
319
+ .bfPqf {
320
+ -webkit-transform-origin: 32.03982162475586px 83.4900016784668px;
321
+ -ms-transform-origin: 32.03982162475586px 83.4900016784668px;
322
+ transform-origin: 32.03982162475586px 83.4900016784668px;
323
+ -webkit-transform: scale(0);
324
+ -ms-transform: scale(0);
325
+ transform: scale(0);
326
+ -webkit-animation: scaleIn 0.25s linear forwards 1.0222222222222221s;
327
+ animation: scaleIn 0.25s linear forwards 1.0222222222222221s;
328
+ }
329
+
330
+ .edRCTN {
331
+ -webkit-transform-origin: 32.033552169799805px 46.510000228881836px;
332
+ -ms-transform-origin: 32.033552169799805px 46.510000228881836px;
333
+ transform-origin: 32.033552169799805px 46.510000228881836px;
334
+ -webkit-transform: scale(0);
335
+ -ms-transform: scale(0);
336
+ transform: scale(0);
337
+ -webkit-animation: scaleIn 0.25s linear forwards 1.2222222222222223s;
338
+ animation: scaleIn 0.25s linear forwards 1.2222222222222223s;
339
+ }
340
+
341
+ .iEGVWn {
342
+ opacity: 0;
343
+ stroke-dasharray: 76;
344
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 0.3333333333333333s, appearIn 0.1s ease-out forwards 0.3333333333333333s;
345
+ animation: outerDrawIn 0.5s ease-out forwards 0.3333333333333333s, appearIn 0.1s ease-out forwards 0.3333333333333333s;
346
+ -webkit-animation-iteration-count: 1, 1;
347
+ animation-iteration-count: 1, 1;
348
+ }
349
+
350
+ .bsocdx {
351
+ opacity: 0;
352
+ stroke-dasharray: 76;
353
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 0.5333333333333333s, appearIn 0.1s ease-out forwards 0.5333333333333333s;
354
+ animation: outerDrawIn 0.5s ease-out forwards 0.5333333333333333s, appearIn 0.1s ease-out forwards 0.5333333333333333s;
355
+ -webkit-animation-iteration-count: 1, 1;
356
+ animation-iteration-count: 1, 1;
357
+ }
358
+
359
+ .jAZXmP {
360
+ opacity: 0;
361
+ stroke-dasharray: 76;
362
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 0.7333333333333334s, appearIn 0.1s ease-out forwards 0.7333333333333334s;
363
+ animation: outerDrawIn 0.5s ease-out forwards 0.7333333333333334s, appearIn 0.1s ease-out forwards 0.7333333333333334s;
364
+ -webkit-animation-iteration-count: 1, 1;
365
+ animation-iteration-count: 1, 1;
366
+ }
367
+
368
+ .hSeArx {
369
+ opacity: 0;
370
+ stroke-dasharray: 76;
371
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 0.9333333333333333s, appearIn 0.1s ease-out forwards 0.9333333333333333s;
372
+ animation: outerDrawIn 0.5s ease-out forwards 0.9333333333333333s, appearIn 0.1s ease-out forwards 0.9333333333333333s;
373
+ -webkit-animation-iteration-count: 1, 1;
374
+ animation-iteration-count: 1, 1;
375
+ }
376
+
377
+ .bVgqGk {
378
+ opacity: 0;
379
+ stroke-dasharray: 76;
380
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 1.1333333333333333s, appearIn 0.1s ease-out forwards 1.1333333333333333s;
381
+ animation: outerDrawIn 0.5s ease-out forwards 1.1333333333333333s, appearIn 0.1s ease-out forwards 1.1333333333333333s;
382
+ -webkit-animation-iteration-count: 1, 1;
383
+ animation-iteration-count: 1, 1;
384
+ }
385
+
386
+ .hEFqBt {
387
+ opacity: 0;
388
+ stroke-dasharray: 76;
389
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 1.3333333333333333s, appearIn 0.1s ease-out forwards 1.3333333333333333s;
390
+ animation: outerDrawIn 0.5s ease-out forwards 1.3333333333333333s, appearIn 0.1s ease-out forwards 1.3333333333333333s;
391
+ -webkit-animation-iteration-count: 1, 1;
392
+ animation-iteration-count: 1, 1;
393
+ }
394
+
395
+ .dzEKCM {
396
+ opacity: 0;
397
+ stroke-dasharray: 70;
398
+ -webkit-animation: innerDrawIn 1s ease-in-out forwards 1.3666666666666667s, appearIn 0.1s linear forwards 1.3666666666666667s;
399
+ animation: innerDrawIn 1s ease-in-out forwards 1.3666666666666667s, appearIn 0.1s linear forwards 1.3666666666666667s;
400
+ -webkit-animation-iteration-count: infinite, 1;
401
+ animation-iteration-count: infinite, 1;
402
+ }
403
+
404
+ .DYnPx {
405
+ opacity: 0;
406
+ stroke-dasharray: 70;
407
+ -webkit-animation: innerDrawIn 1s ease-in-out forwards 1.5333333333333332s, appearIn 0.1s linear forwards 1.5333333333333332s;
408
+ animation: innerDrawIn 1s ease-in-out forwards 1.5333333333333332s, appearIn 0.1s linear forwards 1.5333333333333332s;
409
+ -webkit-animation-iteration-count: infinite, 1;
410
+ animation-iteration-count: infinite, 1;
411
+ }
412
+
413
+ .hjPEAQ {
414
+ opacity: 0;
415
+ stroke-dasharray: 70;
416
+ -webkit-animation: innerDrawIn 1s ease-in-out forwards 1.7000000000000002s, appearIn 0.1s linear forwards 1.7000000000000002s;
417
+ animation: innerDrawIn 1s ease-in-out forwards 1.7000000000000002s, appearIn 0.1s linear forwards 1.7000000000000002s;
418
+ -webkit-animation-iteration-count: infinite, 1;
419
+ animation-iteration-count: infinite, 1;
420
+ }
421
+
422
+ #loading-wrapper {
423
+ position: absolute;
424
+ width: 100vw;
425
+ height: 100vh;
426
+ display: -webkit-box;
427
+ display: -webkit-flex;
428
+ display: -ms-flexbox;
429
+ display: flex;
430
+ -webkit-align-items: center;
431
+ -webkit-box-align: center;
432
+ -ms-flex-align: center;
433
+ align-items: center;
434
+ -webkit-box-pack: center;
435
+ -webkit-justify-content: center;
436
+ -ms-flex-pack: center;
437
+ justify-content: center;
438
+ -webkit-flex-direction: column;
439
+ -ms-flex-direction: column;
440
+ flex-direction: column;
441
+ }
442
+
443
+ .logo {
444
+ width: 75px;
445
+ height: 75px;
446
+ margin-bottom: 20px;
447
+ opacity: 0;
448
+ -webkit-animation: fadeIn 0.5s ease-out forwards;
449
+ animation: fadeIn 0.5s ease-out forwards;
450
+ }
451
+
452
+ .text {
453
+ font-size: 32px;
454
+ font-weight: 200;
455
+ text-align: center;
456
+ color: rgba(255, 255, 255, 0.6);
457
+ opacity: 0;
458
+ -webkit-animation: fadeIn 0.5s ease-out forwards;
459
+ animation: fadeIn 0.5s ease-out forwards;
460
+ }
461
+
462
+ .dGfHfc {
463
+ font-weight: 400;
464
+ }
@@ -0,0 +1,20 @@
1
+ module GraphqlPlayground
2
+ module Rails
3
+ class ApplicationController < ActionController::Base
4
+ protect_from_forgery with: :exception
5
+
6
+ def index
7
+ end
8
+
9
+ helper_method :get_endpoint_url
10
+ def get_endpoint_url
11
+ params[:graphql_path] || raise(%|You must include `graphql_path: "/my/endpoint"` when mounting GraphqlPlayground::Rails::Engine|)
12
+ end
13
+
14
+ helper_method :get_playground_version
15
+ def get_playground_version
16
+ GraphqlPlayground::Rails::PLAYGROUND_VERSION
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,6 @@
1
+ module GraphqlPlayground
2
+ module Rails
3
+ module ApplicationHelper
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module GraphqlPlayground
2
+ module Rails
3
+ class ApplicationJob < ActiveJob::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ module GraphqlPlayground
2
+ module Rails
3
+ class ApplicationMailer < ActionMailer::Base
4
+ default from: 'from@example.com'
5
+ layout 'mailer'
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module GraphqlPlayground
2
+ module Rails
3
+ class ApplicationRecord < ActiveRecord::Base
4
+ self.abstract_class = true
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,54 @@
1
+ <div id="loading-wrapper">
2
+ <svg class="logo" viewBox="0 0 128 128" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>GraphQL Playground Logo</title>
4
+ <defs>
5
+ <linearGradient id="linearGradient-1" x1="4.86%" x2="96.21%" y1="0%" y2="99.66%">
6
+ <stop stop-color="#E00082" stop-opacity=".8" offset="0%"></stop>
7
+ <stop stop-color="#E00082" offset="100%"></stop>
8
+ </linearGradient>
9
+ </defs>
10
+ <g>
11
+ <rect id="Gradient" width="127.96" height="127.96" y="1" fill="url(#linearGradient-1)" rx="4"></rect>
12
+ <path id="Border" fill="#E00082" fill-rule="nonzero" d="M4.7 2.84c-1.58 0-2.86 1.28-2.86 2.85v116.57c0 1.57 1.28 2.84 2.85 2.84h116.57c1.57 0 2.84-1.26 2.84-2.83V5.67c0-1.55-1.26-2.83-2.83-2.83H4.67zM4.7 0h116.58c3.14 0 5.68 2.55 5.68 5.7v116.58c0 3.14-2.54 5.68-5.68 5.68H4.68c-3.13 0-5.68-2.54-5.68-5.68V5.68C-1 2.56 1.55 0 4.7 0z"></path>
13
+ <path class="bglIGM" x="64" y="28" fill="#fff" d="M64 36c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8" style="transform: translate(100px, 100px);"></path>
14
+ <path class="ksxRII" x="95.98500061035156" y="46.510000228881836" fill="#fff" d="M89.04 50.52c-2.2-3.84-.9-8.73 2.94-10.96 3.83-2.2 8.72-.9 10.95 2.94 2.2 3.84.9 8.73-2.94 10.96-3.85 2.2-8.76.9-10.97-2.94"
15
+ style="transform: translate(100px, 100px);"></path>
16
+ <path class="cWrBmb" x="95.97162628173828" y="83.4900016784668" fill="#fff" d="M102.9 87.5c-2.2 3.84-7.1 5.15-10.94 2.94-3.84-2.2-5.14-7.12-2.94-10.96 2.2-3.84 7.12-5.15 10.95-2.94 3.86 2.23 5.16 7.12 2.94 10.96"
17
+ style="transform: translate(100px, 100px);"></path>
18
+ <path class="Wnusb" x="64" y="101.97999572753906" fill="#fff" d="M64 110c-4.43 0-8-3.6-8-8.02 0-4.44 3.57-8.02 8-8.02s8 3.58 8 8.02c0 4.4-3.57 8.02-8 8.02"
19
+ style="transform: translate(100px, 100px);"></path>
20
+ <path class="bfPqf" x="32.03982162475586" y="83.4900016784668" fill="#fff" d="M25.1 87.5c-2.2-3.84-.9-8.73 2.93-10.96 3.83-2.2 8.72-.9 10.95 2.94 2.2 3.84.9 8.73-2.94 10.96-3.85 2.2-8.74.9-10.95-2.94"
21
+ style="transform: translate(100px, 100px);"></path>
22
+ <path class="edRCTN" x="32.033552169799805" y="46.510000228881836" fill="#fff" d="M38.96 50.52c-2.2 3.84-7.12 5.15-10.95 2.94-3.82-2.2-5.12-7.12-2.92-10.96 2.2-3.84 7.12-5.15 10.95-2.94 3.83 2.23 5.14 7.12 2.94 10.96"
23
+ style="transform: translate(100px, 100px);"></path>
24
+ <path class="iEGVWn" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M63.55 27.5l32.9 19-32.9-19z"></path>
25
+ <path class="bsocdx" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M96 46v38-38z"></path>
26
+ <path class="jAZXmP" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M96.45 84.5l-32.9 19 32.9-19z"></path>
27
+ <path class="hSeArx" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M64.45 103.5l-32.9-19 32.9 19z"></path>
28
+ <path class="bVgqGk" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M32 84V46v38z"></path>
29
+ <path class="hEFqBt" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M31.55 46.5l32.9-19-32.9 19z"></path>
30
+ <path class="dzEKCM" id="Triangle-Bottom" stroke="#fff" stroke-width="4" d="M30 84h70" stroke-linecap="round"></path>
31
+ <path class="DYnPx" id="Triangle-Left" stroke="#fff" stroke-width="4" d="M65 26L30 87" stroke-linecap="round"></path>
32
+ <path class="hjPEAQ" id="Triangle-Right" stroke="#fff" stroke-width="4" d="M98 87L63 26" stroke-linecap="round"></path>
33
+ </g>
34
+ </svg>
35
+ <div class="text">Loading
36
+ <span class="dGfHfc">GraphQL Playground</span>
37
+ </div>
38
+ </div>
39
+ <div id="root" ></div>
40
+ <script type="text/javascript">
41
+ window.addEventListener('load', function (event) {
42
+ const loadingWrapper = document.getElementById('loading-wrapper');
43
+ if (loadingWrapper) {
44
+ loadingWrapper.classList.add('fadeOut');
45
+ }
46
+ const root = document.getElementById('root');
47
+ root.classList.add('playgroundIn');
48
+
49
+ GraphQLPlayground.init(root, {
50
+ "endpoint": "<%= get_endpoint_url %>",
51
+ "canSaveConfig": false
52
+ });
53
+ });
54
+ </script>
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <%= csrf_meta_tags %>
5
+ <%= csp_meta_tag %>
6
+ <meta charset=utf-8 />
7
+ <meta name="viewport" content="user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui">
8
+ <link rel="shortcut icon" href="https://graphcool-playground.netlify.com/favicon.png">
9
+ <title>GraphQL Playground</title>
10
+
11
+ <%= stylesheet_link_tag "graphql_playground/rails/application", media: "all" %>
12
+ <%= javascript_include_tag "graphql_playground/rails/application" %>
13
+
14
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/graphql-playground-react@<%= get_playground_version %>/build/static/css/index.css" />
15
+ <link rel="shortcut icon" href="//cdn.jsdelivr.net/npm/graphql-playground-react@<%= get_playground_version %>/build/favicon.png" />
16
+ <script src="//cdn.jsdelivr.net/npm/graphql-playground-react@<%= get_playground_version %>/build/static/js/middleware.js"></script>
17
+ </head>
18
+ <body>
19
+ <%= yield %>
20
+ </body>
21
+ </html>
@@ -0,0 +1,3 @@
1
+ GraphqlPlayground::Rails::Engine.routes.draw do
2
+ get "/" => "application#index"
3
+ end
@@ -0,0 +1,8 @@
1
+ require "graphql_playground/rails/engine"
2
+ require "graphql_playground/rails/version"
3
+
4
+ module GraphqlPlayground
5
+ module Rails
6
+ # Your code goes here...
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module GraphqlPlayground
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace GraphqlPlayground::Rails
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ module GraphqlPlayground
2
+ module Rails
3
+ VERSION = '1.0.0'
4
+ PLAYGROUND_VERSION = '1.5.6'
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :graphql_playground_rails do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: graphql_playground-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ethan Apodaca
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-04-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.1'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 5.1.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '5.1'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 5.1.0
33
+ description: GraphQL Playground provides a UI similar to GraphiQL with more features
34
+ email:
35
+ - papodaca@gmail.com
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - LICENSE
41
+ - README.md
42
+ - Rakefile
43
+ - app/assets/config/graphql_playground_rails_manifest.js
44
+ - app/assets/javascripts/graphql_playground/rails/application.js
45
+ - app/assets/stylesheets/graphql_playground/rails/application.css
46
+ - app/assets/stylesheets/graphql_playground/rails/graphql_playground.css
47
+ - app/controllers/graphql_playground/rails/application_controller.rb
48
+ - app/helpers/graphql_playground/rails/application_helper.rb
49
+ - app/jobs/graphql_playground/rails/application_job.rb
50
+ - app/mailers/graphql_playground/rails/application_mailer.rb
51
+ - app/models/graphql_playground/rails/application_record.rb
52
+ - app/views/graphql_playground/rails/application/index.html.erb
53
+ - app/views/layouts/graphql_playground/rails/application.html.erb
54
+ - config/routes.rb
55
+ - lib/graphql_playground/rails.rb
56
+ - lib/graphql_playground/rails/engine.rb
57
+ - lib/graphql_playground/rails/version.rb
58
+ - lib/tasks/graphql_playground/rails_tasks.rake
59
+ homepage: https://github.com/papodaca/graphql_playground-rails
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.6.11
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: An engine to provide the GraphQL Playground
83
+ test_files: []