graphiti_gql 0.2.21 → 0.2.24

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: 933f1a2f88f12ad842f261023b05c8f5cc764ffbe61e7c6686ad88e2d013f8c8
4
- data.tar.gz: 89f3c1c9fd1dcaa5160e1b0f9df9e81c0ff869a55d2842db365a1dfd14c942fe
3
+ metadata.gz: 696f200f2ac54b136b21b4b8f237cddfddf742d73da51b73c2513dbb7c0cc60a
4
+ data.tar.gz: 914867efbf89a58b33de2e28b65c253577852cedf146e8f2050e2330d9534cdf
5
5
  SHA512:
6
- metadata.gz: 2de7c71483561731e957887da213322caf2c10b9d6836660b15ecd6572c743dffc1f34de139d15ff05dae13392b28186e35b01a2ee409cbe5c22f86c4a75066e
7
- data.tar.gz: 973e35034e8c7a2b01eb5301f8db86df99a1631adfadf35e6e608f95fa31aec08d89da68df8833edc460af5525a8c3e240ff70d3576fc5180ef98614e87f58d3
6
+ metadata.gz: cfa86ca259696ca32ba303b5bf4abb8064c7d60b179ef106a136da1a292d0721ec81a12242d9a0ba993c69dae93c0367350354475b13132aead992380bf129af
7
+ data.tar.gz: 56a9db45d32242003eb8a9e9cb74f6efc96c92f9889abc93c8b038f6e07a3d5dbe836bfd84d4c4e053d3ff46bfbacf5676408ba95c10b357463a5e6034ac51c2
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphiti_gql (0.2.18)
4
+ graphiti_gql (0.2.23)
5
+ activemodel (> 6.0, < 8.0)
5
6
  graphiti (~> 1.3.9)
6
7
  graphql (~> 2.0)
7
8
  graphql-batch (~> 0.5)
@@ -47,13 +48,13 @@ GEM
47
48
  graphql-batch (0.5.1)
48
49
  graphql (>= 1.10, < 3)
49
50
  promise.rb (~> 0.7.2)
50
- i18n (1.10.0)
51
+ i18n (1.12.0)
51
52
  concurrent-ruby (~> 1.0)
52
53
  jsonapi-renderer (0.2.2)
53
54
  jsonapi-serializable (0.3.1)
54
55
  jsonapi-renderer (~> 0.2.0)
55
56
  method_source (1.0.0)
56
- minitest (5.15.0)
57
+ minitest (5.16.2)
57
58
  promise.rb (0.7.4)
58
59
  pry (0.13.1)
59
60
  coderay (~> 1.1)
@@ -75,14 +76,13 @@ GEM
75
76
  diff-lcs (>= 1.2.0, < 2.0)
76
77
  rspec-support (~> 3.11.0)
77
78
  rspec-support (3.11.0)
78
- tzinfo (2.0.4)
79
+ tzinfo (2.0.5)
79
80
  concurrent-ruby (~> 1.0)
80
81
 
81
82
  PLATFORMS
82
83
  arm64-darwin-21
83
84
 
84
85
  DEPENDENCIES
85
- activemodel (~> 7.0)
86
86
  bundler (~> 2.3)
87
87
  graphiti_gql!
88
88
  pry
data/graphiti_gql.gemspec CHANGED
@@ -38,9 +38,9 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency "graphql", "~> 2.0"
39
39
  spec.add_dependency "graphql-batch", "~> 0.5"
40
40
  spec.add_dependency "graphiti", "~> 1.3.9"
41
+ spec.add_dependency "activemodel", ["> 6.0", "< 8.0"]
41
42
 
42
43
  spec.add_development_dependency "bundler", "~> 2.3"
43
44
  spec.add_development_dependency "rake", "~> 10.0"
44
45
  spec.add_development_dependency "rspec", "~> 3.0"
