gqli 0.6.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +103 -82
- data/README.md +0 -5
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1774 -1205
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- data/coverage/assets/0.12.3/application.css +1 -0
- data/coverage/assets/0.12.3/application.js +7 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/colorbox/border.png +0 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/colorbox/controls.png +0 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/colorbox/loading.gif +0 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/colorbox/loading_background.png +0 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/favicon_green.png +0 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/favicon_red.png +0 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/favicon_yellow.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/{0.10.2/smoothness → 0.12.3}/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/loading.gif +0 -0
- data/coverage/assets/{0.10.2 → 0.12.3}/magnify.png +0 -0
- data/coverage/index.html +19376 -7403
- data/doc/GQLi/Base.html +11 -11
- data/doc/GQLi/Client.html +175 -41
- data/doc/GQLi/Contentful.html +13 -11
- data/doc/GQLi/DSL.html +298 -30
- data/doc/GQLi/EnumValue.html +8 -8
- data/doc/GQLi/Fragment.html +8 -8
- data/doc/GQLi/Github.html +6 -6
- data/doc/GQLi/Introspection.html +46 -48
- data/doc/GQLi/Mutation.html +390 -0
- data/doc/GQLi/Node.html +8 -8
- data/doc/GQLi/Query.html +6 -6
- data/doc/GQLi/Response.html +87 -13
- data/doc/GQLi/Subscription.html +390 -0
- data/doc/GQLi/Validation.html +20 -20
- data/doc/GQLi.html +9 -9
- data/doc/_index.html +37 -7
- data/doc/class_list.html +3 -3
- data/doc/css/style.css +3 -2
- data/doc/file.CHANGELOG.html +43 -13
- data/doc/file.LICENSE.html +6 -6
- data/doc/file.README.html +31 -84
- data/doc/file_list.html +2 -2
- data/doc/frames.html +2 -2
- data/doc/index.html +31 -84
- data/doc/js/app.js +25 -3
- data/doc/method_list.html +147 -43
- data/doc/top-level-namespace.html +6 -6
- data/gqli.gemspec +5 -6
- data/lib/gqli/client.rb +25 -5
- data/lib/gqli/clients/contentful.rb +3 -2
- data/lib/gqli/dsl.rb +16 -1
- data/lib/gqli/introspection.rb +1 -3
- data/lib/gqli/mutation.rb +27 -0
- data/lib/gqli/response.rb +15 -2
- data/lib/gqli/subscription.rb +1 -1
- data/lib/gqli/validation.rb +15 -12
- data/lib/gqli/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/client.yml +98 -27
- data/spec/fixtures/vcr_cassettes/mutation_client.yml +4364 -0
- data/spec/lib/gqli/client_spec.rb +53 -0
- data/spec/lib/gqli/dsl_spec.rb +72 -2
- data/spec/lib/gqli/introspection_spec.rb +54 -0
- data/spec/lib/gqli/response_spec.rb +51 -0
- metadata +64 -73
- data/coverage/assets/0.10.2/application.css +0 -799
- data/coverage/assets/0.10.2/application.js +0 -1707
data/doc/GQLi/Base.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Class: GQLi::Base
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.27
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "GQLi::Base";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -112,7 +112,7 @@
|
|
112
112
|
|
113
113
|
</div><div id="subclasses">
|
114
114
|
<h2>Direct Known Subclasses</h2>
|
115
|
-
<p class="children"><span class='object_link'><a href="Fragment.html" title="GQLi::Fragment (class)">Fragment</a></span>, <span class='object_link'><a href="Node.html" title="GQLi::Node (class)">Node</a></span>, <span class='object_link'><a href="Query.html" title="GQLi::Query (class)">Query</a></span></p>
|
115
|
+
<p class="children"><span class='object_link'><a href="Fragment.html" title="GQLi::Fragment (class)">Fragment</a></span>, <span class='object_link'><a href="Mutation.html" title="GQLi::Mutation (class)">Mutation</a></span>, <span class='object_link'><a href="Node.html" title="GQLi::Node (class)">Node</a></span>, <span class='object_link'><a href="Query.html" title="GQLi::Query (class)">Query</a></span>, <span class='object_link'><a href="Subscription.html" title="GQLi::Subscription (class)">Subscription</a></span></p>
|
116
116
|
</div>
|
117
117
|
|
118
118
|
|
@@ -361,7 +361,7 @@
|
|
361
361
|
</h3><div class="docstring">
|
362
362
|
<div class="discussion">
|
363
363
|
|
364
|
-
<p>Returns a new instance of Base
|
364
|
+
<p>Returns a new instance of Base.</p>
|
365
365
|
|
366
366
|
|
367
367
|
</div>
|
@@ -453,7 +453,7 @@
|
|
453
453
|
</h3><div class="docstring">
|
454
454
|
<div class="discussion">
|
455
455
|
|
456
|
-
<p>Returns the value of attribute __depth
|
456
|
+
<p>Returns the value of attribute __depth.</p>
|
457
457
|
|
458
458
|
|
459
459
|
</div>
|
@@ -496,7 +496,7 @@
|
|
496
496
|
</h3><div class="docstring">
|
497
497
|
<div class="discussion">
|
498
498
|
|
499
|
-
<p>Returns the value of attribute __name
|
499
|
+
<p>Returns the value of attribute __name.</p>
|
500
500
|
|
501
501
|
|
502
502
|
</div>
|
@@ -539,7 +539,7 @@
|
|
539
539
|
</h3><div class="docstring">
|
540
540
|
<div class="discussion">
|
541
541
|
|
542
|
-
<p>Returns the value of attribute __nodes
|
542
|
+
<p>Returns the value of attribute __nodes.</p>
|
543
543
|
|
544
544
|
|
545
545
|
</div>
|
@@ -746,9 +746,9 @@
|
|
746
746
|
</div>
|
747
747
|
|
748
748
|
<div id="footer">
|
749
|
-
Generated on
|
749
|
+
Generated on Mon Jan 3 17:37:12 2022 by
|
750
750
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
751
|
-
0.9.
|
751
|
+
0.9.27 (ruby-3.0.3).
|
752
752
|
</div>
|
753
753
|
|
754
754
|
</div>
|
data/doc/GQLi/Client.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Class: GQLi::Client
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.27
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "GQLi::Client";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -143,6 +143,35 @@
|
|
143
143
|
<p>Returns the value of attribute headers.</p>
|
144
144
|
</div></span>
|
145
145
|
|
146
|
+
</li>
|
147
|
+
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
152
|
+
<a href="#options-instance_method" title="#options (instance method)">#<strong>options</strong> ⇒ Object </a>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</span>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="note title readonly">readonly</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>Returns the value of attribute options.</p>
|
173
|
+
</div></span>
|
174
|
+
|
146
175
|
</li>
|
147
176
|
|
148
177
|
|
@@ -293,8 +322,7 @@
|
|
293
322
|
|
294
323
|
|
295
324
|
<span class="summary_desc"><div class='inline'>
|
296
|
-
<p>Executes a query If validations are enabled, will perform validation check
|
297
|
-
before request.</p>
|
325
|
+
<p>Executes a query If validations are enabled, will perform validation check before request.</p>
|
298
326
|
</div></span>
|
299
327
|
|
300
328
|
</li>
|
@@ -327,7 +355,7 @@ before request.</p>
|
|
327
355
|
<li class="public ">
|
328
356
|
<span class="summary_signature">
|
329
357
|
|
330
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(url, params: {}, headers: {}, validate_query: true) ⇒ Client </a>
|
358
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(url, params: {}, headers: {}, validate_query: true, options: {}) ⇒ Client </a>
|
331
359
|
|
332
360
|
|
333
361
|
|
@@ -347,6 +375,28 @@ before request.</p>
|
|
347
375
|
<p>A new instance of Client.</p>
|
348
376
|
</div></span>
|
349
377
|
|
378
|
+
</li>
|
379
|
+
|
380
|
+
|
381
|
+
<li class="public ">
|
382
|
+
<span class="summary_signature">
|
383
|
+
|
384
|
+
<a href="#request-instance_method" title="#request (instance method)">#<strong>request</strong> ⇒ Object </a>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
</span>
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
399
|
+
|
350
400
|
</li>
|
351
401
|
|
352
402
|
|
@@ -383,7 +433,7 @@ before request.</p>
|
|
383
433
|
<div class="method_details first">
|
384
434
|
<h3 class="signature first" id="initialize-instance_method">
|
385
435
|
|
386
|
-
#<strong>initialize</strong>(url, params: {}, headers: {}, validate_query: true) ⇒ <tt><span class='object_link'><a href="" title="GQLi::Client (class)">Client</a></span></tt>
|
436
|
+
#<strong>initialize</strong>(url, params: {}, headers: {}, validate_query: true, options: {}) ⇒ <tt><span class='object_link'><a href="" title="GQLi::Client (class)">Client</a></span></tt>
|
387
437
|
|
388
438
|
|
389
439
|
|
@@ -392,7 +442,7 @@ before request.</p>
|
|
392
442
|
</h3><div class="docstring">
|
393
443
|
<div class="discussion">
|
394
444
|
|
395
|
-
<p>Returns a new instance of Client
|
445
|
+
<p>Returns a new instance of Client.</p>
|
396
446
|
|
397
447
|
|
398
448
|
</div>
|
@@ -413,16 +463,24 @@ before request.</p>
|
|
413
463
|
18
|
414
464
|
19
|
415
465
|
20
|
416
|
-
21
|
466
|
+
21
|
467
|
+
22
|
468
|
+
23
|
469
|
+
24
|
470
|
+
25</pre>
|
417
471
|
</td>
|
418
472
|
<td>
|
419
473
|
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line 14</span>
|
420
474
|
|
421
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>validate_query:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
475
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>validate_query:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
422
476
|
<span class='ivar'>@url</span> <span class='op'>=</span> <span class='id identifier rubyid_url'>url</span>
|
423
477
|
<span class='ivar'>@params</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span>
|
424
478
|
<span class='ivar'>@headers</span> <span class='op'>=</span> <span class='id identifier rubyid_headers'>headers</span>
|
425
479
|
<span class='ivar'>@validate_query</span> <span class='op'>=</span> <span class='id identifier rubyid_validate_query'>validate_query</span>
|
480
|
+
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
|
481
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:read_timeout</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='int'>60</span>
|
482
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:write_timeout</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='int'>60</span>
|
483
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:connect_timeout</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='int'>60</span>
|
426
484
|
|
427
485
|
<span class='ivar'>@schema</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Introspection.html" title="GQLi::Introspection (class)">Introspection</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Introspection.html#initialize-instance_method" title="GQLi::Introspection#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_validate_query'>validate_query</span>
|
428
486
|
<span class='kw'>end</span></pre>
|
@@ -450,7 +508,7 @@ before request.</p>
|
|
450
508
|
</h3><div class="docstring">
|
451
509
|
<div class="discussion">
|
452
510
|
|
453
|
-
<p>Returns the value of attribute headers
|
511
|
+
<p>Returns the value of attribute headers.</p>
|
454
512
|
|
455
513
|
|
456
514
|
</div>
|
@@ -480,6 +538,49 @@ before request.</p>
|
|
480
538
|
</div>
|
481
539
|
|
482
540
|
|
541
|
+
<span id=""></span>
|
542
|
+
<div class="method_details ">
|
543
|
+
<h3 class="signature " id="options-instance_method">
|
544
|
+
|
545
|
+
#<strong>options</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
</h3><div class="docstring">
|
552
|
+
<div class="discussion">
|
553
|
+
|
554
|
+
<p>Returns the value of attribute options.</p>
|
555
|
+
|
556
|
+
|
557
|
+
</div>
|
558
|
+
</div>
|
559
|
+
<div class="tags">
|
560
|
+
|
561
|
+
|
562
|
+
</div><table class="source_code">
|
563
|
+
<tr>
|
564
|
+
<td>
|
565
|
+
<pre class="lines">
|
566
|
+
|
567
|
+
|
568
|
+
12
|
569
|
+
13
|
570
|
+
14</pre>
|
571
|
+
</td>
|
572
|
+
<td>
|
573
|
+
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line 12</span>
|
574
|
+
|
575
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
|
576
|
+
<span class='ivar'>@options</span>
|
577
|
+
<span class='kw'>end</span></pre>
|
578
|
+
</td>
|
579
|
+
</tr>
|
580
|
+
</table>
|
581
|
+
</div>
|
582
|
+
|
583
|
+
|
483
584
|
<span id=""></span>
|
484
585
|
<div class="method_details ">
|
485
586
|
<h3 class="signature " id="params-instance_method">
|
@@ -493,7 +594,7 @@ before request.</p>
|
|
493
594
|
</h3><div class="docstring">
|
494
595
|
<div class="discussion">
|
495
596
|
|
496
|
-
<p>Returns the value of attribute params
|
597
|
+
<p>Returns the value of attribute params.</p>
|
497
598
|
|
498
599
|
|
499
600
|
</div>
|
@@ -536,7 +637,7 @@ before request.</p>
|
|
536
637
|
</h3><div class="docstring">
|
537
638
|
<div class="discussion">
|
538
639
|
|
539
|
-
<p>Returns the value of attribute schema
|
640
|
+
<p>Returns the value of attribute schema.</p>
|
540
641
|
|
541
642
|
|
542
643
|
</div>
|
@@ -579,7 +680,7 @@ before request.</p>
|
|
579
680
|
</h3><div class="docstring">
|
580
681
|
<div class="discussion">
|
581
682
|
|
582
|
-
<p>Returns the value of attribute url
|
683
|
+
<p>Returns the value of attribute url.</p>
|
583
684
|
|
584
685
|
|
585
686
|
</div>
|
@@ -622,7 +723,7 @@ before request.</p>
|
|
622
723
|
</h3><div class="docstring">
|
623
724
|
<div class="discussion">
|
624
725
|
|
625
|
-
<p>Returns the value of attribute validate_query
|
726
|
+
<p>Returns the value of attribute validate_query.</p>
|
626
727
|
|
627
728
|
|
628
729
|
</div>
|
@@ -670,8 +771,7 @@ before request.</p>
|
|
670
771
|
</h3><div class="docstring">
|
671
772
|
<div class="discussion">
|
672
773
|
|
673
|
-
<p>Executes a query If validations are enabled, will perform validation check
|
674
|
-
before request.</p>
|
774
|
+
<p>Executes a query If validations are enabled, will perform validation check before request.</p>
|
675
775
|
|
676
776
|
|
677
777
|
</div>
|
@@ -685,17 +785,17 @@ before request.</p>
|
|
685
785
|
<pre class="lines">
|
686
786
|
|
687
787
|
|
688
|
-
25
|
689
|
-
26
|
690
|
-
27
|
691
|
-
28
|
692
788
|
29
|
693
789
|
30
|
694
790
|
31
|
695
|
-
32
|
791
|
+
32
|
792
|
+
33
|
793
|
+
34
|
794
|
+
35
|
795
|
+
36</pre>
|
696
796
|
</td>
|
697
797
|
<td>
|
698
|
-
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line
|
798
|
+
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line 29</span>
|
699
799
|
|
700
800
|
<span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
|
701
801
|
<span class='kw'>if</span> <span class='id identifier rubyid_validate_query'>validate_query</span>
|
@@ -736,27 +836,61 @@ before request.</p>
|
|
736
836
|
<pre class="lines">
|
737
837
|
|
738
838
|
|
739
|
-
36
|
740
|
-
37
|
741
|
-
38
|
742
|
-
39
|
743
839
|
40
|
744
840
|
41
|
745
841
|
42
|
746
842
|
43
|
747
|
-
44
|
843
|
+
44
|
844
|
+
45
|
845
|
+
46
|
846
|
+
47
|
847
|
+
48
|
848
|
+
49
|
849
|
+
50</pre>
|
748
850
|
</td>
|
749
851
|
<td>
|
750
|
-
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line
|
852
|
+
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line 40</span>
|
751
853
|
|
752
854
|
<span class='kw'>def</span> <span class='id identifier rubyid_execute!'>execute!</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
|
753
|
-
<span class='id identifier rubyid_http_response'>http_response</span> <span class='op'>=</span> <span class='
|
855
|
+
<span class='id identifier rubyid_http_response'>http_response</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='ivar'>@url</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='ivar'>@params</span><span class='comma'>,</span> <span class='label'>json:</span> <span class='lbrace'>{</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='period'>.</span><span class='id identifier rubyid_to_gql'>to_gql</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
754
856
|
|
755
857
|
<span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Error: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_http_response'>http_response</span><span class='period'>.</span><span class='id identifier rubyid_reason'>reason</span><span class='embexpr_end'>}</span><span class='tstring_content'>\nBody: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_http_response'>http_response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_http_response'>http_response</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>>=</span> <span class='int'>300</span>
|
756
858
|
|
757
|
-
<span class='id identifier
|
859
|
+
<span class='id identifier rubyid_parsed_response'>parsed_response</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_http_response'>http_response</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
|
860
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_parsed_response'>parsed_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>data</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
861
|
+
<span class='id identifier rubyid_errors'>errors</span> <span class='op'>=</span> <span class='id identifier rubyid_parsed_response'>parsed_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>errors</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
758
862
|
|
759
|
-
<span class='const'><span class='object_link'><a href="Response.html" title="GQLi::Response (class)">Response</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Response.html#initialize-instance_method" title="GQLi::Response#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
|
863
|
+
<span class='const'><span class='object_link'><a href="Response.html" title="GQLi::Response (class)">Response</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Response.html#initialize-instance_method" title="GQLi::Response#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_errors'>errors</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
|
864
|
+
<span class='kw'>end</span></pre>
|
865
|
+
</td>
|
866
|
+
</tr>
|
867
|
+
</table>
|
868
|
+
</div>
|
869
|
+
|
870
|
+
<div class="method_details ">
|
871
|
+
<h3 class="signature " id="request-instance_method">
|
872
|
+
|
873
|
+
#<strong>request</strong> ⇒ <tt>Object</tt>
|
874
|
+
|
875
|
+
|
876
|
+
|
877
|
+
|
878
|
+
|
879
|
+
</h3><table class="source_code">
|
880
|
+
<tr>
|
881
|
+
<td>
|
882
|
+
<pre class="lines">
|
883
|
+
|
884
|
+
|
885
|
+
59
|
886
|
+
60
|
887
|
+
61</pre>
|
888
|
+
</td>
|
889
|
+
<td>
|
890
|
+
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line 59</span>
|
891
|
+
|
892
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_request'>request</span>
|
893
|
+
<span class='const'>HTTP</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='lparen'>(</span><span class='id identifier rubyid_request_headers'>request_headers</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_timeout'>timeout</span><span class='lparen'>(</span><span class='id identifier rubyid_timeout_options'>timeout_options</span><span class='rparen'>)</span>
|
760
894
|
<span class='kw'>end</span></pre>
|
761
895
|
</td>
|
762
896
|
</tr>
|
@@ -802,14 +936,14 @@ before request.</p>
|
|
802
936
|
<pre class="lines">
|
803
937
|
|
804
938
|
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
939
|
+
53
|
940
|
+
54
|
941
|
+
55
|
942
|
+
56
|
943
|
+
57</pre>
|
810
944
|
</td>
|
811
945
|
<td>
|
812
|
-
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line
|
946
|
+
<pre class="code"><span class="info file"># File 'lib/gqli/client.rb', line 53</span>
|
813
947
|
|
814
948
|
<span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
|
815
949
|
<span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>unless</span> <span class='id identifier rubyid_validate_query'>validate_query</span>
|
@@ -826,9 +960,9 @@ before request.</p>
|
|
826
960
|
</div>
|
827
961
|
|
828
962
|
<div id="footer">
|
829
|
-
Generated on
|
963
|
+
Generated on Mon Jan 3 17:37:12 2022 by
|
830
964
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
831
|
-
0.9.
|
965
|
+
0.9.27 (ruby-3.0.3).
|
832
966
|
</div>
|
833
967
|
|
834
968
|
</div>
|
data/doc/GQLi/Contentful.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Module: GQLi::Contentful
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.27
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "GQLi::Contentful";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -112,7 +112,7 @@
|
|
112
112
|
<li class="public ">
|
113
113
|
<span class="summary_signature">
|
114
114
|
|
115
|
-
<a href="#create-class_method" title="create (class method)">.<strong>create</strong>(space, access_token, environment: nil, validate_query: true) ⇒ Object </a>
|
115
|
+
<a href="#create-class_method" title="create (class method)">.<strong>create</strong>(space, access_token, environment: nil, validate_query: true, options: {}) ⇒ Object </a>
|
116
116
|
|
117
117
|
|
118
118
|
|
@@ -145,7 +145,7 @@
|
|
145
145
|
<div class="method_details first">
|
146
146
|
<h3 class="signature first" id="create-class_method">
|
147
147
|
|
148
|
-
.<strong>create</strong>(space, access_token, environment: nil, validate_query: true) ⇒ <tt>Object</tt>
|
148
|
+
.<strong>create</strong>(space, access_token, environment: nil, validate_query: true, options: {}) ⇒ <tt>Object</tt>
|
149
149
|
|
150
150
|
|
151
151
|
|
@@ -179,12 +179,13 @@
|
|
179
179
|
15
|
180
180
|
16
|
181
181
|
17
|
182
|
-
18
|
182
|
+
18
|
183
|
+
19</pre>
|
183
184
|
</td>
|
184
185
|
<td>
|
185
186
|
<pre class="code"><span class="info file"># File 'lib/gqli/clients/contentful.rb', line 7</span>
|
186
187
|
|
187
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_space'>space</span><span class='comma'>,</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span> <span class='label'>environment:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>validate_query:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
188
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_space'>space</span><span class='comma'>,</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span> <span class='label'>environment:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>validate_query:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
188
189
|
<span class='id identifier rubyid_api_url'>api_url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://graphql.contentful.com/content/v1/spaces/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_space'>space</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
189
190
|
<span class='id identifier rubyid_api_url'>api_url</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/environments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_environment'>environment</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_environment'>environment</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
190
191
|
|
@@ -193,7 +194,8 @@
|
|
193
194
|
<span class='label'>headers:</span> <span class='lbrace'>{</span>
|
194
195
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Authorization</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Bearer </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_access_token'>access_token</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
195
196
|
<span class='rbrace'>}</span><span class='comma'>,</span>
|
196
|
-
<span class='label'>validate_query:</span> <span class='id identifier rubyid_validate_query'>validate_query</span>
|
197
|
+
<span class='label'>validate_query:</span> <span class='id identifier rubyid_validate_query'>validate_query</span><span class='comma'>,</span>
|
198
|
+
<span class='label'>options:</span> <span class='id identifier rubyid_options'>options</span>
|
197
199
|
<span class='rparen'>)</span>
|
198
200
|
<span class='kw'>end</span></pre>
|
199
201
|
</td>
|
@@ -206,9 +208,9 @@
|
|
206
208
|
</div>
|
207
209
|
|
208
210
|
<div id="footer">
|
209
|
-
Generated on
|
211
|
+
Generated on Mon Jan 3 17:37:12 2022 by
|
210
212
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
211
|
-
0.9.
|
213
|
+
0.9.27 (ruby-3.0.3).
|
212
214
|
</div>
|
213
215
|
|
214
216
|
</div>
|