graphiti 1.7.0 → 1.7.1
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/CHANGELOG.md +8 -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
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb08a2d097076d868284efb475a82bfb9f44b697bc322dda5a654a6d259384cf
|
4
|
+
data.tar.gz: ef60e4a509d87c76973a15a59105a50d9de7635d3084afe2621f23008ff46580
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd5489249c9c768f83e05bfcd6be59bacfef2a50826c9eb547ae6a9b12cdfc25fbd54e36d54e0a37264e77458cfdc4415e707aacdeb6377179cf44a7480850a3
|
7
|
+
data.tar.gz: 7be1d2008f1f74b3a5203053eb4dc91efe013a33e5c2cada66f409f9de1a515f720e357ef619b8459f1451d90f9fb39c3a130502304f7ce2eb408a421d29f511
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
graphiti changelog
|
2
2
|
|
3
|
+
## [1.7.1](https://github.com/graphiti-api/graphiti/compare/v1.7.0...v1.7.1) (2024-04-18)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* properly display .find vs .all in debugger statements ([d2a7a03](https://github.com/graphiti-api/graphiti/commit/d2a7a038a649818979d52ccd898e68dba78b051f))
|
9
|
+
* rescue error from sideloads updated_at calculation, defaulting to the current time ([661e3b5](https://github.com/graphiti-api/graphiti/commit/661e3b5212e2649870a200067d0d5d52fa962637))
|
10
|
+
|
3
11
|
# [1.7.0](https://github.com/graphiti-api/graphiti/compare/v1.6.4...v1.7.0) (2024-03-27)
|
4
12
|
|
5
13
|
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
](https://github.com/graphiti-api/graphiti/actions/workflows/ci.yml)
|
2
2
|
[](https://badge.fury.io/rb/graphiti)
|
3
3
|
[](https://github.com/testdouble/standard)
|
4
|
+
[](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
|
+
return 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
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.1
|
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-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|