45
- spec.add_development_dependency "activemodel", "~> 7.0"
46
46
  end
@@ -16,12 +16,19 @@ module GraphitiGql
16
16
  module ResourceExtras
17
17
  extend ActiveSupport::Concern
18
18
 
19
- included do
19
+ prepended do
20
+ extend ActiveModel::Callbacks
21
+ define_model_callbacks :query
22
+
20
23
  class << self
21
24
  attr_accessor :graphql_name, :singular
22
25
  end
23
26
  end
24
27
 
28
+ def value_object?
29
+ self.class.value_object?
30
+ end
31
+
25
32
  def filterings
26
33
  @filterings ||= begin
27
34
  if @params.key?(:filter)
@@ -57,7 +64,19 @@ module GraphitiGql
57
64
  @selections
58
65
  end
59
66
 
67
+ def around_scoping(original_scope, query_hash)
68
+ run_callbacks :query do
69
+ super { |scope| yield scope }
70
+ end
71
+ end
72
+
60
73
  class_methods do
74
+ def config
75
+ return @config if @config
76
+ super
77
+ @config = @config.merge(value_objects: {}, is_value_object: false)
78
+ end
79
+
61
80
  def attribute(*args)
62
81
  super(*args).tap do
63
82
  opts = args.extract_options!
@@ -83,9 +102,43 @@ module GraphitiGql
83
102
  super
84
103
  end
85
104
  end
105
+
106
+ def value_object?
107
+ !!config[:is_value_object]
108
+ end
109
+
110
+ def value_object!
111
+ config[:is_value_object] = true
112
+ self.adapter = ::Graphiti::Adapters::Null
113
+ config[:filters] = {}
114
+ config[:stats] = {}
115
+ config[:sorts] = {}
116
+ config[:attributes].delete(:id)
117
+ define_method :base_scope do
118
+ {}
119
+ end
120
+ define_method :resolve do |parent|
121
+ [parent]
122
+ end
123
+ end
124
+
125
+ def value_object(name, opts = {})
126
+ opts[:array] ||= false
127
+ opts[:null] ||= true
128
+ config[:value_objects][name] = Graphiti::ValueObjectAssociation.new(
129
+ name,
130
+ parent_resource_class: self,
131
+ resource_class: opts[:resource],
132
+ _alias: opts[:alias],
133
+ is_array: opts[:array],
134
+ null: opts[:null],
135
+ readable: opts[:readable],
136
+ deprecation_reason: opts[:deprecation_reason]
137
+ )
138
+ end
86
139
  end
87
140
  end
88
- Graphiti::Resource.send(:include, ResourceExtras)
141
+ Graphiti::Resource.send(:prepend, ResourceExtras)
89
142
 
90
143
  module FilterExtras
91
144
  def filter_param
@@ -186,26 +239,14 @@ module GraphitiGql
186
239
  module ManyToManyExtras
187
240
  def self.prepended(klass)
188
241
  klass.class_eval do
189
- attr_reader :join_table_alias, :edge_magic
190
-
191
- class << self
192
- attr_reader :edge_resource
193
-
194
- def attribute(*args, &blk)
195
- @edge_resource ||= Class.new(Graphiti::Resource) do
196
- def self.abstract_class?
197
- true
198
- end
199
- end
200
- @edge_resource.attribute(*args, &blk)
201
- end
202
- end
242
+ attr_reader :join_table_alias, :edge_magic, :edge_resource
203
243
  end
204
244
  end
205
245
 
206
246
  def initialize(name, opts = {})
207
247
  @join_table_alias = opts[:join_table_alias]
208
248
  @edge_magic = opts[:edge_magic] == false ? false : true
249
+ @edge_resource = opts[:edge_resource]
209
250
  super
210
251
  end
211
252
 
@@ -266,6 +307,20 @@ module GraphitiGql
266
307
  description: 'Datetime with milliseconds'
267
308
  }
268
309
 
