graphiti 2.0.0.beta.2 → 2.0.0.beta.4
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 +60 -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 +41 -0
- data/README.md +13 -2
- data/UPGRADING.md +2 -68
- 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 +265 -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 -5
- 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 +43 -6
- 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 -23
- 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/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/persistence.rb +14 -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/node.rb +88 -0
- data/lib/graphiti/spec_helpers/rspec.rb +147 -0
- data/lib/graphiti/spec_helpers.rb +53 -0
- data/lib/graphiti/util/include_params.rb +2 -2
- data/lib/graphiti/util/persistence.rb +10 -11
- 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/{graphiti/deprecated_tasks.rb → tasks/graphiti.rake} +6 -1
- 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 +141 -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 +58 -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/gh.png +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/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/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 +245 -46
- 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/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/controller.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.4
|
|
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,13 @@ 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/responders.rb
|
|
363
|
+
- lib/graphiti/rails/test_helpers.rb
|
|
313
364
|
- lib/graphiti/renderer.rb
|
|
314
365
|
- lib/graphiti/request_validator.rb
|
|
315
366
|
- lib/graphiti/request_validators/update_validator.rb
|
|
@@ -345,6 +396,12 @@ files:
|
|
|
345
396
|
- lib/graphiti/sideload/has_one.rb
|
|
346
397
|
- lib/graphiti/sideload/many_to_many.rb
|
|
347
398
|
- lib/graphiti/sideload/polymorphic_belongs_to.rb
|
|
399
|
+
- lib/graphiti/spec_helpers.rb
|
|
400
|
+
- lib/graphiti/spec_helpers/errors.rb
|
|
401
|
+
- lib/graphiti/spec_helpers/errors_proxy.rb
|
|
402
|
+
- lib/graphiti/spec_helpers/helpers.rb
|
|
403
|
+
- lib/graphiti/spec_helpers/node.rb
|
|
404
|
+
- lib/graphiti/spec_helpers/rspec.rb
|
|
348
405
|
- lib/graphiti/stats/dsl.rb
|
|
349
406
|
- lib/graphiti/stats/payload.rb
|
|
350
407
|
- lib/graphiti/types.rb
|
|
@@ -367,7 +424,150 @@ files:
|
|
|
367
424
|
- lib/graphiti/util/uri_decoder.rb
|
|
368
425
|
- lib/graphiti/util/validation_response.rb
|
|
369
426
|
- lib/graphiti/version.rb
|
|
427
|
+
- lib/graphiti_errors.rb
|
|
428
|
+
- lib/graphiti_spec_helpers.rb
|
|
429
|
+
- lib/graphiti_spec_helpers/rspec.rb
|
|
430
|
+
- lib/tasks/graphiti.rake
|
|
431
|
+
- package-lock.json
|
|
370
432
|
- package.json
|
|
433
|
+
- website/.gitignore
|
|
434
|
+
- website/README.md
|
|
435
|
+
- website/docusaurus.config.js
|
|
436
|
+
- website/package-lock.json
|
|
437
|
+
- website/package.json
|
|
438
|
+
- website/sidebars.js
|
|
439
|
+
- website/src/css/custom.css
|
|
440
|
+
- website/src/pages/markdown-page.mdx
|
|
441
|
+
- website/static/.nojekyll
|
|
442
|
+
- website/static/1.13/2019/03/31/graphiti-1-0.html
|
|
443
|
+
- website/static/1.13/2019/05/08/graphiti-1-1.html
|
|
444
|
+
- website/static/1.13/2019/05/20/graphiti-1-2.html
|
|
445
|
+
- website/static/1.13/2019/10/14/tutorial.html
|
|
446
|
+
- website/static/1.13/CNAME
|
|
447
|
+
- website/static/1.13/README.md
|
|
448
|
+
- website/static/1.13/assets/css/syntax.css
|
|
449
|
+
- website/static/1.13/assets/favicons/android-chrome-192x192.png
|
|
450
|
+
- website/static/1.13/assets/favicons/android-chrome-256x256.png
|
|
451
|
+
- website/static/1.13/assets/favicons/apple-touch-icon.png
|
|
452
|
+
- website/static/1.13/assets/favicons/browserconfig.xml
|
|
453
|
+
- website/static/1.13/assets/favicons/favicon-16x16.png
|
|
454
|
+
- website/static/1.13/assets/favicons/favicon-32x32.png
|
|
455
|
+
- website/static/1.13/assets/favicons/favicon.ico
|
|
456
|
+
- website/static/1.13/assets/favicons/mstile-150x150.png
|
|
457
|
+
- website/static/1.13/assets/favicons/safari-pinned-tab.svg
|
|
458
|
+
- website/static/1.13/assets/favicons/site.webmanifest
|
|
459
|
+
- website/static/1.13/assets/img/backend.gif
|
|
460
|
+
- website/static/1.13/assets/img/conformity.png
|
|
461
|
+
- website/static/1.13/assets/img/error_payload.png
|
|
462
|
+
- website/static/1.13/assets/img/gh.png
|
|
463
|
+
- website/static/1.13/assets/img/lifecycle.gif
|
|
464
|
+
- website/static/1.13/assets/img/logo-500.png
|
|
465
|
+
- website/static/1.13/assets/img/logo.png
|
|
466
|
+
- website/static/1.13/assets/img/love-graffiti.jpg
|
|
467
|
+
- website/static/1.13/assets/img/meta_total_count.png
|
|
468
|
+
- website/static/1.13/assets/img/persist.jpg
|
|
469
|
+
- website/static/1.13/assets/img/resource.gif
|
|
470
|
+
- website/static/1.13/assets/img/rest-graffiti.jpg
|
|
471
|
+
- website/static/1.13/assets/img/rest1.gif
|
|
472
|
+
- website/static/1.13/assets/img/rest2.gif
|
|
473
|
+
- website/static/1.13/assets/img/rest3.gif
|
|
474
|
+
- website/static/1.13/assets/img/rethink-rest-graffiti.jpg
|
|
475
|
+
- website/static/1.13/assets/img/why.png
|
|
476
|
+
- website/static/1.13/assets/js/highlight.pack.js
|
|
477
|
+
- website/static/1.13/assets/main.css
|
|
478
|
+
- website/static/1.13/assets/main.css.map
|
|
479
|
+
- website/static/1.13/bin/bundle
|
|
480
|
+
- website/static/1.13/bin/jekyll
|
|
481
|
+
- website/static/1.13/bin/kramdown
|
|
482
|
+
- website/static/1.13/bin/listen
|
|
483
|
+
- website/static/1.13/bin/rake
|
|
484
|
+
- website/static/1.13/bin/rougify
|
|
485
|
+
- website/static/1.13/bin/safe_yaml
|
|
486
|
+
- website/static/1.13/bin/sass
|
|
487
|
+
- website/static/1.13/bin/sass-convert
|
|
488
|
+
- website/static/1.13/bin/scss
|
|
489
|
+
- website/static/1.13/blog.html
|
|
490
|
+
- website/static/1.13/cheatsheet.html
|
|
491
|
+
- website/static/1.13/cookbooks/authorization.md
|
|
492
|
+
- website/static/1.13/cookbooks/caching.md
|
|
493
|
+
- website/static/1.13/cookbooks/customizing-sideloads.html
|
|
494
|
+
- website/static/1.13/cookbooks/etags.md
|
|
495
|
+
- website/static/1.13/cookbooks/hopping-relationships.html
|
|
496
|
+
- website/static/1.13/cookbooks/json_attributes.md
|
|
497
|
+
- website/static/1.13/cookbooks/openstruct-models.md
|
|
498
|
+
- website/static/1.13/cookbooks/remote-resources.md
|
|
499
|
+
- website/static/1.13/cookbooks/without-activerecord.html
|
|
500
|
+
- website/static/1.13/features.html
|
|
501
|
+
- website/static/1.13/feed.xml
|
|
502
|
+
- website/static/1.13/guides/concepts/backends-and-models.html
|
|
503
|
+
- website/static/1.13/guides/concepts/debugging.html
|
|
504
|
+
- website/static/1.13/guides/concepts/endpoints.html
|
|
505
|
+
- website/static/1.13/guides/concepts/error-handling.html
|
|
506
|
+
- website/static/1.13/guides/concepts/links.html
|
|
507
|
+
- website/static/1.13/guides/concepts/remote-resources.html
|
|
508
|
+
- website/static/1.13/guides/concepts/resources.html
|
|
509
|
+
- website/static/1.13/guides/concepts/testing.html
|
|
510
|
+
- website/static/1.13/guides/getting-started/installation.html
|
|
511
|
+
- website/static/1.13/guides/graphiti-rails-migration.html
|
|
512
|
+
- website/static/1.13/guides/index.html
|
|
513
|
+
- website/static/1.13/guides/overview.html
|
|
514
|
+
- website/static/1.13/guides/upgrading-2-0.html
|
|
515
|
+
- website/static/1.13/guides/upgrading.html
|
|
516
|
+
- website/static/1.13/guides/vandal.html
|
|
517
|
+
- website/static/1.13/guides/why.html
|
|
518
|
+
- website/static/1.13/index.html
|
|
519
|
+
- website/static/1.13/js/authentication.html
|
|
520
|
+
- website/static/1.13/js/ddau.html
|
|
521
|
+
- website/static/1.13/js/extra-params.html
|
|
522
|
+
- website/static/1.13/js/index.html
|
|
523
|
+
- website/static/1.13/js/installation.html
|
|
524
|
+
- website/static/1.13/js/introduction.html
|
|
525
|
+
- website/static/1.13/js/middleware.html
|
|
526
|
+
- website/static/1.13/js/reads/fieldsets.html
|
|
527
|
+
- website/static/1.13/js/reads/filtering.html
|
|
528
|
+
- website/static/1.13/js/reads/includes.html
|
|
529
|
+
- website/static/1.13/js/reads/index.html
|
|
530
|
+
- website/static/1.13/js/reads/nested-queries.html
|
|
531
|
+
- website/static/1.13/js/reads/pagination.html
|
|
532
|
+
- website/static/1.13/js/reads/sorting.html
|
|
533
|
+
- website/static/1.13/js/reads/statistics.html
|
|
534
|
+
- website/static/1.13/js/state-syncing.html
|
|
535
|
+
- website/static/1.13/js/writes/deferred.html
|
|
536
|
+
- website/static/1.13/js/writes/dirty-tracking.html
|
|
537
|
+
- website/static/1.13/js/writes/index.html
|
|
538
|
+
- website/static/1.13/js/writes/nested.html
|
|
539
|
+
- website/static/1.13/js/writes/validations.html
|
|
540
|
+
- website/static/1.13/quickstart.html
|
|
541
|
+
- website/static/1.13/template
|
|
542
|
+
- website/static/1.13/tutorial/index.html
|
|
543
|
+
- website/static/1.13/tutorial/step_0.html
|
|
544
|
+
- website/static/1.13/tutorial/step_1.html
|
|
545
|
+
- website/static/1.13/tutorial/step_2.html
|
|
546
|
+
- website/static/1.13/tutorial/step_3.html
|
|
547
|
+
- website/static/1.13/tutorial/step_4.html
|
|
548
|
+
- website/static/1.13/tutorial/step_5.html
|
|
549
|
+
- website/static/1.13/tutorial/step_6.html
|
|
550
|
+
- website/static/1.13/tutorial/step_7.html
|
|
551
|
+
- website/static/1.13/tutorial/step_8.html
|
|
552
|
+
- website/static/1.13/tutorial/step_9.html
|
|
553
|
+
- website/static/assets/img/error_payload.png
|
|
554
|
+
- website/static/assets/img/legacy/legacy-0378a3bb39.png
|
|
555
|
+
- website/static/assets/img/legacy/legacy-05bbd3e5fd.png
|
|
556
|
+
- website/static/assets/img/legacy/legacy-07aa104495.png
|
|
557
|
+
- website/static/assets/img/legacy/legacy-0c75a16b3a.gif
|
|
558
|
+
- website/static/assets/img/legacy/legacy-3076df6209.png
|
|
559
|
+
- website/static/assets/img/legacy/legacy-7f6889bc89.png
|
|
560
|
+
- website/static/assets/img/legacy/legacy-a2cc4363c3.png
|
|
561
|
+
- website/static/assets/img/legacy/legacy-f67cfa89ab.png
|
|
562
|
+
- website/static/assets/img/meta_total_count.png
|
|
563
|
+
- website/static/img/docusaurus-social-card.jpg
|
|
564
|
+
- website/static/img/docusaurus.png
|
|
565
|
+
- website/static/img/favicon.ico
|
|
566
|
+
- website/static/img/logo.png
|
|
567
|
+
- website/static/img/logo.svg
|
|
568
|
+
- website/static/img/undraw_docusaurus_mountain.svg
|
|
569
|
+
- website/static/img/undraw_docusaurus_react.svg
|
|
570
|
+
- website/static/img/undraw_docusaurus_tree.svg
|
|
371
571
|
homepage: https://github.com/graphiti-api/graphiti
|
|
372
572
|
licenses:
|
|
373
573
|
- MIT
|
|
@@ -387,15 +587,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
387
587
|
requirements:
|
|
388
588
|
- - ">="
|
|
389
589
|
- !ruby/object:Gem::Version
|
|
390
|
-
version: '3.
|
|
590
|
+
version: '3.2'
|
|
391
591
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
392
592
|
requirements:
|
|
393
|
-
- - "
|
|
593
|
+
- - ">="
|
|
394
594
|
- !ruby/object:Gem::Version
|
|
395
|
-
version:
|
|
595
|
+
version: '0'
|
|
396
596
|
requirements: []
|
|
397
|
-
rubygems_version: 3.
|
|
398
|
-
signing_key:
|
|
597
|
+
rubygems_version: 3.6.9
|
|
399
598
|
specification_version: 4
|
|
400
599
|
summary: Easily build jsonapi.org-compatible APIs
|
|
401
600
|
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: "../"
|
data/lib/graphiti/railtie.rb
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
module Graphiti
|
|
2
|
-
# @deprecated Use graphiti-rails's Graphiti::Rails::Railtie
|
|
3
|
-
class Railtie < ::Rails::Railtie
|
|
4
|
-
rake_tasks do
|
|
5
|
-
load File.expand_path("deprecated_tasks.rb", __dir__)
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
generators do
|
|
9
|
-
Dir[File.expand_path("../../deprecated_generators/**/*.rb", __dir__)].sort.each do |f|
|
|
10
|
-
require f
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
initializer "graphiti.require_activerecord_adapter" do
|
|
15
|
-
config.after_initialize do |app|
|
|
16
|
-
ActiveSupport.on_load(:active_record) do
|
|
17
|
-
require "graphiti/adapters/active_record"
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
initializer "graphti.logger" do
|
|
23
|
-
config.after_initialize do
|
|
24
|
-
Graphiti.logger = ::Rails.logger
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
initializer "graphiti.init" do
|
|
29
|
-
if ::Rails.application.config.eager_load
|
|
30
|
-
config.after_initialize do |app|
|
|
31
|
-
::Rails.application.reload_routes!
|
|
32
|
-
Graphiti.setup!
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
if Mime[:jsonapi].nil? # rails 4
|
|
37
|
-
Mime::Type.register("application/vnd.api+json", :jsonapi)
|
|
38
|
-
end
|
|
39
|
-
register_parameter_parser
|
|
40
|
-
register_renderers
|
|
41
|
-
establish_concurrency
|
|
42
|
-
configure_endpoint_lookup
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# from jsonapi-rails
|
|
46
|
-
PARSER = lambda do |body|
|
|
47
|
-
data = JSON.parse(body)
|
|
48
|
-
data[:format] = :jsonapi
|
|
49
|
-
data.with_indifferent_access
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def register_parameter_parser
|
|
53
|
-
if ::Rails::VERSION::MAJOR >= 5
|
|
54
|
-
ActionDispatch::Request.parameter_parsers[:jsonapi] = PARSER
|
|
55
|
-
else
|
|
56
|
-
ActionDispatch::ParamsParser::DEFAULT_PARSERS[Mime[:jsonapi]] = PARSER
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def register_renderers
|
|
61
|
-
ActiveSupport.on_load(:action_controller) do
|
|
62
|
-
::ActionController::Renderers.add(:jsonapi) do |proxy, options|
|
|
63
|
-
self.content_type ||= Mime[:jsonapi]
|
|
64
|
-
|
|
65
|
-
# opts = {}
|
|
66
|
-
# if respond_to?(:default_jsonapi_render_options)
|
|
67
|
-
# opts = default_jsonapi_render_options
|
|
68
|
-
# end
|
|
69
|
-
|
|
70
|
-
if proxy.is_a?(Hash) # for destroy
|
|
71
|
-
render(options.merge(json: proxy))
|
|
72
|
-
else
|
|
73
|
-
proxy.to_jsonapi(options)
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
ActiveSupport.on_load(:action_controller) do
|
|
79
|
-
::ActionController::Renderers.add(:jsonapi_errors) do |proxy, options|
|
|
80
|
-
self.content_type ||= Mime[:jsonapi]
|
|
81
|
-
|
|
82
|
-
validation = GraphitiErrors::Validation::Serializer.new \
|
|
83
|
-
proxy.data, proxy.payload.relationships
|
|
84
|
-
|
|
85
|
-
render \
|
|
86
|
-
json: {errors: validation.errors},
|
|
87
|
-
status: :unprocessable_entity
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
# Only run concurrently if our environment supports it
|
|
93
|
-
def establish_concurrency
|
|
94
|
-
Graphiti.config.concurrency = !::Rails.env.test? &&
|
|
95
|
-
::Rails.application.config.cache_classes
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def configure_endpoint_lookup
|
|
99
|
-
Graphiti.config.context_for_endpoint = ->(path, action) {
|
|
100
|
-
method = :GET
|
|
101
|
-
case action
|
|
102
|
-
when :show then path = "#{path}/1"
|
|
103
|
-
when :create then method = :POST
|
|
104
|
-
when :update
|
|
105
|
-
path = "#{path}/1"
|
|
106
|
-
method = :PUT
|
|
107
|
-
when :destroy
|
|
108
|
-
path = "#{path}/1"
|
|
109
|
-
method = :DELETE
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
route = begin
|
|
113
|
-
::Rails.application.routes.recognize_path(path, method: method)
|
|
114
|
-
rescue
|
|
115
|
-
nil
|
|
116
|
-
end
|
|
117
|
-
"#{route[:controller]}_controller".classify.safe_constantize if route
|
|
118
|
-
}
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
end
|
|
File without changes
|
/data/{deprecated_generators → lib/generators}/graphiti/templates/application_resource.rb.erb
RENAMED
|
File without changes
|
|
File without changes
|
/data/{deprecated_generators → lib/generators}/graphiti/templates/create_request_spec.rb.erb
RENAMED
|
File without changes
|
/data/{deprecated_generators → lib/generators}/graphiti/templates/destroy_request_spec.rb.erb
RENAMED
|
File without changes
|
|
File without changes
|
/data/{deprecated_generators → lib/generators}/graphiti/templates/resource_writes_spec.rb.erb
RENAMED
|
File without changes
|
/data/{deprecated_generators → lib/generators}/graphiti/templates/update_request_spec.rb.erb
RENAMED
|
File without changes
|