graphiti 2.0.0.beta.3 → 2.0.0.beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +30 -86
- data/.github/workflows/docs.yml +57 -0
- data/.github/workflows/release.yml +8 -8
- data/.gitignore +7 -0
- data/.npmrc +9 -0
- data/.standard.yml +4 -1
- data/Appraisals +33 -32
- data/CHANGELOG.md +48 -0
- data/README.md +13 -2
- data/UPGRADING.md +2 -58
- data/docs/concepts/backends-and-models.md +122 -0
- data/docs/concepts/endpoints.md +183 -0
- data/docs/concepts/links.md +212 -0
- data/docs/concepts/overview.md +80 -0
- data/docs/concepts/persisting.md +376 -0
- data/docs/concepts/relationships.md +527 -0
- data/docs/concepts/resources.md +677 -0
- data/docs/getting-started/first-api.md +289 -0
- data/docs/getting-started/installation.md +185 -0
- data/docs/intro.md +307 -0
- data/docs/js/authentication.md +63 -0
- data/docs/js/ddau.md +20 -0
- data/docs/js/extra-params.md +41 -0
- data/docs/js/index.md +112 -0
- data/docs/js/installation.md +120 -0
- data/docs/js/middleware.md +72 -0
- data/docs/js/models.md +202 -0
- data/docs/js/reads.md +494 -0
- data/docs/js/state-syncing.md +100 -0
- data/docs/js/writes.md +373 -0
- data/docs/reference/vandal.md +63 -0
- data/docs/reference/why.md +13 -0
- data/docs/topics/authorization.md +155 -0
- data/docs/topics/caching.md +55 -0
- data/docs/topics/customizing-sideloads.md +156 -0
- data/docs/topics/debugging.md +216 -0
- data/docs/topics/error-handling.md +210 -0
- data/docs/topics/etags.md +46 -0
- data/docs/topics/hopping-relationships.md +149 -0
- data/docs/topics/json-attributes.md +77 -0
- data/docs/topics/openstruct-models.md +50 -0
- data/docs/topics/remote-resources.md +291 -0
- data/docs/topics/testing.md +894 -0
- data/docs/topics/without-activerecord.md +324 -0
- data/docs/tutorial/index.md +58 -0
- data/docs/tutorial/step_0.md +107 -0
- data/docs/tutorial/step_1.md +199 -0
- data/docs/tutorial/step_2.md +312 -0
- data/docs/tutorial/step_3.md +142 -0
- data/docs/tutorial/step_4.md +135 -0
- data/docs/tutorial/step_5.md +69 -0
- data/docs/tutorial/step_6.md +82 -0
- data/docs/tutorial/step_7.md +205 -0
- data/docs/tutorial/step_8.md +128 -0
- data/docs/tutorial/step_9.md +171 -0
- data/docs/upgrading.md +260 -0
- data/gemfiles/rails_7_1.gemfile +4 -3
- data/gemfiles/{rails_7_2_graphiti_rails.gemfile → rails_7_2.gemfile} +3 -3
- data/gemfiles/{rails_8_1_graphiti_rails.gemfile → rails_8_0.gemfile} +3 -3
- data/gemfiles/{rails_8_0_graphiti_rails.gemfile → rails_8_1.gemfile} +3 -3
- data/graphiti.gemspec +7 -23
- data/{deprecated_generators → lib/generators}/graphiti/api_test_generator.rb +7 -1
- data/{deprecated_generators → lib/generators}/graphiti/generator_mixin.rb +14 -1
- data/{deprecated_generators → lib/generators}/graphiti/install_generator.rb +19 -13
- data/{deprecated_generators → lib/generators}/graphiti/resource_generator.rb +68 -7
- data/{deprecated_generators → lib/generators}/graphiti/templates/controller.rb.erb +1 -1
- data/{deprecated_generators → lib/generators}/graphiti/templates/index_request_spec.rb.erb +1 -1
- data/{deprecated_generators → lib/generators}/graphiti/templates/resource_reads_spec.rb.erb +6 -6
- data/{deprecated_generators → lib/generators}/graphiti/templates/show_request_spec.rb.erb +1 -1
- data/lib/graphiti/configuration.rb +2 -2
- data/lib/graphiti/error_serializers/conflict_request.rb +19 -0
- data/lib/graphiti/error_serializers/deprecated_constants.rb +48 -0
- data/lib/graphiti/error_serializers/invalid_request.rb +56 -0
- data/lib/graphiti/error_serializers/validation.rb +143 -0
- data/lib/graphiti/errors.rb +4 -4
- data/lib/graphiti/query.rb +1 -1
- data/lib/graphiti/rails/context.rb +33 -0
- data/lib/graphiti/rails/controller.rb +41 -0
- data/lib/graphiti/rails/debugging.rb +18 -0
- data/lib/graphiti/rails/exception_handlers.rb +77 -0
- data/lib/graphiti/rails/railtie.rb +139 -0
- data/lib/graphiti/rails/rake_helpers.rb +42 -0
- data/lib/graphiti/rails/responders.rb +21 -0
- data/lib/graphiti/rails/test_helpers.rb +22 -0
- data/lib/graphiti/rails.rb +47 -29
- data/lib/graphiti/resource/configuration.rb +1 -0
- data/lib/graphiti/resource/interface.rb +2 -2
- data/lib/graphiti/resource/remote.rb +2 -2
- data/lib/graphiti/resource/sideloading.rb +1 -1
- data/lib/graphiti/resource.rb +13 -1
- data/lib/graphiti/responders.rb +7 -20
- data/lib/graphiti/schema.rb +5 -1
- data/lib/graphiti/schema_diff.rb +4 -0
- data/lib/graphiti/scope.rb +45 -37
- data/lib/graphiti/serializer.rb +6 -0
- data/lib/graphiti/sideload/belongs_to.rb +38 -5
- data/lib/graphiti/sideload/polymorphic_belongs_to.rb +27 -23
- data/lib/graphiti/sideload.rb +54 -35
- data/lib/graphiti/spec_helpers/errors.rb +73 -0
- data/lib/graphiti/spec_helpers/errors_proxy.rb +75 -0
- data/lib/graphiti/spec_helpers/helpers.rb +107 -0
- data/lib/graphiti/spec_helpers/matchers.rb +196 -0
- data/lib/graphiti/spec_helpers/node.rb +88 -0
- data/lib/graphiti/spec_helpers/rspec.rb +148 -0
- data/lib/graphiti/spec_helpers.rb +54 -0
- data/lib/graphiti/util/include_params.rb +2 -2
- data/lib/graphiti/util/serializer_relationships.rb +41 -5
- data/lib/graphiti/version.rb +1 -1
- data/lib/graphiti-rails.rb +11 -0
- data/lib/graphiti.rb +34 -10
- data/lib/graphiti_errors.rb +11 -0
- data/lib/graphiti_spec_helpers/rspec.rb +3 -0
- data/lib/graphiti_spec_helpers.rb +11 -0
- data/lib/tasks/graphiti.rake +29 -0
- data/package-lock.json +6199 -0
- data/package.json +5 -4
- data/website/.gitignore +20 -0
- data/website/README.md +43 -0
- data/website/docusaurus.config.js +197 -0
- data/website/package-lock.json +19474 -0
- data/website/package.json +46 -0
- data/website/sidebars.js +82 -0
- data/website/src/css/custom.css +85 -0
- data/website/src/pages/markdown-page.mdx +7 -0
- data/website/static/.nojekyll +0 -0
- data/website/static/1.13/2019/03/31/graphiti-1-0.html +205 -0
- data/website/static/1.13/2019/05/08/graphiti-1-1.html +212 -0
- data/website/static/1.13/2019/05/20/graphiti-1-2.html +214 -0
- data/website/static/1.13/2019/10/14/tutorial.html +198 -0
- data/website/static/1.13/CNAME +1 -0
- data/website/static/1.13/README.md +16 -0
- data/website/static/1.13/assets/css/syntax.css +60 -0
- data/website/static/1.13/assets/favicons/android-chrome-192x192.png +0 -0
- data/website/static/1.13/assets/favicons/android-chrome-256x256.png +0 -0
- data/website/static/1.13/assets/favicons/apple-touch-icon.png +0 -0
- data/website/static/1.13/assets/favicons/browserconfig.xml +9 -0
- data/website/static/1.13/assets/favicons/favicon-16x16.png +0 -0
- data/website/static/1.13/assets/favicons/favicon-32x32.png +0 -0
- data/website/static/1.13/assets/favicons/favicon.ico +0 -0
- data/website/static/1.13/assets/favicons/mstile-150x150.png +0 -0
- data/website/static/1.13/assets/favicons/safari-pinned-tab.svg +1 -0
- data/website/static/1.13/assets/favicons/site.webmanifest +19 -0
- data/website/static/1.13/assets/img/backend.gif +0 -0
- data/website/static/1.13/assets/img/conformity.png +0 -0
- data/website/static/1.13/assets/img/error_payload.png +0 -0
- data/website/static/1.13/assets/img/fancy-cushion.png +0 -0
- data/website/static/1.13/assets/img/gh.png +0 -0
- data/website/static/1.13/assets/img/home-bg.jpg +0 -0
- data/website/static/1.13/assets/img/lifecycle.gif +0 -0
- data/website/static/1.13/assets/img/logo-500.png +0 -0
- data/website/static/1.13/assets/img/logo.png +0 -0
- data/website/static/1.13/assets/img/love-graffiti.jpg +0 -0
- data/website/static/1.13/assets/img/meta_total_count.png +0 -0
- data/website/static/1.13/assets/img/persist.jpg +0 -0
- data/website/static/1.13/assets/img/resource.gif +0 -0
- data/website/static/1.13/assets/img/rest-graffiti.jpg +0 -0
- data/website/static/1.13/assets/img/rest1.gif +0 -0
- data/website/static/1.13/assets/img/rest2.gif +0 -0
- data/website/static/1.13/assets/img/rest3.gif +0 -0
- data/website/static/1.13/assets/img/rethink-rest-graffiti.jpg +0 -0
- data/website/static/1.13/assets/img/sunrise.png +0 -0
- data/website/static/1.13/assets/img/why.png +0 -0
- data/website/static/1.13/assets/js/highlight.pack.js +2 -0
- data/website/static/1.13/assets/main.css +15518 -0
- data/website/static/1.13/assets/main.css.map +1 -0
- data/website/static/1.13/bin/bundle +109 -0
- data/website/static/1.13/bin/jekyll +27 -0
- data/website/static/1.13/bin/kramdown +27 -0
- data/website/static/1.13/bin/listen +27 -0
- data/website/static/1.13/bin/rake +27 -0
- data/website/static/1.13/bin/rougify +27 -0
- data/website/static/1.13/bin/safe_yaml +27 -0
- data/website/static/1.13/bin/sass +27 -0
- data/website/static/1.13/bin/sass-convert +27 -0
- data/website/static/1.13/bin/scss +27 -0
- data/website/static/1.13/blog.html +259 -0
- data/website/static/1.13/cheatsheet.html +316 -0
- data/website/static/1.13/cookbooks/authorization.md +0 -0
- data/website/static/1.13/cookbooks/caching.md +0 -0
- data/website/static/1.13/cookbooks/customizing-sideloads.html +325 -0
- data/website/static/1.13/cookbooks/etags.md +0 -0
- data/website/static/1.13/cookbooks/hopping-relationships.html +324 -0
- data/website/static/1.13/cookbooks/json_attributes.md +0 -0
- data/website/static/1.13/cookbooks/openstruct-models.md +0 -0
- data/website/static/1.13/cookbooks/remote-resources.md +0 -0
- data/website/static/1.13/cookbooks/without-activerecord.html +510 -0
- data/website/static/1.13/features.html +249 -0
- data/website/static/1.13/feed.xml +106 -0
- data/website/static/1.13/guides/concepts/backends-and-models.html +467 -0
- data/website/static/1.13/guides/concepts/debugging.html +440 -0
- data/website/static/1.13/guides/concepts/endpoints.html +432 -0
- data/website/static/1.13/guides/concepts/error-handling.html +396 -0
- data/website/static/1.13/guides/concepts/links.html +501 -0
- data/website/static/1.13/guides/concepts/remote-resources.html +536 -0
- data/website/static/1.13/guides/concepts/resources.html +2176 -0
- data/website/static/1.13/guides/concepts/testing.html +1469 -0
- data/website/static/1.13/guides/getting-started/installation.html +420 -0
- data/website/static/1.13/guides/graphiti-rails-migration.html +242 -0
- data/website/static/1.13/guides/index.html +269 -0
- data/website/static/1.13/guides/overview.html +325 -0
- data/website/static/1.13/guides/upgrading-2-0.html +193 -0
- data/website/static/1.13/guides/upgrading.html +314 -0
- data/website/static/1.13/guides/vandal.html +282 -0
- data/website/static/1.13/guides/why.html +1121 -0
- data/website/static/1.13/index.html +72 -0
- data/website/static/1.13/js/authentication.html +295 -0
- data/website/static/1.13/js/ddau.html +238 -0
- data/website/static/1.13/js/extra-params.html +270 -0
- data/website/static/1.13/js/index.html +321 -0
- data/website/static/1.13/js/installation.html +637 -0
- data/website/static/1.13/js/introduction.html +257 -0
- data/website/static/1.13/js/middleware.html +318 -0
- data/website/static/1.13/js/reads/fieldsets.html +271 -0
- data/website/static/1.13/js/reads/filtering.html +289 -0
- data/website/static/1.13/js/reads/includes.html +260 -0
- data/website/static/1.13/js/reads/index.html +497 -0
- data/website/static/1.13/js/reads/nested-queries.html +353 -0
- data/website/static/1.13/js/reads/pagination.html +260 -0
- data/website/static/1.13/js/reads/sorting.html +265 -0
- data/website/static/1.13/js/reads/statistics.html +289 -0
- data/website/static/1.13/js/state-syncing.html +340 -0
- data/website/static/1.13/js/writes/deferred.html +296 -0
- data/website/static/1.13/js/writes/dirty-tracking.html +399 -0
- data/website/static/1.13/js/writes/index.html +391 -0
- data/website/static/1.13/js/writes/nested.html +330 -0
- data/website/static/1.13/js/writes/validations.html +272 -0
- data/website/static/1.13/quickstart.html +660 -0
- data/website/static/1.13/template +161 -0
- data/website/static/1.13/tutorial/index.html +250 -0
- data/website/static/1.13/tutorial/step_0.html +292 -0
- data/website/static/1.13/tutorial/step_1.html +517 -0
- data/website/static/1.13/tutorial/step_2.html +481 -0
- data/website/static/1.13/tutorial/step_3.html +323 -0
- data/website/static/1.13/tutorial/step_4.html +318 -0
- data/website/static/1.13/tutorial/step_5.html +265 -0
- data/website/static/1.13/tutorial/step_6.html +276 -0
- data/website/static/1.13/tutorial/step_7.html +390 -0
- data/website/static/1.13/tutorial/step_8.html +316 -0
- data/website/static/1.13/tutorial/step_9.html +365 -0
- data/website/static/CNAME +1 -0
- data/website/static/assets/img/error_payload.png +0 -0
- data/website/static/assets/img/legacy/legacy-0378a3bb39.png +0 -0
- data/website/static/assets/img/legacy/legacy-05bbd3e5fd.png +0 -0
- data/website/static/assets/img/legacy/legacy-07aa104495.png +0 -0
- data/website/static/assets/img/legacy/legacy-0c75a16b3a.gif +0 -0
- data/website/static/assets/img/legacy/legacy-3076df6209.png +0 -0
- data/website/static/assets/img/legacy/legacy-7f6889bc89.png +0 -0
- data/website/static/assets/img/legacy/legacy-a2cc4363c3.png +0 -0
- data/website/static/assets/img/legacy/legacy-f67cfa89ab.png +0 -0
- data/website/static/assets/img/meta_total_count.png +0 -0
- data/website/static/img/docusaurus-social-card.jpg +0 -0
- data/website/static/img/docusaurus.png +0 -0
- data/website/static/img/favicon.ico +0 -0
- data/website/static/img/logo.png +0 -0
- data/website/static/img/logo.svg +1 -0
- data/website/static/img/undraw_docusaurus_mountain.svg +171 -0
- data/website/static/img/undraw_docusaurus_react.svg +170 -0
- data/website/static/img/undraw_docusaurus_tree.svg +40 -0
- metadata +251 -54
- data/gemfiles/rails_6.gemfile +0 -18
- data/gemfiles/rails_6_graphiti_rails.gemfile +0 -19
- data/gemfiles/rails_7.gemfile +0 -18
- data/gemfiles/rails_7_1_graphiti_rails.gemfile +0 -19
- data/gemfiles/rails_7_graphiti_rails.gemfile +0 -19
- data/lib/graphiti/deprecated_tasks.rb +0 -49
- data/lib/graphiti/railtie.rb +0 -121
- /data/{deprecated_generators → lib/generators}/graphiti/resource_test_generator.rb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/application_resource.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/create_request_spec.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/destroy_request_spec.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/resource.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/resource_writes_spec.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/update_request_spec.rb.erb +0 -0
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: graphiti
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.0.beta.
|
|
4
|
+
version: 2.0.0.beta.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lee Richmond
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: jsonapi-serializable
|
|
@@ -65,19 +64,19 @@ dependencies:
|
|
|
65
64
|
- !ruby/object:Gem::Version
|
|
66
65
|
version: '2.0'
|
|
67
66
|
- !ruby/object:Gem::Dependency
|
|
68
|
-
name:
|
|
67
|
+
name: rescue_registry
|
|
69
68
|
requirement: !ruby/object:Gem::Requirement
|
|
70
69
|
requirements:
|
|
71
70
|
- - "~>"
|
|
72
71
|
- !ruby/object:Gem::Version
|
|
73
|
-
version: 1.
|
|
72
|
+
version: '1.0'
|
|
74
73
|
type: :runtime
|
|
75
74
|
prerelease: false
|
|
76
75
|
version_requirements: !ruby/object:Gem::Requirement
|
|
77
76
|
requirements:
|
|
78
77
|
- - "~>"
|
|
79
78
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: 1.
|
|
79
|
+
version: '1.0'
|
|
81
80
|
- !ruby/object:Gem::Dependency
|
|
82
81
|
name: concurrent-ruby
|
|
83
82
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -104,14 +103,14 @@ dependencies:
|
|
|
104
103
|
requirements:
|
|
105
104
|
- - ">="
|
|
106
105
|
- !ruby/object:Gem::Version
|
|
107
|
-
version: '
|
|
106
|
+
version: '7.1'
|
|
108
107
|
type: :runtime
|
|
109
108
|
prerelease: false
|
|
110
109
|
version_requirements: !ruby/object:Gem::Requirement
|
|
111
110
|
requirements:
|
|
112
111
|
- - ">="
|
|
113
112
|
- !ruby/object:Gem::Version
|
|
114
|
-
version: '
|
|
113
|
+
version: '7.1'
|
|
115
114
|
- !ruby/object:Gem::Dependency
|
|
116
115
|
name: ostruct
|
|
117
116
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -202,29 +201,28 @@ dependencies:
|
|
|
202
201
|
requirements:
|
|
203
202
|
- - ">="
|
|
204
203
|
- !ruby/object:Gem::Version
|
|
205
|
-
version: '
|
|
204
|
+
version: '7.1'
|
|
206
205
|
type: :development
|
|
207
206
|
prerelease: false
|
|
208
207
|
version_requirements: !ruby/object:Gem::Requirement
|
|
209
208
|
requirements:
|
|
210
209
|
- - ">="
|
|
211
210
|
- !ruby/object:Gem::Version
|
|
212
|
-
version: '
|
|
211
|
+
version: '7.1'
|
|
213
212
|
- !ruby/object:Gem::Dependency
|
|
214
|
-
name:
|
|
213
|
+
name: rspec
|
|
215
214
|
requirement: !ruby/object:Gem::Requirement
|
|
216
215
|
requirements:
|
|
217
|
-
- -
|
|
216
|
+
- - "~>"
|
|
218
217
|
- !ruby/object:Gem::Version
|
|
219
|
-
version:
|
|
218
|
+
version: '3.0'
|
|
220
219
|
type: :development
|
|
221
220
|
prerelease: false
|
|
222
221
|
version_requirements: !ruby/object:Gem::Requirement
|
|
223
222
|
requirements:
|
|
224
|
-
- -
|
|
223
|
+
- - "~>"
|
|
225
224
|
- !ruby/object:Gem::Version
|
|
226
|
-
version:
|
|
227
|
-
description:
|
|
225
|
+
version: '3.0'
|
|
228
226
|
email:
|
|
229
227
|
- richmolj@gmail.com
|
|
230
228
|
executables:
|
|
@@ -234,8 +232,10 @@ extra_rdoc_files: []
|
|
|
234
232
|
files:
|
|
235
233
|
- ".github/probots.yml"
|
|
236
234
|
- ".github/workflows/ci.yml"
|
|
235
|
+
- ".github/workflows/docs.yml"
|
|
237
236
|
- ".github/workflows/release.yml"
|
|
238
237
|
- ".gitignore"
|
|
238
|
+
- ".npmrc"
|
|
239
239
|
- ".rspec"
|
|
240
240
|
- ".ruby-version"
|
|
241
241
|
- ".standard.yml"
|
|
@@ -255,33 +255,75 @@ files:
|
|
|
255
255
|
- bin/console
|
|
256
256
|
- bin/rspec
|
|
257
257
|
- bin/setup
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
258
|
+
- docs/concepts/backends-and-models.md
|
|
259
|
+
- docs/concepts/endpoints.md
|
|
260
|
+
- docs/concepts/links.md
|
|
261
|
+
- docs/concepts/overview.md
|
|
262
|
+
- docs/concepts/persisting.md
|
|
263
|
+
- docs/concepts/relationships.md
|
|
264
|
+
- docs/concepts/resources.md
|
|
265
|
+
- docs/getting-started/first-api.md
|
|
266
|
+
- docs/getting-started/installation.md
|
|
267
|
+
- docs/intro.md
|
|
268
|
+
- docs/js/authentication.md
|
|
269
|
+
- docs/js/ddau.md
|
|
270
|
+
- docs/js/extra-params.md
|
|
271
|
+
- docs/js/index.md
|
|
272
|
+
- docs/js/installation.md
|
|
273
|
+
- docs/js/middleware.md
|
|
274
|
+
- docs/js/models.md
|
|
275
|
+
- docs/js/reads.md
|
|
276
|
+
- docs/js/state-syncing.md
|
|
277
|
+
- docs/js/writes.md
|
|
278
|
+
- docs/reference/vandal.md
|
|
279
|
+
- docs/reference/why.md
|
|
280
|
+
- docs/topics/authorization.md
|
|
281
|
+
- docs/topics/caching.md
|
|
282
|
+
- docs/topics/customizing-sideloads.md
|
|
283
|
+
- docs/topics/debugging.md
|
|
284
|
+
- docs/topics/error-handling.md
|
|
285
|
+
- docs/topics/etags.md
|
|
286
|
+
- docs/topics/hopping-relationships.md
|
|
287
|
+
- docs/topics/json-attributes.md
|
|
288
|
+
- docs/topics/openstruct-models.md
|
|
289
|
+
- docs/topics/remote-resources.md
|
|
290
|
+
- docs/topics/testing.md
|
|
291
|
+
- docs/topics/without-activerecord.md
|
|
292
|
+
- docs/tutorial/index.md
|
|
293
|
+
- docs/tutorial/step_0.md
|
|
294
|
+
- docs/tutorial/step_1.md
|
|
295
|
+
- docs/tutorial/step_2.md
|
|
296
|
+
- docs/tutorial/step_3.md
|
|
297
|
+
- docs/tutorial/step_4.md
|
|
298
|
+
- docs/tutorial/step_5.md
|
|
299
|
+
- docs/tutorial/step_6.md
|
|
300
|
+
- docs/tutorial/step_7.md
|
|
301
|
+
- docs/tutorial/step_8.md
|
|
302
|
+
- docs/tutorial/step_9.md
|
|
303
|
+
- docs/upgrading.md
|
|
273
304
|
- exe/graphiti
|
|
274
305
|
- gemfiles/.bundle/config
|
|
275
|
-
- gemfiles/rails_6.gemfile
|
|
276
|
-
- gemfiles/rails_6_graphiti_rails.gemfile
|
|
277
|
-
- gemfiles/rails_7.gemfile
|
|
278
306
|
- gemfiles/rails_7_1.gemfile
|
|
279
|
-
- gemfiles/
|
|
280
|
-
- gemfiles/
|
|
281
|
-
- gemfiles/
|
|
282
|
-
- gemfiles/rails_8_0_graphiti_rails.gemfile
|
|
283
|
-
- gemfiles/rails_8_1_graphiti_rails.gemfile
|
|
307
|
+
- gemfiles/rails_7_2.gemfile
|
|
308
|
+
- gemfiles/rails_8_0.gemfile
|
|
309
|
+
- gemfiles/rails_8_1.gemfile
|
|
284
310
|
- graphiti.gemspec
|
|
311
|
+
- lib/generators/graphiti/api_test_generator.rb
|
|
312
|
+
- lib/generators/graphiti/generator_mixin.rb
|
|
313
|
+
- lib/generators/graphiti/install_generator.rb
|
|
314
|
+
- lib/generators/graphiti/resource_generator.rb
|
|
315
|
+
- lib/generators/graphiti/resource_test_generator.rb
|
|
316
|
+
- lib/generators/graphiti/templates/application_resource.rb.erb
|
|
317
|
+
- lib/generators/graphiti/templates/controller.rb.erb
|
|
318
|
+
- lib/generators/graphiti/templates/create_request_spec.rb.erb
|
|
319
|
+
- lib/generators/graphiti/templates/destroy_request_spec.rb.erb
|
|
320
|
+
- lib/generators/graphiti/templates/index_request_spec.rb.erb
|
|
321
|
+
- lib/generators/graphiti/templates/resource.rb.erb
|
|
322
|
+
- lib/generators/graphiti/templates/resource_reads_spec.rb.erb
|
|
323
|
+
- lib/generators/graphiti/templates/resource_writes_spec.rb.erb
|
|
324
|
+
- lib/generators/graphiti/templates/show_request_spec.rb.erb
|
|
325
|
+
- lib/generators/graphiti/templates/update_request_spec.rb.erb
|
|
326
|
+
- lib/graphiti-rails.rb
|
|
285
327
|
- lib/graphiti.rb
|
|
286
328
|
- lib/graphiti/adapters/abstract.rb
|
|
287
329
|
- lib/graphiti/adapters/active_record.rb
|
|
@@ -298,8 +340,11 @@ files:
|
|
|
298
340
|
- lib/graphiti/context.rb
|
|
299
341
|
- lib/graphiti/debugger.rb
|
|
300
342
|
- lib/graphiti/delegates/pagination.rb
|
|
301
|
-
- lib/graphiti/deprecated_tasks.rb
|
|
302
343
|
- lib/graphiti/deserializer.rb
|
|
344
|
+
- lib/graphiti/error_serializers/conflict_request.rb
|
|
345
|
+
- lib/graphiti/error_serializers/deprecated_constants.rb
|
|
346
|
+
- lib/graphiti/error_serializers/invalid_request.rb
|
|
347
|
+
- lib/graphiti/error_serializers/validation.rb
|
|
303
348
|
- lib/graphiti/errors.rb
|
|
304
349
|
- lib/graphiti/extensions/boolean_attribute.rb
|
|
305
350
|
- lib/graphiti/extensions/extra_attribute.rb
|
|
@@ -309,7 +354,14 @@ files:
|
|
|
309
354
|
- lib/graphiti/jsonapi_serializable_ext.rb
|
|
310
355
|
- lib/graphiti/query.rb
|
|
311
356
|
- lib/graphiti/rails.rb
|
|
312
|
-
- lib/graphiti/
|
|
357
|
+
- lib/graphiti/rails/context.rb
|
|
358
|
+
- lib/graphiti/rails/controller.rb
|
|
359
|
+
- lib/graphiti/rails/debugging.rb
|
|
360
|
+
- lib/graphiti/rails/exception_handlers.rb
|
|
361
|
+
- lib/graphiti/rails/railtie.rb
|
|
362
|
+
- lib/graphiti/rails/rake_helpers.rb
|
|
363
|
+
- lib/graphiti/rails/responders.rb
|
|
364
|
+
- lib/graphiti/rails/test_helpers.rb
|
|
313
365
|
- lib/graphiti/renderer.rb
|
|
314
366
|
- lib/graphiti/request_validator.rb
|
|
315
367
|
- lib/graphiti/request_validators/update_validator.rb
|
|
@@ -345,6 +397,13 @@ files:
|
|
|
345
397
|
- lib/graphiti/sideload/has_one.rb
|
|
346
398
|
- lib/graphiti/sideload/many_to_many.rb
|
|
347
399
|
- lib/graphiti/sideload/polymorphic_belongs_to.rb
|
|
400
|
+
- lib/graphiti/spec_helpers.rb
|
|
401
|
+
- lib/graphiti/spec_helpers/errors.rb
|
|
402
|
+
- lib/graphiti/spec_helpers/errors_proxy.rb
|
|
403
|
+
- lib/graphiti/spec_helpers/helpers.rb
|
|
404
|
+
- lib/graphiti/spec_helpers/matchers.rb
|
|
405
|
+
- lib/graphiti/spec_helpers/node.rb
|
|
406
|
+
- lib/graphiti/spec_helpers/rspec.rb
|
|
348
407
|
- lib/graphiti/stats/dsl.rb
|
|
349
408
|
- lib/graphiti/stats/payload.rb
|
|
350
409
|
- lib/graphiti/types.rb
|
|
@@ -367,19 +426,158 @@ files:
|
|
|
367
426
|
- lib/graphiti/util/uri_decoder.rb
|
|
368
427
|
- lib/graphiti/util/validation_response.rb
|
|
369
428
|
- lib/graphiti/version.rb
|
|
429
|
+
- lib/graphiti_errors.rb
|
|
430
|
+
- lib/graphiti_spec_helpers.rb
|
|
431
|
+
- lib/graphiti_spec_helpers/rspec.rb
|
|
432
|
+
- lib/tasks/graphiti.rake
|
|
433
|
+
- package-lock.json
|
|
370
434
|
- package.json
|
|
435
|
+
- website/.gitignore
|
|
436
|
+
- website/README.md
|
|
437
|
+
- website/docusaurus.config.js
|
|
438
|
+
- website/package-lock.json
|
|
439
|
+
- website/package.json
|
|
440
|
+
- website/sidebars.js
|
|
441
|
+
- website/src/css/custom.css
|
|
442
|
+
- website/src/pages/markdown-page.mdx
|
|
443
|
+
- website/static/.nojekyll
|
|
444
|
+
- website/static/1.13/2019/03/31/graphiti-1-0.html
|
|
445
|
+
- website/static/1.13/2019/05/08/graphiti-1-1.html
|
|
446
|
+
- website/static/1.13/2019/05/20/graphiti-1-2.html
|
|
447
|
+
- website/static/1.13/2019/10/14/tutorial.html
|
|
448
|
+
- website/static/1.13/CNAME
|
|
449
|
+
- website/static/1.13/README.md
|
|
450
|
+
- website/static/1.13/assets/css/syntax.css
|
|
451
|
+
- website/static/1.13/assets/favicons/android-chrome-192x192.png
|
|
452
|
+
- website/static/1.13/assets/favicons/android-chrome-256x256.png
|
|
453
|
+
- website/static/1.13/assets/favicons/apple-touch-icon.png
|
|
454
|
+
- website/static/1.13/assets/favicons/browserconfig.xml
|
|
455
|
+
- website/static/1.13/assets/favicons/favicon-16x16.png
|
|
456
|
+
- website/static/1.13/assets/favicons/favicon-32x32.png
|
|
457
|
+
- website/static/1.13/assets/favicons/favicon.ico
|
|
458
|
+
- website/static/1.13/assets/favicons/mstile-150x150.png
|
|
459
|
+
- website/static/1.13/assets/favicons/safari-pinned-tab.svg
|
|
460
|
+
- website/static/1.13/assets/favicons/site.webmanifest
|
|
461
|
+
- website/static/1.13/assets/img/backend.gif
|
|
462
|
+
- website/static/1.13/assets/img/conformity.png
|
|
463
|
+
- website/static/1.13/assets/img/error_payload.png
|
|
464
|
+
- website/static/1.13/assets/img/fancy-cushion.png
|
|
465
|
+
- website/static/1.13/assets/img/gh.png
|
|
466
|
+
- website/static/1.13/assets/img/home-bg.jpg
|
|
467
|
+
- website/static/1.13/assets/img/lifecycle.gif
|
|
468
|
+
- website/static/1.13/assets/img/logo-500.png
|
|
469
|
+
- website/static/1.13/assets/img/logo.png
|
|
470
|
+
- website/static/1.13/assets/img/love-graffiti.jpg
|
|
471
|
+
- website/static/1.13/assets/img/meta_total_count.png
|
|
472
|
+
- website/static/1.13/assets/img/persist.jpg
|
|
473
|
+
- website/static/1.13/assets/img/resource.gif
|
|
474
|
+
- website/static/1.13/assets/img/rest-graffiti.jpg
|
|
475
|
+
- website/static/1.13/assets/img/rest1.gif
|
|
476
|
+
- website/static/1.13/assets/img/rest2.gif
|
|
477
|
+
- website/static/1.13/assets/img/rest3.gif
|
|
478
|
+
- website/static/1.13/assets/img/rethink-rest-graffiti.jpg
|
|
479
|
+
- website/static/1.13/assets/img/sunrise.png
|
|
480
|
+
- website/static/1.13/assets/img/why.png
|
|
481
|
+
- website/static/1.13/assets/js/highlight.pack.js
|
|
482
|
+
- website/static/1.13/assets/main.css
|
|
483
|
+
- website/static/1.13/assets/main.css.map
|
|
484
|
+
- website/static/1.13/bin/bundle
|
|
485
|
+
- website/static/1.13/bin/jekyll
|
|
486
|
+
- website/static/1.13/bin/kramdown
|
|
487
|
+
- website/static/1.13/bin/listen
|
|
488
|
+
- website/static/1.13/bin/rake
|
|
489
|
+
- website/static/1.13/bin/rougify
|
|
490
|
+
- website/static/1.13/bin/safe_yaml
|
|
491
|
+
- website/static/1.13/bin/sass
|
|
492
|
+
- website/static/1.13/bin/sass-convert
|
|
493
|
+
- website/static/1.13/bin/scss
|
|
494
|
+
- website/static/1.13/blog.html
|
|
495
|
+
- website/static/1.13/cheatsheet.html
|
|
496
|
+
- website/static/1.13/cookbooks/authorization.md
|
|
497
|
+
- website/static/1.13/cookbooks/caching.md
|
|
498
|
+
- website/static/1.13/cookbooks/customizing-sideloads.html
|
|
499
|
+
- website/static/1.13/cookbooks/etags.md
|
|
500
|
+
- website/static/1.13/cookbooks/hopping-relationships.html
|
|
501
|
+
- website/static/1.13/cookbooks/json_attributes.md
|
|
502
|
+
- website/static/1.13/cookbooks/openstruct-models.md
|
|
503
|
+
- website/static/1.13/cookbooks/remote-resources.md
|
|
504
|
+
- website/static/1.13/cookbooks/without-activerecord.html
|
|
505
|
+
- website/static/1.13/features.html
|
|
506
|
+
- website/static/1.13/feed.xml
|
|
507
|
+
- website/static/1.13/guides/concepts/backends-and-models.html
|
|
508
|
+
- website/static/1.13/guides/concepts/debugging.html
|
|
509
|
+
- website/static/1.13/guides/concepts/endpoints.html
|
|
510
|
+
- website/static/1.13/guides/concepts/error-handling.html
|
|
511
|
+
- website/static/1.13/guides/concepts/links.html
|
|
512
|
+
- website/static/1.13/guides/concepts/remote-resources.html
|
|
513
|
+
- website/static/1.13/guides/concepts/resources.html
|
|
514
|
+
- website/static/1.13/guides/concepts/testing.html
|
|
515
|
+
- website/static/1.13/guides/getting-started/installation.html
|
|
516
|
+
- website/static/1.13/guides/graphiti-rails-migration.html
|
|
517
|
+
- website/static/1.13/guides/index.html
|
|
518
|
+
- website/static/1.13/guides/overview.html
|
|
519
|
+
- website/static/1.13/guides/upgrading-2-0.html
|
|
520
|
+
- website/static/1.13/guides/upgrading.html
|
|
521
|
+
- website/static/1.13/guides/vandal.html
|
|
522
|
+
- website/static/1.13/guides/why.html
|
|
523
|
+
- website/static/1.13/index.html
|
|
524
|
+
- website/static/1.13/js/authentication.html
|
|
525
|
+
- website/static/1.13/js/ddau.html
|
|
526
|
+
- website/static/1.13/js/extra-params.html
|
|
527
|
+
- website/static/1.13/js/index.html
|
|
528
|
+
- website/static/1.13/js/installation.html
|
|
529
|
+
- website/static/1.13/js/introduction.html
|
|
530
|
+
- website/static/1.13/js/middleware.html
|
|
531
|
+
- website/static/1.13/js/reads/fieldsets.html
|
|
532
|
+
- website/static/1.13/js/reads/filtering.html
|
|
533
|
+
- website/static/1.13/js/reads/includes.html
|
|
534
|
+
- website/static/1.13/js/reads/index.html
|
|
535
|
+
- website/static/1.13/js/reads/nested-queries.html
|
|
536
|
+
- website/static/1.13/js/reads/pagination.html
|
|
537
|
+
- website/static/1.13/js/reads/sorting.html
|
|
538
|
+
- website/static/1.13/js/reads/statistics.html
|
|
539
|
+
- website/static/1.13/js/state-syncing.html
|
|
540
|
+
- website/static/1.13/js/writes/deferred.html
|
|
541
|
+
- website/static/1.13/js/writes/dirty-tracking.html
|
|
542
|
+
- website/static/1.13/js/writes/index.html
|
|
543
|
+
- website/static/1.13/js/writes/nested.html
|
|
544
|
+
- website/static/1.13/js/writes/validations.html
|
|
545
|
+
- website/static/1.13/quickstart.html
|
|
546
|
+
- website/static/1.13/template
|
|
547
|
+
- website/static/1.13/tutorial/index.html
|
|
548
|
+
- website/static/1.13/tutorial/step_0.html
|
|
549
|
+
- website/static/1.13/tutorial/step_1.html
|
|
550
|
+
- website/static/1.13/tutorial/step_2.html
|
|
551
|
+
- website/static/1.13/tutorial/step_3.html
|
|
552
|
+
- website/static/1.13/tutorial/step_4.html
|
|
553
|
+
- website/static/1.13/tutorial/step_5.html
|
|
554
|
+
- website/static/1.13/tutorial/step_6.html
|
|
555
|
+
- website/static/1.13/tutorial/step_7.html
|
|
556
|
+
- website/static/1.13/tutorial/step_8.html
|
|
557
|
+
- website/static/1.13/tutorial/step_9.html
|
|
558
|
+
- website/static/CNAME
|
|
559
|
+
- website/static/assets/img/error_payload.png
|
|
560
|
+
- website/static/assets/img/legacy/legacy-0378a3bb39.png
|
|
561
|
+
- website/static/assets/img/legacy/legacy-05bbd3e5fd.png
|
|
562
|
+
- website/static/assets/img/legacy/legacy-07aa104495.png
|
|
563
|
+
- website/static/assets/img/legacy/legacy-0c75a16b3a.gif
|
|
564
|
+
- website/static/assets/img/legacy/legacy-3076df6209.png
|
|
565
|
+
- website/static/assets/img/legacy/legacy-7f6889bc89.png
|
|
566
|
+
- website/static/assets/img/legacy/legacy-a2cc4363c3.png
|
|
567
|
+
- website/static/assets/img/legacy/legacy-f67cfa89ab.png
|
|
568
|
+
- website/static/assets/img/meta_total_count.png
|
|
569
|
+
- website/static/img/docusaurus-social-card.jpg
|
|
570
|
+
- website/static/img/docusaurus.png
|
|
571
|
+
- website/static/img/favicon.ico
|
|
572
|
+
- website/static/img/logo.png
|
|
573
|
+
- website/static/img/logo.svg
|
|
574
|
+
- website/static/img/undraw_docusaurus_mountain.svg
|
|
575
|
+
- website/static/img/undraw_docusaurus_react.svg
|
|
576
|
+
- website/static/img/undraw_docusaurus_tree.svg
|
|
371
577
|
homepage: https://github.com/graphiti-api/graphiti
|
|
372
578
|
licenses:
|
|
373
579
|
- MIT
|
|
374
580
|
metadata: {}
|
|
375
|
-
post_install_message: "Graphiti: relationship readable:/writable: guards are now enforced.\n\nSymbols,
|
|
376
|
-
strings, and procs passed to a relationship's readable/writable\nguards were always
|
|
377
|
-
interpreted as true and never actually called before this\nconditional relationship
|
|
378
|
-
change. They are now evaluated per-request, where\nunreadable relationships are
|
|
379
|
-
omitted from responses and includes, and unwritable\nrelationships reject writes.\n\nTo
|
|
380
|
-
list every affected relationship in your app:\n\n bin/rails runner 'puts Graphiti.guarded_relationships'\n\nAudit
|
|
381
|
-
these before deploying. Apps using schema.json will also see affected \nrelationships
|
|
382
|
-
flagged as \"became guarded\" by the schema check.\n"
|
|
383
581
|
rdoc_options: []
|
|
384
582
|
require_paths:
|
|
385
583
|
- lib
|
|
@@ -387,15 +585,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
387
585
|
requirements:
|
|
388
586
|
- - ">="
|
|
389
587
|
- !ruby/object:Gem::Version
|
|
390
|
-
version: '3.
|
|
588
|
+
version: '3.2'
|
|
391
589
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
392
590
|
requirements:
|
|
393
|
-
- - "
|
|
591
|
+
- - ">="
|
|
394
592
|
- !ruby/object:Gem::Version
|
|
395
|
-
version:
|
|
593
|
+
version: '0'
|
|
396
594
|
requirements: []
|
|
397
|
-
rubygems_version: 3.
|
|
398
|
-
signing_key:
|
|
595
|
+
rubygems_version: 3.6.9
|
|
399
596
|
specification_version: 4
|
|
400
597
|
summary: Easily build jsonapi.org-compatible APIs
|
|
401
598
|
test_files: []
|
data/gemfiles/rails_6.gemfile
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# This file was generated by Appraisal
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem "rails", "~> 6.0"
|
|
6
|
-
gem "rspec-rails"
|
|
7
|
-
gem "sqlite3", "~> 1.4.0"
|
|
8
|
-
gem "database_cleaner"
|
|
9
|
-
|
|
10
|
-
group :test do
|
|
11
|
-
gem "pry"
|
|
12
|
-
gem "pry-byebug", platform: [:mri]
|
|
13
|
-
gem "appraisal"
|
|
14
|
-
gem "guard"
|
|
15
|
-
gem "guard-rspec"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
gemspec path: "../"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# This file was generated by Appraisal
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem "rails", "~> 6.0"
|
|
6
|
-
gem "rspec-rails"
|
|
7
|
-
gem "sqlite3", "~> 1.4.0"
|
|
8
|
-
gem "database_cleaner"
|
|
9
|
-
gem "graphiti-rails", "~> 0.4.0"
|
|
10
|
-
|
|
11
|
-
group :test do
|
|
12
|
-
gem "pry"
|
|
13
|
-
gem "pry-byebug", platform: [:mri]
|
|
14
|
-
gem "appraisal"
|
|
15
|
-
gem "guard"
|
|
16
|
-
gem "guard-rspec"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
gemspec path: "../"
|
data/gemfiles/rails_7.gemfile
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# This file was generated by Appraisal
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem "rails", "~> 7.0"
|
|
6
|
-
gem "rspec-rails"
|
|
7
|
-
gem "sqlite3", "~> 1.4.0"
|
|
8
|
-
gem "database_cleaner"
|
|
9
|
-
|
|
10
|
-
group :test do
|
|
11
|
-
gem "pry"
|
|
12
|
-
gem "pry-byebug", platform: [:mri]
|
|
13
|
-
gem "appraisal"
|
|
14
|
-
gem "guard"
|
|
15
|
-
gem "guard-rspec"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
gemspec path: "../"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# This file was generated by Appraisal
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem "rails", "~> 7.1"
|
|
6
|
-
gem "rspec-rails"
|
|
7
|
-
gem "sqlite3", "~> 1.4.0"
|
|
8
|
-
gem "database_cleaner"
|
|
9
|
-
gem "graphiti-rails", "~> 0.4.0"
|
|
10
|
-
|
|
11
|
-
group :test do
|
|
12
|
-
gem "pry"
|
|
13
|
-
gem "pry-byebug", platform: [:mri]
|
|
14
|
-
gem "appraisal"
|
|
15
|
-
gem "guard"
|
|
16
|
-
gem "guard-rspec"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
gemspec path: "../"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# This file was generated by Appraisal
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem "rails", "~> 7.0"
|
|
6
|
-
gem "rspec-rails"
|
|
7
|
-
gem "sqlite3", "~> 1.4.0"
|
|
8
|
-
gem "database_cleaner"
|
|
9
|
-
gem "graphiti-rails", "~> 0.4.0"
|
|
10
|
-
|
|
11
|
-
group :test do
|
|
12
|
-
gem "pry"
|
|
13
|
-
gem "pry-byebug", platform: [:mri]
|
|
14
|
-
gem "appraisal"
|
|
15
|
-
gem "guard"
|
|
16
|
-
gem "guard-rspec"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
gemspec path: "../"
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
namespace :graphiti do
|
|
2
|
-
def session
|
|
3
|
-
@session ||= ActionDispatch::Integration::Session.new(Rails.application)
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
def setup_rails!
|
|
7
|
-
Rails.application.eager_load!
|
|
8
|
-
Rails.application.config.cache_classes = true
|
|
9
|
-
Rails.application.config.action_controller.perform_caching = false
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def make_request(path, debug = false)
|
|
13
|
-
if path.split("/").length == 2
|
|
14
|
-
path = "#{ApplicationResource.endpoint_namespace}#{path}"
|
|
15
|
-
end
|
|
16
|
-
path << if path.include?("?")
|
|
17
|
-
"&cache=bust"
|
|
18
|
-
else
|
|
19
|
-
"?cache=bust"
|
|
20
|
-
end
|
|
21
|
-
path = "#{path}&debug=true" if debug
|
|
22
|
-
session.get(path.to_s)
|
|
23
|
-
JSON.parse(session.response.body)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
desc "Execute request without web server."
|
|
27
|
-
task :request, [:path, :debug] => [:environment] do |_, args|
|
|
28
|
-
setup_rails!
|
|
29
|
-
Graphiti.logger = Graphiti.stdout_logger
|
|
30
|
-
Graphiti::Debugger.preserve = true
|
|
31
|
-
require "pp"
|
|
32
|
-
path, debug = args[:path], args[:debug]
|
|
33
|
-
puts "Graphiti Request: #{path}"
|
|
34
|
-
json = make_request(path, debug)
|
|
35
|
-
pp json
|
|
36
|
-
Graphiti::Debugger.flush if debug
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
desc "Execute benchmark without web server."
|
|
40
|
-
task :benchmark, [:path, :requests] => [:environment] do |_, args|
|
|
41
|
-
setup_rails!
|
|
42
|
-
took = Benchmark.ms {
|
|
43
|
-
args[:requests].to_i.times do
|
|
44
|
-
make_request(args[:path])
|
|
45
|
-
end
|
|
46
|
-
}
|
|
47
|
-
puts "Took: #{(took / args[:requests].to_f).round(2)}ms"
|
|
48
|
-
end
|
|
49
|
-
end
|