310
+ [:string, :integer, :float, :datetime, :precise_datetime].each do |kind|
311
+ duped_hash = Graphiti::Util::Hash.deep_dup(Graphiti::Types[:hash])
312
+ type = Graphiti::Types[:"#{kind}_range"] = duped_hash
313
+ type[:canonical_name] = :"#{kind}_range"
314
+ Graphiti::Types[:"array_of_#{kind}_ranges"] = {
315
+ canonical_name: :"#{kind}_range",
316
+ params: Dry::Types["strict.array"].of(type[:params]),
317
+ read: Dry::Types["strict.array"].of(type[:read]),
318
+ write: Dry::Types["strict.array"].of(type[:write]),
319
+ kind: "array",
320
+ description: "Base Type."
321
+ }
322
+ end
323
+
269
324
  module ActiveRecordAdapterExtras
270
325
  extend ActiveSupport::Concern
271
326
 
@@ -365,6 +420,15 @@ module GraphitiGql
365
420
 
366
421
  Graphiti::Query.send(:prepend, QueryExtras)
367
422
  module ScopeExtras
423
+ def initialize(object, resource, query, opts = {})
424
+ if resource.value_object?
425
+ object = query.params[:parent]
426
+ super(object, resource, query, opts)
427
+ else
428
+ super
429
+ end
430
+ end
431
+
368
432
  def resolve(*args)
369
433
  results = super
370
434
  results.reverse! if @query.hash[:reverse]
@@ -385,4 +449,48 @@ module GraphitiGql
385
449
  ::Graphiti::Adapters::ActiveRecord::ManyToManySideload
386
450
  .send(:prepend, ActiveRecordManyToManyExtras)
387
451
  end
452
+ end
453
+
454
+ class Graphiti::ValueObjectAssociation
455
+ attr_reader :name,
456
+ :parent_resource_class,
457
+ :alias,
458
+ :readable,
459
+ :null,
460
+ :deprecation_reason
461
+
462
+ def initialize(
463
+ name,
464
+ parent_resource_class:,
465
+ resource_class:,
466
+ is_array: false,
467
+ readable: nil,
468
+ null: true,
469
+ _alias: nil,
470
+ deprecation_reason: nil
471
+ )
472
+ @name = name
473
+ @parent_resource_class = parent_resource_class
474
+ @resource_class = resource_class
475
+ @readable = readable
476
+ @array = is_array
477
+ @alias = _alias
478
+ @null = null
479
+ @deprecation_reason = deprecation_reason
480
+ end
481
+
482
+ def array?
483
+ !!@array
484
+ end
485
+
486
+ def resource_class
487
+ @resource_class ||= Graphiti::Util::Class
488
+ .infer_resource_class(@parent_resource_class, name)
489
+ end
490
+
491
+ def build_resource(parent)
492
+ instance = resource_class.new
493
+ instance.parent = parent
494
+ instance
495
+ end
388
496
  end
@@ -16,13 +16,15 @@ module GraphitiGql
16
16
 
17
17
  private
18
18
 
19
+ def thru_model
20
+ thru = @sideload.foreign_key.keys.first
21
+ reflection = @sideload.parent_resource.model.reflect_on_association(thru)
22
+ reflection.klass
23
+ end
24
+
19
25
  def add_join_table_magic(proxy)
20
26
  return unless @sideload.edge_magic
21
27
  if defined?(ActiveRecord) && proxy.resource.model.ancestors.include?(ActiveRecord::Base)
22
- thru = @sideload.foreign_key.keys.first
23
- reflection = @sideload.parent_resource.model.reflect_on_association(thru)
24
- thru_model = reflection.klass
25
-
26
28
  thru_table_name = @sideload.join_table_alias || thru_model.table_name
27
29
  names = thru_model.column_names.map do |n|
28
30
  next if n == :id
@@ -3,12 +3,11 @@ module GraphitiGql
3
3
  module Fields
