graphiti 1.7.0 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +2 -1
- data/lib/graphiti/debugger.rb +3 -3
- data/lib/graphiti/scope.rb +8 -6
- data/lib/graphiti/util/cache_debug.rb +1 -1
- data/lib/graphiti/version.rb +1 -1
- data/lib/graphiti.rb +4 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ef6f59bab6be83f8be9f2dd2f2350d49abac04ad0ca7338bb1d52aa88cec27d
|
4
|
+
data.tar.gz: 2c904533a08f64faa13b5aed12467da757c87ed842ba8680ecf86052ddd37e86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f30b06bb304bef743ce7926df28187f8772b5c803e8407c7cacaa810cff9ac9880046efa8c73f3d2e911a9088f04ca613fd32e7a1e1c3f41ae755b68cc25a4f3
|
7
|
+
data.tar.gz: 13b6980e5be70675eabed5cf9d799a02281072abf93e35cc8a0266d58adf1d029d7e114394ba973a1e5531ab66d7f091ecaa97005dd001cb320ca1e3961d9146
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
graphiti changelog
|
2
2
|
|
3
|
+
## [1.7.2](https://github.com/graphiti-api/graphiti/compare/v1.7.1...v1.7.2) (2024-06-11)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* require necessary ActiveSupport parts in proper order ([bb2a488](https://github.com/graphiti-api/graphiti/commit/bb2a48874a6533522df6eb027d0df8ec14c80a20))
|
9
|
+
|
10
|
+
## [1.7.1](https://github.com/graphiti-api/graphiti/compare/v1.7.0...v1.7.1) (2024-04-18)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* properly display .find vs .all in debugger statements ([d2a7a03](https://github.com/graphiti-api/graphiti/commit/d2a7a038a649818979d52ccd898e68dba78b051f))
|
16
|
+
* rescue error from sideloads updated_at calculation, defaulting to the current time ([661e3b5](https://github.com/graphiti-api/graphiti/commit/661e3b5212e2649870a200067d0d5d52fa962637))
|
17
|
+
|
3
18
|
# [1.7.0](https://github.com/graphiti-api/graphiti/compare/v1.6.4...v1.7.0) (2024-03-27)
|
4
19
|
|
5
20
|
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
![
|
1
|
+
[![CI](https://github.com/graphiti-api/graphiti/actions/workflows/ci.yml/badge.svg)](https://github.com/graphiti-api/graphiti/actions/workflows/ci.yml)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/graphiti.svg)](https://badge.fury.io/rb/graphiti)
|
3
3
|
[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
|
4
|
+
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
|
4
5
|
|
5
6
|
<p align="center">
|
6
7
|
<a href="https://www.graphiti.dev/guides">
|
data/lib/graphiti/debugger.rb
CHANGED
@@ -36,7 +36,7 @@ module Graphiti
|
|
36
36
|
json[:sideload] = sideload.name
|
37
37
|
end
|
38
38
|
if params
|
39
|
-
query = "#{payload[:resource].class.name}
|
39
|
+
query = "#{payload[:resource].class.name}.#{payload[:action]}(#{JSON.pretty_generate(params)}).data"
|
40
40
|
logs << [query, :cyan, true]
|
41
41
|
logs << ["The error occurred when running the above query. Copy/paste it into a rake task or Rails console session to reproduce. Keep in mind you may have to set context.", :yellow, true]
|
42
42
|
else
|
@@ -64,7 +64,7 @@ module Graphiti
|
|
64
64
|
query = if sideload.class.scope_proc
|
65
65
|
"#{payload[:resource].class.name}: Manual sideload via .scope"
|
66
66
|
else
|
67
|
-
"#{payload[:resource].class.name}
|
67
|
+
"#{payload[:resource].class.name}.#{payload[:action]}(#{params.inspect})"
|
68
68
|
end
|
69
69
|
logs << [" #{query}", :cyan, true]
|
70
70
|
json[:query] = query
|
@@ -82,7 +82,7 @@ module Graphiti
|
|
82
82
|
title = "Top Level Data Retrieval (+ sideloads):"
|
83
83
|
logs << [title, :green, true]
|
84
84
|
json[:title] = title
|
85
|
-
query = "#{payload[:resource].class.name}
|
85
|
+
query = "#{payload[:resource].class.name}.#{payload[:action]}(#{params.inspect})"
|
86
86
|
logs << [query, :cyan, true]
|
87
87
|
json[:query] = query
|
88
88
|
logs << ["Returned Models: #{results}"] if debug_models
|
data/lib/graphiti/scope.rb
CHANGED
@@ -92,16 +92,17 @@ module Graphiti
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def updated_at
|
95
|
-
|
96
|
-
|
95
|
+
updated_time = nil
|
97
96
|
begin
|
97
|
+
updated_ats = sideload_resource_proxies.map(&:updated_at)
|
98
98
|
updated_ats << @object.maximum(:updated_at)
|
99
|
+
updated_time = updated_ats.compact.max
|
99
100
|
rescue => e
|
100
|
-
Graphiti.log("error calculating last_modified_at for #{@resource.class}")
|
101
|
+
Graphiti.log(["error calculating last_modified_at for #{@resource.class}", :red])
|
101
102
|
Graphiti.log(e)
|
102
103
|
end
|
103
104
|
|
104
|
-
|
105
|
+
updated_time || Time.now
|
105
106
|
end
|
106
107
|
alias_method :last_modified_at, :updated_at
|
107
108
|
|
@@ -128,9 +129,10 @@ module Graphiti
|
|
128
129
|
def broadcast_data
|
129
130
|
opts = {
|
130
131
|
resource: @resource,
|
131
|
-
params: @opts[:params],
|
132
|
+
params: @opts[:params] || @query.params,
|
132
133
|
sideload: @opts[:sideload],
|
133
|
-
parent: @opts[:parent]
|
134
|
+
parent: @opts[:parent],
|
135
|
+
action: @query.action
|
134
136
|
# Set once data is resolved within block
|
135
137
|
# results: ...
|
136
138
|
}
|
data/lib/graphiti/version.rb
CHANGED
data/lib/graphiti.rb
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
require "json"
|
2
2
|
require "forwardable"
|
3
3
|
require "uri"
|
4
|
+
|
5
|
+
require "active_support/version"
|
6
|
+
require "active_support/deprecation"
|
7
|
+
require "active_support/deprecator" if ::ActiveSupport.version >= Gem::Version.new("7.1")
|
4
8
|
require "active_support/core_ext/string"
|
5
9
|
require "active_support/core_ext/enumerable"
|
6
10
|
require "active_support/core_ext/class/attribute"
|
7
11
|
require "active_support/core_ext/hash/conversions" # to_xml
|
8
12
|
require "active_support/concern"
|
9
13
|
require "active_support/time"
|
10
|
-
require "active_support/deprecation"
|
11
14
|
|
12
15
|
require "dry-types"
|
13
16
|
require "graphiti_errors"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|
@@ -361,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
361
361
|
- !ruby/object:Gem::Version
|
362
362
|
version: '0'
|
363
363
|
requirements: []
|
364
|
-
rubygems_version: 3.3.
|
364
|
+
rubygems_version: 3.3.27
|
365
365
|
signing_key:
|
366
366
|
specification_version: 4
|
367
367
|
summary: Easily build jsonapi.org-compatible APIs
|