graphql-playground 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8b041ed5e124d7f1e8dceb0626368de67cea3a6d1b31c1e4dcdcd2a42524aed9
4
+ data.tar.gz: da7d67a6569e4d827f5947347332fa8d022c01bf04a25c23996de05132861fbb
5
+ SHA512:
6
+ metadata.gz: 96c9089a20ee91fe204d49d087a753df877c29abc337f14bd62935d1762b75d6d21e3e9e93198f5ba7848889782ca002d4b86ce6e57d115b7cc047bfe676fc5d
7
+ data.tar.gz: 06cc2de36ad0dcb6450ea62b7e068c66cfe0d8afb67f09e18a1cc0508906ad8d41788734c6c450c7c6907d13a245eb9a896c8619309161d170c73f9376116259
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2019 Pan Jie
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.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # GraphQL Playground
2
+ Mount the (GraphQL Playground)[https://github.com/prisma/graphql-playground] in Ruby on Rails.
3
+
4
+ ## Installation
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'graphql-playground'
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
19
+ ```
20
+ ## Usage
21
+ ### Mount the Engine
22
+ Add the engine to routes.rb:
23
+
24
+ ```ruby
25
+ # config/routes.rb
26
+ Rails.application.routes.draw do
27
+ # ...
28
+ if Rails.env.development?
29
+ mount GraphQL::Playground::Engine, at: "/graphql-playground", graphql_path: "/graphql"
30
+ end
31
+ end
32
+ ```
33
+
34
+ - at: is the path where GraphiQL will be served. You can access GraphiQL by visiting that path in your app.
35
+ - graphql_path: is the path to the GraphQL endpoint. GraphiQL will send queries to this path.
36
+
37
+ If you're using Rails 5 in "API mode", you'll also need to add require "sprockets/railtie" to your application.rb.
38
+
39
+ ## Contributing
40
+ Contribution directions go here.
41
+
42
+ ## License
43
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -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 = 'GraphQL::Playground'
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 .js
2
+ //= link_directory ../stylesheets/graphql/playground .css
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ // require activestorage
14
+ //= require rails-ujs
15
+ //= require_tree .
@@ -0,0 +1,480 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
16
+
17
+ html {
18
+ font-family: "Open Sans", sans-serif;
19
+ overflow: hidden;
20
+ }
21
+
22
+ body {
23
+ margin: 0;
24
+ background: #172a3a;
25
+ }
26
+
27
+ .playgroundIn {
28
+ -webkit-animation: playgroundIn 0.5s ease-out forwards;
29
+ animation: playgroundIn 0.5s ease-out forwards;
30
+ }
31
+
32
+ @-webkit-keyframes playgroundIn {
33
+ from {
34
+ opacity: 0;
35
+ -webkit-transform: translateY(10px);
36
+ -ms-transform: translateY(10px);
37
+ transform: translateY(10px);
38
+ }
39
+ to {
40
+ opacity: 1;
41
+ -webkit-transform: translateY(0);
42
+ -ms-transform: translateY(0);
43
+ transform: translateY(0);
44
+ }
45
+ }
46
+
47
+ @keyframes playgroundIn {
48
+ from {
49
+ opacity: 0;
50
+ -webkit-transform: translateY(10px);
51
+ -ms-transform: translateY(10px);
52
+ transform: translateY(10px);
53
+ }
54
+ to {
55
+ opacity: 1;
56
+ -webkit-transform: translateY(0);
57
+ -ms-transform: translateY(0);
58
+ transform: translateY(0);
59
+ }
60
+ }
61
+
62
+ .fadeOut {
63
+ -webkit-animation: fadeOut 0.5s ease-out forwards;
64
+ animation: fadeOut 0.5s ease-out forwards;
65
+ }
66
+
67
+ @-webkit-keyframes fadeIn {
68
+ from {
69
+ opacity: 0;
70
+ -webkit-transform: translateY(-10px);
71
+ -ms-transform: translateY(-10px);
72
+ transform: translateY(-10px);
73
+ }
74
+ to {
75
+ opacity: 1;
76
+ -webkit-transform: translateY(0);
77
+ -ms-transform: translateY(0);
78
+ transform: translateY(0);
79
+ }
80
+ }
81
+
82
+ @keyframes fadeIn {
83
+ from {
84
+ opacity: 0;
85
+ -webkit-transform: translateY(-10px);
86
+ -ms-transform: translateY(-10px);
87
+ transform: translateY(-10px);
88
+ }
89
+ to {
90
+ opacity: 1;
91
+ -webkit-transform: translateY(0);
92
+ -ms-transform: translateY(0);
93
+ transform: translateY(0);
94
+ }
95
+ }
96
+
97
+ @-webkit-keyframes fadeOut {
98
+ from {
99
+ opacity: 1;
100
+ -webkit-transform: translateY(0);
101
+ -ms-transform: translateY(0);
102
+ transform: translateY(0);
103
+ }
104
+ to {
105
+ opacity: 0;
106
+ -webkit-transform: translateY(-10px);
107
+ -ms-transform: translateY(-10px);
108
+ transform: translateY(-10px);
109
+ }
110
+ }
111
+
112
+ @keyframes fadeOut {
113
+ from {
114
+ opacity: 1;
115
+ -webkit-transform: translateY(0);
116
+ -ms-transform: translateY(0);
117
+ transform: translateY(0);
118
+ }
119
+ to {
120
+ opacity: 0;
121
+ -webkit-transform: translateY(-10px);
122
+ -ms-transform: translateY(-10px);
123
+ transform: translateY(-10px);
124
+ }
125
+ }
126
+
127
+ @-webkit-keyframes appearIn {
128
+ from {
129
+ opacity: 0;
130
+ -webkit-transform: translateY(0px);
131
+ -ms-transform: translateY(0px);
132
+ transform: translateY(0px);
133
+ }
134
+ to {
135
+ opacity: 1;
136
+ -webkit-transform: translateY(0);
137
+ -ms-transform: translateY(0);
138
+ transform: translateY(0);
139
+ }
140
+ }
141
+
142
+ @keyframes appearIn {
143
+ from {
144
+ opacity: 0;
145
+ -webkit-transform: translateY(0px);
146
+ -ms-transform: translateY(0px);
147
+ transform: translateY(0px);
148
+ }
149
+ to {
150
+ opacity: 1;
151
+ -webkit-transform: translateY(0);
152
+ -ms-transform: translateY(0);
153
+ transform: translateY(0);
154
+ }
155
+ }
156
+
157
+ @-webkit-keyframes scaleIn {
158
+ from {
159
+ -webkit-transform: scale(0);
160
+ -ms-transform: scale(0);
161
+ transform: scale(0);
162
+ }
163
+ to {
164
+ -webkit-transform: scale(1);
165
+ -ms-transform: scale(1);
166
+ transform: scale(1);
167
+ }
168
+ }
169
+
170
+ @keyframes scaleIn {
171
+ from {
172
+ -webkit-transform: scale(0);
173
+ -ms-transform: scale(0);
174
+ transform: scale(0);
175
+ }
176
+ to {
177
+ -webkit-transform: scale(1);
178
+ -ms-transform: scale(1);
179
+ transform: scale(1);
180
+ }
181
+ }
182
+
183
+ @-webkit-keyframes innerDrawIn {
184
+ 0% {
185
+ stroke-dashoffset: 70;
186
+ }
187
+ 50% {
188
+ stroke-dashoffset: 140;
189
+ }
190
+ 100% {
191
+ stroke-dashoffset: 210;
192
+ }
193
+ }
194
+
195
+ @keyframes innerDrawIn {
196
+ 0% {
197
+ stroke-dashoffset: 70;
198
+ }
199
+ 50% {
200
+ stroke-dashoffset: 140;
201
+ }
202
+ 100% {
203
+ stroke-dashoffset: 210;
204
+ }
205
+ }
206
+
207
+ @-webkit-keyframes outerDrawIn {
208
+ 0% {
209
+ stroke-dashoffset: 76;
210
+ }
211
+ 100% {
212
+ stroke-dashoffset: 152;
213
+ }
214
+ }
215
+
216
+ @keyframes outerDrawIn {
217
+ 0% {
218
+ stroke-dashoffset: 76;
219
+ }
220
+ 100% {
221
+ stroke-dashoffset: 152;
222
+ }
223
+ }
224
+
225
+ .hHWjkv {
226
+ -webkit-transform-origin: 0px 0px;
227
+ -ms-transform-origin: 0px 0px;
228
+ transform-origin: 0px 0px;
229
+ -webkit-transform: scale(0);
230
+ -ms-transform: scale(0);
231
+ transform: scale(0);
232
+ -webkit-animation: scaleIn 0.25s linear forwards 0.2222222222222222s;
233
+ animation: scaleIn 0.25s linear forwards 0.2222222222222222s;
234
+ }
235
+
236
+ .gCDOzd {
237
+ -webkit-transform-origin: 0px 0px;
238
+ -ms-transform-origin: 0px 0px;
239
+ transform-origin: 0px 0px;
240
+ -webkit-transform: scale(0);
241
+ -ms-transform: scale(0);
242
+ transform: scale(0);
243
+ -webkit-animation: scaleIn 0.25s linear forwards 0.4222222222222222s;
244
+ animation: scaleIn 0.25s linear forwards 0.4222222222222222s;
245
+ }
246
+
247
+ .hmCcxi {
248
+ -webkit-transform-origin: 0px 0px;
249
+ -ms-transform-origin: 0px 0px;
250
+ transform-origin: 0px 0px;
251
+ -webkit-transform: scale(0);
252
+ -ms-transform: scale(0);
253
+ transform: scale(0);
254
+ -webkit-animation: scaleIn 0.25s linear forwards 0.6222222222222222s;
255
+ animation: scaleIn 0.25s linear forwards 0.6222222222222222s;
256
+ }
257
+
258
+ .eHamQi {
259
+ -webkit-transform-origin: 0px 0px;
260
+ -ms-transform-origin: 0px 0px;
261
+ transform-origin: 0px 0px;
262
+ -webkit-transform: scale(0);
263
+ -ms-transform: scale(0);
264
+ transform: scale(0);
265
+ -webkit-animation: scaleIn 0.25s linear forwards 0.8222222222222223s;
266
+ animation: scaleIn 0.25s linear forwards 0.8222222222222223s;
267
+ }
268
+
269
+ .byhgGu {
270
+ -webkit-transform-origin: 0px 0px;
271
+ -ms-transform-origin: 0px 0px;
272
+ transform-origin: 0px 0px;
273
+ -webkit-transform: scale(0);
274
+ -ms-transform: scale(0);
275
+ transform: scale(0);
276
+ -webkit-animation: scaleIn 0.25s linear forwards 1.0222222222222221s;
277
+ animation: scaleIn 0.25s linear forwards 1.0222222222222221s;
278
+ }
279
+
280
+ .llAKP {
281
+ -webkit-transform-origin: 0px 0px;
282
+ -ms-transform-origin: 0px 0px;
283
+ transform-origin: 0px 0px;
284
+ -webkit-transform: scale(0);
285
+ -ms-transform: scale(0);
286
+ transform: scale(0);
287
+ -webkit-animation: scaleIn 0.25s linear forwards 1.2222222222222223s;
288
+ animation: scaleIn 0.25s linear forwards 1.2222222222222223s;
289
+ }
290
+
291
+ .bglIGM {
292
+ -webkit-transform-origin: 64px 28px;
293
+ -ms-transform-origin: 64px 28px;
294
+ transform-origin: 64px 28px;
295
+ -webkit-transform: scale(0);
296
+ -ms-transform: scale(0);
297
+ transform: scale(0);
298
+ -webkit-animation: scaleIn 0.25s linear forwards 0.2222222222222222s;
299
+ animation: scaleIn 0.25s linear forwards 0.2222222222222222s;
300
+ }
301
+
302
+ .ksxRII {
303
+ -webkit-transform-origin: 95.98500061035156px 46.510000228881836px;
304
+ -ms-transform-origin: 95.98500061035156px 46.510000228881836px;
305
+ transform-origin: 95.98500061035156px 46.510000228881836px;
306
+ -webkit-transform: scale(0);
307
+ -ms-transform: scale(0);
308
+ transform: scale(0);
309
+ -webkit-animation: scaleIn 0.25s linear forwards 0.4222222222222222s;
310
+ animation: scaleIn 0.25s linear forwards 0.4222222222222222s;
311
+ }
312
+
313
+ .cWrBmb {
314
+ -webkit-transform-origin: 95.97162628173828px 83.4900016784668px;
315
+ -ms-transform-origin: 95.97162628173828px 83.4900016784668px;
316
+ transform-origin: 95.97162628173828px 83.4900016784668px;
317
+ -webkit-transform: scale(0);
318
+ -ms-transform: scale(0);
319
+ transform: scale(0);
320
+ -webkit-animation: scaleIn 0.25s linear forwards 0.6222222222222222s;
321
+ animation: scaleIn 0.25s linear forwards 0.6222222222222222s;
322
+ }
323
+
324
+ .Wnusb {
325
+ -webkit-transform-origin: 64px 101.97999572753906px;
326
+ -ms-transform-origin: 64px 101.97999572753906px;
327
+ transform-origin: 64px 101.97999572753906px;
328
+ -webkit-transform: scale(0);
329
+ -ms-transform: scale(0);
330
+ transform: scale(0);
331
+ -webkit-animation: scaleIn 0.25s linear forwards 0.8222222222222223s;
332
+ animation: scaleIn 0.25s linear forwards 0.8222222222222223s;
333
+ }
334
+
335
+ .bfPqf {
336
+ -webkit-transform-origin: 32.03982162475586px 83.4900016784668px;
337
+ -ms-transform-origin: 32.03982162475586px 83.4900016784668px;
338
+ transform-origin: 32.03982162475586px 83.4900016784668px;
339
+ -webkit-transform: scale(0);
340
+ -ms-transform: scale(0);
341
+ transform: scale(0);
342
+ -webkit-animation: scaleIn 0.25s linear forwards 1.0222222222222221s;
343
+ animation: scaleIn 0.25s linear forwards 1.0222222222222221s;
344
+ }
345
+
346
+ .edRCTN {
347
+ -webkit-transform-origin: 32.033552169799805px 46.510000228881836px;
348
+ -ms-transform-origin: 32.033552169799805px 46.510000228881836px;
349
+ transform-origin: 32.033552169799805px 46.510000228881836px;
350
+ -webkit-transform: scale(0);
351
+ -ms-transform: scale(0);
352
+ transform: scale(0);
353
+ -webkit-animation: scaleIn 0.25s linear forwards 1.2222222222222223s;
354
+ animation: scaleIn 0.25s linear forwards 1.2222222222222223s;
355
+ }
356
+
357
+ .iEGVWn {
358
+ opacity: 0;
359
+ stroke-dasharray: 76;
360
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 0.3333333333333333s, appearIn 0.1s ease-out forwards 0.3333333333333333s;
361
+ animation: outerDrawIn 0.5s ease-out forwards 0.3333333333333333s, appearIn 0.1s ease-out forwards 0.3333333333333333s;
362
+ -webkit-animation-iteration-count: 1, 1;
363
+ animation-iteration-count: 1, 1;
364
+ }
365
+
366
+ .bsocdx {
367
+ opacity: 0;
368
+ stroke-dasharray: 76;
369
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 0.5333333333333333s, appearIn 0.1s ease-out forwards 0.5333333333333333s;
370
+ animation: outerDrawIn 0.5s ease-out forwards 0.5333333333333333s, appearIn 0.1s ease-out forwards 0.5333333333333333s;
371
+ -webkit-animation-iteration-count: 1, 1;
372
+ animation-iteration-count: 1, 1;
373
+ }
374
+
375
+ .jAZXmP {
376
+ opacity: 0;
377
+ stroke-dasharray: 76;
378
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 0.7333333333333334s, appearIn 0.1s ease-out forwards 0.7333333333333334s;
379
+ animation: outerDrawIn 0.5s ease-out forwards 0.7333333333333334s, appearIn 0.1s ease-out forwards 0.7333333333333334s;
380
+ -webkit-animation-iteration-count: 1, 1;
381
+ animation-iteration-count: 1, 1;
382
+ }
383
+
384
+ .hSeArx {
385
+ opacity: 0;
386
+ stroke-dasharray: 76;
387
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 0.9333333333333333s, appearIn 0.1s ease-out forwards 0.9333333333333333s;
388
+ animation: outerDrawIn 0.5s ease-out forwards 0.9333333333333333s, appearIn 0.1s ease-out forwards 0.9333333333333333s;
389
+ -webkit-animation-iteration-count: 1, 1;
390
+ animation-iteration-count: 1, 1;
391
+ }
392
+
393
+ .bVgqGk {
394
+ opacity: 0;
395
+ stroke-dasharray: 76;
396
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 1.1333333333333333s, appearIn 0.1s ease-out forwards 1.1333333333333333s;
397
+ animation: outerDrawIn 0.5s ease-out forwards 1.1333333333333333s, appearIn 0.1s ease-out forwards 1.1333333333333333s;
398
+ -webkit-animation-iteration-count: 1, 1;
399
+ animation-iteration-count: 1, 1;
400
+ }
401
+
402
+ .hEFqBt {
403
+ opacity: 0;
404
+ stroke-dasharray: 76;
405
+ -webkit-animation: outerDrawIn 0.5s ease-out forwards 1.3333333333333333s, appearIn 0.1s ease-out forwards 1.3333333333333333s;
406
+ animation: outerDrawIn 0.5s ease-out forwards 1.3333333333333333s, appearIn 0.1s ease-out forwards 1.3333333333333333s;
407
+ -webkit-animation-iteration-count: 1, 1;
408
+ animation-iteration-count: 1, 1;
409
+ }
410
+
411
+ .dzEKCM {
412
+ opacity: 0;
413
+ stroke-dasharray: 70;
414
+ -webkit-animation: innerDrawIn 1s ease-in-out forwards 1.3666666666666667s, appearIn 0.1s linear forwards 1.3666666666666667s;
415
+ animation: innerDrawIn 1s ease-in-out forwards 1.3666666666666667s, appearIn 0.1s linear forwards 1.3666666666666667s;
416
+ -webkit-animation-iteration-count: infinite, 1;
417
+ animation-iteration-count: infinite, 1;
418
+ }
419
+
420
+ .DYnPx {
421
+ opacity: 0;
422
+ stroke-dasharray: 70;
423
+ -webkit-animation: innerDrawIn 1s ease-in-out forwards 1.5333333333333332s, appearIn 0.1s linear forwards 1.5333333333333332s;
424
+ animation: innerDrawIn 1s ease-in-out forwards 1.5333333333333332s, appearIn 0.1s linear forwards 1.5333333333333332s;
425
+ -webkit-animation-iteration-count: infinite, 1;
426
+ animation-iteration-count: infinite, 1;
427
+ }
428
+
429
+ .hjPEAQ {
430
+ opacity: 0;
431
+ stroke-dasharray: 70;
432
+ -webkit-animation: innerDrawIn 1s ease-in-out forwards 1.7000000000000002s, appearIn 0.1s linear forwards 1.7000000000000002s;
433
+ animation: innerDrawIn 1s ease-in-out forwards 1.7000000000000002s, appearIn 0.1s linear forwards 1.7000000000000002s;
434
+ -webkit-animation-iteration-count: infinite, 1;
435
+ animation-iteration-count: infinite, 1;
436
+ }
437
+
438
+ #loading-wrapper {
439
+ position: absolute;
440
+ width: 100vw;
441
+ height: 100vh;
442
+ display: -webkit-box;
443
+ display: -webkit-flex;
444
+ display: -ms-flexbox;
445
+ display: flex;
446
+ -webkit-align-items: center;
447
+ -webkit-box-align: center;
448
+ -ms-flex-align: center;
449
+ align-items: center;
450
+ -webkit-box-pack: center;
451
+ -webkit-justify-content: center;
452
+ -ms-flex-pack: center;
453
+ justify-content: center;
454
+ -webkit-flex-direction: column;
455
+ -ms-flex-direction: column;
456
+ flex-direction: column;
457
+ }
458
+
459
+ .logo {
460
+ width: 75px;
461
+ height: 75px;
462
+ margin-bottom: 20px;
463
+ opacity: 0;
464
+ -webkit-animation: fadeIn 0.5s ease-out forwards;
465
+ animation: fadeIn 0.5s ease-out forwards;
466
+ }
467
+
468
+ .text {
469
+ font-size: 32px;
470
+ font-weight: 200;
471
+ text-align: center;
472
+ color: rgba(255, 255, 255, 0.6);
473
+ opacity: 0;
474
+ -webkit-animation: fadeIn 0.5s ease-out forwards;
475
+ animation: fadeIn 0.5s ease-out forwards;
476
+ }
477
+
478
+ .dGfHfc {
479
+ font-weight: 400;
480
+ }
@@ -0,0 +1,7 @@
1
+ module GraphQL
2
+ module Playground
3
+ class ApplicationController < ActionController::Base
4
+ protect_from_forgery with: :exception
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ module GraphQL
2
+ module Playground
3
+ class EditorsController < ApplicationController
4
+ def show
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ module GraphQL
2
+ module Playground
3
+ module ApplicationHelper
4
+ def graphql_endpoint_path
5
+ params[:graphql_path] || raise(%|You must include `graphql_path: "/my/endpoint"` when mounting GraphQL::Playground::Engine|)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ module GraphQL
2
+ module Playground
3
+ class ApplicationJob < ActiveJob::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ module GraphQL
2
+ module Playground
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 GraphQL
2
+ module Playground
3
+ class ApplicationRecord < ActiveRecord::Base
4
+ self.abstract_class = true
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ <script type="text/javascript">
2
+ window.addEventListener('load', function (event) {
3
+ const loadingWrapper = document.getElementById('loading-wrapper');
4
+ loadingWrapper.classList.add('fadeOut');
5
+
6
+
7
+ const root = document.getElementById('root');
8
+ root.classList.add('playgroundIn');
9
+
10
+ GraphQLPlayground.init(root, {
11
+ // you can add more options here
12
+ endpoint: "<%= graphql_endpoint_path %>"
13
+ })
14
+ });
15
+ </script>
@@ -0,0 +1,33 @@
1
+ <svg class="logo" viewBox="0 0 128 128" xmlns:xlink="http://www.w3.org/1999/xlink">
2
+ <title>GraphQL Playground Logo</title>
3
+ <defs>
4
+ <linearGradient id="linearGradient-1" x1="4.86%" x2="96.21%" y1="0%" y2="99.66%">
5
+ <stop stop-color="#E00082" stop-opacity=".8" offset="0%"></stop>
6
+ <stop stop-color="#E00082" offset="100%"></stop>
7
+ </linearGradient>
8
+ </defs>
9
+ <g>
10
+ <rect id="Gradient" width="127.96" height="127.96" y="1" fill="url(#linearGradient-1)" rx="4"></rect>
11
+ <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>
12
+ <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>
13
+ <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"
14
+ style="transform: translate(100px, 100px);"></path>
15
+ <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"
16
+ style="transform: translate(100px, 100px);"></path>
17
+ <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"
18
+ style="transform: translate(100px, 100px);"></path>
19
+ <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"
20
+ style="transform: translate(100px, 100px);"></path>
21
+ <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"
22
+ style="transform: translate(100px, 100px);"></path>
23
+ <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>
24
+ <path class="bsocdx" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M96 46v38-38z"></path>
25
+ <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>
26
+ <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>
27
+ <path class="bVgqGk" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M32 84V46v38z"></path>
28
+ <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>
29
+ <path class="dzEKCM" id="Triangle-Bottom" stroke="#fff" stroke-width="4" d="M30 84h70" stroke-linecap="round"></path>
30
+ <path class="DYnPx" id="Triangle-Left" stroke="#fff" stroke-width="4" d="M65 26L30 87" stroke-linecap="round"></path>
31
+ <path class="hjPEAQ" id="Triangle-Right" stroke="#fff" stroke-width="4" d="M98 87L63 26" stroke-linecap="round"></path>
32
+ </g>
33
+ </svg>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset=utf-8 />
5
+ <meta name="viewport" content="user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui">
6
+ <title>GraphQL playground</title>
7
+ <%= csrf_meta_tags %>
8
+ <%= csp_meta_tag %>
9
+
10
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/graphql-playground-react/build/static/css/index.css" />
11
+ <link rel="shortcut icon" href="//cdn.jsdelivr.net/npm/graphql-playground-react/build/favicon.png" />
12
+ <%= stylesheet_link_tag "graphql/playground/application", media: "all" %>
13
+ <script src="//cdn.jsdelivr.net/npm/graphql-playground-react/build/static/js/middleware.js"></script>
14
+ <%= javascript_include_tag "graphql/playground/application" %>
15
+ </head>
16
+ <body>
17
+
18
+ <div id="loading-wrapper">
19
+ <%= render "layouts/graphql/playground/logo" %>
20
+ <div class="text">Loading
21
+ <span class="dGfHfc">GraphQL Playground</span>
22
+ </div>
23
+ </div>
24
+
25
+ <div id="root" />
26
+ <%= yield %>
27
+
28
+ </body>
29
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ GraphQL::Playground::Engine.routes.draw do
2
+ root to: "editors#show"
3
+ end
@@ -0,0 +1,21 @@
1
+ require "rails"
2
+
3
+ if ActiveSupport::Inflector.method(:inflections).arity == 0
4
+ # Rails 3 does not take a language in inflections.
5
+ ActiveSupport::Inflector.inflections do |inflect|
6
+ inflect.acronym("GraphQL")
7
+ end
8
+ else
9
+ ActiveSupport::Inflector.inflections(:en) do |inflect|
10
+ inflect.acronym("GraphQL")
11
+ end
12
+ end
13
+
14
+ require "graphql/playground/engine"
15
+ require "graphql/playground/version"
16
+
17
+ module GraphQL
18
+ module Playground
19
+ # Your code goes here...
20
+ end
21
+ end
@@ -0,0 +1,7 @@
1
+ module GraphQL
2
+ module Playground
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace GraphQL::Playground
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module GraphQL
2
+ module Playground
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :graphql_playground do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: graphql-playground
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pan Jie
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-06-25 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.2.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 5.2.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: sqlite3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: GraphQL IDE for better development workflows (GraphQL Subscriptions,
42
+ interactive docs & collaboration)
43
+ email:
44
+ - panjie@growingio.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - MIT-LICENSE
50
+ - README.md
51
+ - Rakefile
52
+ - app/assets/config/graphql_playground_manifest.js
53
+ - app/assets/javascripts/graphql/playground/application.js
54
+ - app/assets/stylesheets/graphql/playground/application.css
55
+ - app/controllers/graphql/playground/application_controller.rb
56
+ - app/controllers/graphql/playground/editors_controller.rb
57
+ - app/helpers/graphql/playground/application_helper.rb
58
+ - app/jobs/graphql/playground/application_job.rb
59
+ - app/mailers/graphql/playground/application_mailer.rb
60
+ - app/models/graphql/playground/application_record.rb
61
+ - app/views/graphql/playground/editors/show.html.erb
62
+ - app/views/layouts/graphql/playground/_logo.html.erb
63
+ - app/views/layouts/graphql/playground/application.html.erb
64
+ - config/routes.rb
65
+ - lib/graphql/playground.rb
66
+ - lib/graphql/playground/engine.rb
67
+ - lib/graphql/playground/version.rb
68
+ - lib/tasks/graphql/playground_tasks.rake
69
+ homepage: https://github.com/jack0pan/graphql-playground-rails
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.7.9
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: A mountable GraphQL Playground endpoint for Rails.
93
+ test_files: []