4
4
  class Attribute
5
5
  # If sideload is present, we're applying m2m metadata to an edge
6
- def initialize(resource, name, config, sideload = nil)
6
+ def initialize(resource, name, config)
7
7
  @resource = resource
8
8
  @config = config
9
9
  @name = name
10
10
  @alias = config[:alias]
11
- @sideload = sideload # is_edge: true
12
11
  end
13
12
 
14
13
  def apply(type)
@@ -16,13 +15,11 @@ module GraphitiGql
16
15
  _config = @config
17
16
  _name = @name
18
17
  _alias = @alias
19
- _sideload = @sideload
20
18
  opts = @config.slice(:null, :deprecation_reason)
21
19
  type.field(_name, field_type, **opts)
22
20
  type.define_method _name do
23
21
  if (readable = _config[:readable]).is_a?(Symbol)
24
22
  obj = object
25
- obj = object.node if _sideload
26
23
  resource = obj.instance_variable_get(:@__graphiti_resource)
27
24
  unless resource.send(readable)
28
25
  path = Graphiti.context[:object][:current_path].join(".")
@@ -30,22 +27,11 @@ module GraphitiGql
30
27
  end
31
28
  end
32
29
 
33
- edge_attrs = nil
34
- if _sideload
35
- edge_attrs = object.node.attributes
36
- .select { |k, v| k.to_s.starts_with?("_edge_") }
37
- edge_attrs.transform_keys! { |k| k.to_s.gsub("_edge_", "").to_sym }
38
- end
39
-
40
30
  value = if _config[:proc]
41
- if _sideload
42
- instance_exec(edge_attrs, object.node, &_config[:proc])
43
- else
44
- instance_eval(&_config[:proc])
45
- end
31
+ instance_eval(&_config[:proc])
46
32
  else
47
- if _sideload
48
- edge_attrs[_alias || _name]
33
+ if object.is_a?(Hash)
34
+ object[_name] || object[_name.to_s]
49
35
  else
50
36
  object.send(_alias || _name)
51
37
  end
@@ -35,7 +35,7 @@ module GraphitiGql
35
35
  end
36
36
 
37
37
  def customized_edge?
38
- @sideload.type == :many_to_many && @sideload.class.edge_resource
38
+ @sideload.type == :many_to_many && @sideload.edge_resource
39
39
  end
40
40
 
41
41
  def find_or_build_connection
@@ -59,21 +59,61 @@ module GraphitiGql
59
59
  end
60
60
 
61
61
  def build_edge_type_class(sideload_type)
62
- prior_edge_type_class = sideload_type.edge_type_class
63
- edge_type_class = Class.new(prior_edge_type_class)
64
- edge_resource = @sideload.class.edge_resource
65
- edge_resource.attributes.each_pair do |name, config|
66
- next if name == :id
67
- Schema::Fields::Attribute.new(edge_resource, name, config, @sideload).apply(edge_type_class)
62
+ klass = build_friendly_graphql_edge_type_class \
63
+ sideload_type.edge_type_class
64
+ name = edge_type_class_name(sideload_type)
65
+ klass.define_method(:graphql_name) { name }
66
+ klass.graphql_name(name)
67
+ edge_resource = @sideload.edge_resource
68
+ ResourceType.add_fields(klass, edge_resource, id: false)
69
+ ResourceType.add_relationships(edge_resource, klass)
70
+ ResourceType.add_value_objects(edge_resource, klass)
71
+ klass
72
+ end
73
+
74
+ # Normally we reference 'object', but edges work differently
75
+ # This makes 'object' work everywhere
76
+ # Needed when evaluating fields/relationships for consistent interface
77
+ def build_friendly_graphql_edge_type_class(superklass)
78
+ klass = Class.new(superklass) do
79
+ alias :original_object :object
80
+ def object
81
+ return @_object if @_object # avoid conflict
82
+
83
+ node = original_object.node # the 'parent' record we joined with
84
+ edge_attrs = node.attributes.select { |k,v| k.to_s.starts_with?('_edge') }
85
+ edge_attrs.transform_keys! { |k| k.to_s.gsub('_edge_', '') }
86
+ edge_model = model.new(edge_attrs)
87
+ edge_model.instance_variable_set(:@__graphiti_resource, resource)
88
+ @_object = edge_model
89
+ @_object
90
+ end
91
+
92
+ def cursor
93
+ original_object.cursor
94
+ end
95
+
96
+ def node
97
+ original_object.node
98
+ end
68
99
  end
