graphiti-activegraph 0.1.12 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7266074000ea9e73431aca12a66233fcbd0269920fde11110ad573ff534d54a
4
- data.tar.gz: f262fca1d720e2cbd2b0d6005afdb62f595e86d01b5bc3733becfbe4f237a9ce
3
+ metadata.gz: e2edafb17b2501ff89298dacbccad4dd910a4858dd745e72e13d22413fff516d
4
+ data.tar.gz: 8f673d1994493e1ddb9ac250e9d2525d63cf723008c8020c34cc45beeee097c0
5
5
  SHA512:
6
- metadata.gz: 8721f941b117c1e28331c14150b235a113fff2b80f1e53b5921bcc5aa4580b63612c11cdd620482b31ecc38324df000811e1045cba559d3fa7bb16b589dc4e07
7
- data.tar.gz: d9a58dba000e7f25d4f1d51fa80f13da2f9637a71f5f08e45294e7bbb2099314a160df940d72e0b3bb39223a2a93e3ed0b85ff676d08ed946f211e11eebebc02
6
+ metadata.gz: 71c4679cc8af12fa8a6300b5b931b2d3192fb2cf403aeb9bb83f3675d64bb27956f117bfbc09ead957285571a1b18ba4e5c069e3217aafe4f457601d780aa9d1
7
+ data.tar.gz: e5b6556f6fad1c08c4741c807431b39339daa2ec5e7ede0673188d362d44593d65d2e88060429dbf39c0c338a5098628c4228bfe02f1f255415a017ee321cbff
data/.travis.yml CHANGED
@@ -6,5 +6,6 @@ jdk:
6
6
  cache: bundler
7
7
  rvm:
8
8
  - 2.7.1
9
- - jruby-9.2.13.0
9
+ - jruby-9.2.16.0
10
+ - jruby-9.3.2.0
10
11
  script: 'bundle exec rspec'
data/CHANGELOG.md CHANGED
@@ -8,7 +8,25 @@ Features:
8
8
 
9
9
  - Added support for polymorphic relationship.
10
10
 
11
- <!-- ### [version (DD-MM-YYYY)](diff_link) -->
11
+ ## 0.1.13 (21-12-2021)
12
+
13
+ Features:
14
+
15
+ - Supports Jruby-9.3.2.0
16
+
17
+ ## 0.1.14 (21-12-2021)
18
+
19
+ Features:
20
+
21
+ - Adding unpaginated query to resource proxy with preloaded records. This will help in getting count on API.
22
+
23
+ ## 0.1.15 (21-06-2022)
24
+
25
+ Features:
26
+
27
+ - Relationships mentioned in sparse field param (and not in include), will now be returned in relationship block of response
28
+
29
+ <!-- ### [version (DD-MM-YYYY)] -->
12
30
  <!-- Breaking changes:-->
13
31
  <!-- Features:-->
14
32
  <!-- Fixes:-->
@@ -0,0 +1,8 @@
1
+ module Graphiti::ActiveGraph::JsonapiExt::Serializable
2
+ module ResourceExt
3
+ def as_jsonapi(fields: nil, include: [])
4
+ include.merge(fields) if fields.present?
5
+ super(fields: fields, include: include)
6
+ end
7
+ end
8
+ end
@@ -15,13 +15,13 @@ module Graphiti::ActiveGraph
15
15
 
16
16
  def proxy(base = nil, opts = {})
17
17
  base ||= jsonapi_resource.base_scope
18
- scope_opts = opts.slice :sideload_parent_length,
18
+ scope_opts = opts.slice(:sideload_parent_length,
19
19
  :default_paginate,
20
20
  :after_resolve,
21
21
  :sideload,
22
22
  :parent,
23
23
  :params,
24
- :preloaded
24
+ :preloaded).merge(unpaginated_query: params[:unpaginated_query])
25
25
  scope = jsonapi_scope(base, scope_opts) unless jsonapi_resource.relation_resource?
26
26
  preloaded = opts[:preloaded] || (jsonapi_resource.relation_resource? && jsonapi_resource.base_scope)