69
- registered_parent = Schema.registry.get(@sideload.parent_resource.class)
100
+
101
+ # used in #object
102
+ thru = @sideload.foreign_key.keys.first
103
+ reflection = @sideload.parent_resource.model.reflect_on_association(thru)
104
+ thru_model = reflection.klass
105
+ edge_resource = @sideload.edge_resource.new
106
+ klass.define_method(:model) { thru_model }
107
+ klass.define_method(:resource) { edge_resource }
108
+
109
+ klass
110
+ end
111
+
112
+ def edge_type_class_name(sideload_type)
113
+ registered_parent = Schema.registry.get \
114
+ @sideload.parent_resource.class
70
115
  parent_name = registered_parent[:type].graphql_name
71
- edge_type_class_name = "#{parent_name}To#{sideload_type.graphql_name}Edge"
72
- edge_type_class.define_method :graphql_name do
73
- edge_type_class_name
74
- end
75
- edge_type_class.graphql_name(edge_type_class_name)
76
- edge_type_class
116
+ "#{parent_name}To#{sideload_type.graphql_name}Edge"
77
117
  end
78
118
  end
79
119
  end
@@ -10,6 +10,7 @@ module GraphitiGql
10
10
  def build
11
11
  @resources.each { |resource| ResourceType.new(resource).build }
12
12
  define_entrypoints
13
+ add_value_objects
13
14
  add_relationships
14
15
  @query_class
15
16
  end
@@ -30,30 +31,16 @@ module GraphitiGql
30
31
  end
31
32
 
32
33
  def add_relationships
33
- each_relationship do |type, sideload_type, sideload|
34
- if [:has_many, :many_to_many, :has_one].include?(sideload.type)
35
- Fields::ToMany.new(sideload, sideload_type).apply(type)
36
- else
37
- Fields::ToOne.new(sideload, sideload_type).apply(type)
38
- end
34
+ registry.resource_types.each do |registered|
35
+ resource, type = registered[:resource], registered[:type]
36
+ ResourceType.add_relationships(resource, type)
39
37
  end
40
38
  end
41
39
 
42
- def each_relationship
40
+ def add_value_objects
43
41
  registry.resource_types.each do |registered|
44
- registered[:resource].sideloads.each do |name, sl|
45
- next unless sl.readable?
46
-
47
- registered_sl = if sl.type == :polymorphic_belongs_to
48
- PolymorphicBelongsToInterface
49
- .new(registered[:resource], sl)
50
- .build
51
- else
52
- registry.get(sl.resource.class)
53
- end
54
-
55
- yield registered[:type], registered_sl[:type], sl
56
- end
42
+ resource, type = registered[:resource], registered[:type]
43
+ ResourceType.add_value_objects(resource, type)
57
44
  end
58
45
  end
59
46
  end
@@ -52,7 +52,8 @@ module GraphitiGql
52
52
  # When polymorphic parent, returns the Interface not the Class
53
53
  def resource_types
54
54
  values
55
- .select { |v| v.key?(:resource) && !v[:interface] }
55
+ .select { |v| v.key?(:resource) }
56
+ .reject { |v| v[:interface] || v[:resource].value_object? }
56
57
  .map { |registered| get(registered[:resource]) }
57
58
  end
58
59
 
@@ -14,6 +14,69 @@ module GraphitiGql
14
14
  end
15
15
  end
16
16
 
17
+ def self.add_fields(type, resource, id: true) # id: false for edges
18
+ resource.attributes.each_pair do |name, config|
19
+ next if name == :id && id == false
20
+ if config[:readable]
21
+ Fields::Attribute.new(resource, name, config).apply(type)
22
+ end
23
+ end
24
+ end
25
+
26
+ def self.add_value_objects(resource, type)
27
+ resource.config[:value_objects].each_pair do |name, vo_association|
28
+ vo_resource_class = vo_association.resource_class
29
+ value_object_type = Schema.registry.get(vo_resource_class)[:type]
30
+ if vo_association.array?
31
+ value_object_type = [value_object_type]
32
+ end
33
+
34
+ _array = vo_association.array?
35
+ opts = { null: vo_association.null }
36
+ opts[:deprecation_reason] = vo_association.deprecation_reason if vo_association.deprecation_reason
37
+ type.field name, value_object_type, **opts
38
+ type.define_method name do
39
+ if (method_name = vo_association.readable)
40
+ unless vo_association.parent_resource_class.new.send(method_name)
41
+ raise ::Graphiti::Errors::UnreadableAttribute
42
+ .new(vo_association.parent_resource_class, name)
43
+ end
44
+ end
45
+
46
+ result = vo_resource_class.all({ parent: object }).to_a
47
+ if result.is_a?(Array) && !_array
48
+ result = result.first
49
+ end
50
+ if result == object || result == [object]
51
+ method_name = vo_association.alias.presence || name
52
+ result = object.send(method_name)
53
+ end
54
+ result
55
+ end
56
+ end
57
+ end
58
+
59
+ def self.add_relationships(resource, type)
60
+ resource.sideloads.each do |name, sideload|
61
+ next unless sideload.readable?
62
+
63
+ registered_sl = if sideload.type == :polymorphic_belongs_to
64
+ PolymorphicBelongsToInterface
65
+ .new(resource, sideload)
66
+ .build
67
+ else
68
+ Schema.registry.get(sideload.resource.class)
69
+ end
70
+ sideload_type = registered_sl[:type]
71
+
72
+ if [:has_many, :many_to_many, :has_one].include?(sideload.type)
73
+ Fields::ToMany.new(sideload, sideload_type).apply(type)
74
+ else
75
+ Fields::ToOne.new(sideload, sideload_type).apply(type)
76
+ end
77
+ end
78
+ end
79
+
17
80
  def initialize(resource, implements: nil)
18
81
  @resource = resource
19
82
  @implements = implements
@@ -86,14 +149,10 @@ module GraphitiGql
86
149
  def name
87
150
  registry.key_for(@resource)
88
151
  end
89
-
152
+
90
153
  def add_fields(type, resource)
91
- resource.attributes.each_pair do |name, config|
92
- if config[:readable]
93
- Fields::Attribute.new(@resource, name, config).apply(type)
94
- end
95
- end
96
- end
154
+ self.class.add_fields(type, resource)
155
+ end
97
156
 
98
157
  def build_connection_class
99
158
  klass = Class.new(GraphQL::Types::Relay::BaseConnection)
@@ -4,6 +4,31 @@ module GraphitiGql
4
4
  self.time_precision = 6
5
5
  end
6
6
 