27
27
  options = { payload: deserialized_payload,
@@ -1,5 +1,5 @@
1
1
  module Graphiti
2
2
  module ActiveGraph
3
- VERSION = '0.1.12'
3
+ VERSION = '0.1.15'
4
4
  end
5
5
  end
@@ -1,8 +1,9 @@
1
- require 'graphiti'
2
1
  require 'zeitwerk'
3
2
 
4
3
  # Workaround for missing zeitwerk support as of jruby-9.2.13.0
5
4
  module Graphiti
5
+ module Scoping
6
+ end
6
7
  module ActiveGraph
7
8
  module Scoping
8
9
  end
@@ -10,18 +11,28 @@ module Graphiti
10
11
  end
11
12
  module Util
12
13
  end
14
+ module JsonapiExt
15
+ module Serializable
16
+ end
17
+ end
13
18
  end
14
19
  end
15
20
  # End workaround
16
21
 
22
+ # Workaround for jruby prepend issue https://github.com/jruby/jruby/issues/6971
23
+ require 'graphiti/scoping/filterable'
24
+ require 'graphiti/resource/persistence'
25
+ # End workaround for jruby prepend issue
26
+
17
27
  loader = Zeitwerk::Loader.for_gem
18
28
  loader.inflector.inflect 'version' => 'VERSION'
19
29
  loader.ignore(File.expand_path('graphiti-activegraph.rb', __dir__))
20
30
  loader.setup
21
31
 
32
+ Graphiti::Scoping::Filterable.prepend Graphiti::ActiveGraph::Scoping::Filterable
22
33
  Graphiti::Resource::Persistence.prepend Graphiti::ActiveGraph::Resource::Persistence
34
+ require 'graphiti'
23
35
  Graphiti::Scoping::Filter.prepend Graphiti::ActiveGraph::Scoping::Filter
24
- Graphiti::Scoping::Filterable.prepend Graphiti::ActiveGraph::Scoping::Filterable
25
36
  Graphiti::Util::SerializerRelationship.prepend Graphiti::ActiveGraph::Util::SerializerRelationship
26
37
  Graphiti::Util::SerializerAttribute.prepend Graphiti::ActiveGraph::Util::SerializerAttribute
27
38
  Graphiti::Util::RelationshipPayload.prepend Graphiti::ActiveGraph::Util::RelationshipPayload
@@ -32,3 +43,6 @@ Graphiti::Resource.extend Graphiti::ActiveGraph::Resource
32
43
  Graphiti::ResourceProxy.prepend Graphiti::ActiveGraph::ResourceProxy
33
44
  Graphiti::Runner.prepend Graphiti::ActiveGraph::Runner
34
45
  Graphiti::Scope.prepend Graphiti::ActiveGraph::SideloadResolve
46
+
47
+ # JSONAPI extensions
48
+ JSONAPI::Serializable::Resource.prepend Graphiti::ActiveGraph::JsonapiExt::Serializable::ResourceExt
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti-activegraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hardik Joshi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2022-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphiti
@@ -199,6 +199,7 @@ files:
199
199
  - lib/graphiti/active_graph/adapters/active_graph/polymorphic_belongs_to.rb
200
200
  - lib/graphiti/active_graph/adapters/active_graph/sideload.rb
201
201
  - lib/graphiti/active_graph/deserializer.rb
202
+ - lib/graphiti/active_graph/jsonapi_ext/serializable/resource_ext.rb
202
203
  - lib/graphiti/active_graph/query.rb
203
204
  - lib/graphiti/active_graph/resource.rb
204
205
  - lib/graphiti/active_graph/resource/persistence.rb
@@ -230,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
231
  - !ruby/object:Gem::Version
231
232
  version: '0'
232
233
  requirements: []
233
- rubygems_version: 3.0.3
234
+ rubygems_version: 3.0.3.1
234
235
  signing_key:
235
236
  specification_version: 4
236
237
  summary: Easily build jsonapi.org-compatible APIs for GraphDB