7
+ class DatetimeRange < GraphQL::Schema::Object
8
+ field :from, GraphQL::Types::ISO8601DateTime
9
+ field :to, GraphQL::Types::ISO8601DateTime
10
+ end
11
+
12
+ class PreciseDatetimeRange < GraphQL::Schema::Object
13
+ field :from, PreciseDatetime
14
+ field :to, PreciseDatetime
15
+ end
16
+
17
+ class StringRange < GraphQL::Schema::Object
18
+ field :from, String
19
+ field :to, String
20
+ end
21
+
22
+ class IntegerRange < GraphQL::Schema::Object
23
+ field :from, Integer
24
+ field :to, Integer
25
+ end
26
+
27
+ class FloatRange < GraphQL::Schema::Object
28
+ field :from, Float
29
+ field :to, Float
30
+ end
31
+
7
32
  GQL_TYPE_MAP = {
8
33
  integer_id: String,
9
34
  string: String,
@@ -16,13 +41,23 @@ module GraphitiGql
16
41
  datetime: GraphQL::Types::ISO8601DateTime,
17
42
  precise_datetime: PreciseDatetime,
18
43
  hash: GraphQL::Types::JSON,
44
+ string_range: StringRange,
45
+ integer_range: IntegerRange,
46
+ float_range: FloatRange,
47
+ datetime_range: DatetimeRange,
48
+ precise_datetime_range: PreciseDatetimeRange,
19
49
  array: [GraphQL::Types::JSON],
20
50
  array_of_strings: [String],
21
51
  array_of_integers: [Integer],
22
52
  array_of_floats: [Float],
23
53
  array_of_dates: [GraphQL::Types::ISO8601Date],
24
54
  array_of_datetimes: [GraphQL::Types::ISO8601DateTime],
25
- array_of_precise_datetimes: [PreciseDatetime]
55
+ array_of_precise_datetimes: [PreciseDatetime],
56
+ array_of_string_ranges: [StringRange],
57
+ array_of_integer_ranges: [IntegerRange],
58
+ array_of_float_ranges: [FloatRange],
59
+ array_of_datetime_ranges: [DatetimeRange],
60
+ array_of_precise_datetime_ranges: [PreciseDatetimeRange]
26
61
  }
27
62
 
28
63
  class RelayConnectionExtension < GraphQL::Schema::Field::ConnectionExtension
@@ -1,3 +1,3 @@
1
1
  module GraphitiGql
2
- VERSION = "0.2.21"
2
+ VERSION = "0.2.24"
3
3
  end
data/lib/graphiti_gql.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "active_support/core_ext/object/json"
2
2
  require "graphql"
3
3
  require 'graphql/batch'
4
+ require 'active_model'
4
5
  require "graphiti_gql/graphiti_hax"
5
6
  require "graphiti_gql/version"
6
7
  require "graphiti_gql/errors"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti_gql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.21
4
+ version: 0.2.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-09 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -52,6 +52,26 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.3.9
55
+ - !ruby/object:Gem::Dependency
56
+ name: activemodel
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">"
60
+ - !ruby/object:Gem::Version
61
+ version: '6.0'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '8.0'
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">"
70
+ - !ruby/object:Gem::Version
71
+ version: '6.0'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '8.0'
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: bundler
57
77
  requirement: !ruby/object:Gem::Requirement
@@ -94,21 +114,7 @@ dependencies:
94
114
  - - "~>"
95
115
  - !ruby/object:Gem::Version
96
116
  version: '3.0'
97
- - !ruby/object:Gem::Dependency
98
- name: activemodel
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '7.0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '7.0'
111
- description:
117
+ description:
112
118
  email:
113
119
  - richmolj@gmail.com
114
120
  executables: []
@@ -169,7 +175,7 @@ licenses:
169
175
  - MIT
170
176
  metadata:
171
177
  homepage_uri: https://www.graphiti.dev
172
- post_install_message:
178
+ post_install_message:
173
179
  rdoc_options: []
174
180
  require_paths:
175
181
  - lib
@@ -184,8 +190,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
190
  - !ruby/object:Gem::Version
185
191
  version: '0'
186
192
  requirements: []
187
- rubygems_version: 3.0.3.1
188
- signing_key:
193
+ rubygems_version: 3.3.7
194
+ signing_key:
189
195
  specification_version: 4
190
196
  summary: GraphQL support for Graphiti
191
197
  test_files: []