graphiti_gql 0.2.34 → 0.2.36

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: 389d9a348fca14259146eef09736c6a7358ff7ad824282fe6c838ee61ebf1ca0
4
- data.tar.gz: 50dc70797c83ae98540c902df942487c3a3b4f183243331a51b44adc19064baf
3
+ metadata.gz: 13d49008bd87abf491d57b808a580e37b3e5858ca9154819de0193b97c974324
4
+ data.tar.gz: 6d31657f529586af79e08686521485b255685b4f5aac7ebee0f283f1fd244878
5
5
  SHA512:
6
- metadata.gz: c58333b9a7bbd43a68e27974d6a6cfdfdb9087e97ed5ca42d37be102995c15470f4279cd6499eef3ef7157f648dd8749e3df7d8921277139cbef39cd4bbaa34a
7
- data.tar.gz: 378e41e41e6c1aa19b65274f29233aec4371e9cf44fd3dcf9dbf17404029230454ca8042bde7341177fe6349b9cc7233332546f4c10cae7b4ff4563176a9697d
6
+ metadata.gz: b6ad8cf8e9e4385010b6b2b130d4da1e898a9184cf0590de248387eeaba96c4b469268997cbba2337d54f43c844f48b804cd9c7119659088535130795a53d873
7
+ data.tar.gz: 6ba27d4b084235298244215140acac009a0a9081c6aea2bca9f2d6e83aa919ab8e8e96045642ab5c8bb542bc48015832edfb5991841988b4618c5b5a98ddfb55
@@ -453,7 +453,7 @@ module GraphitiGql
453
453
  column = column_for(scope, attribute)
454
454
  map = value.map { |v|
455
455
  v = v.downcase unless mysql?(scope)
456
- v = Sanitizer.sanitize_like(v, escape_char)
456
+ v = Graphiti::Adapters::ActiveRecord::Sanitizer.sanitize_like(v, escape_char)
457
457
  block.call v
458
458
  }
459
459
  arel = column
@@ -4,6 +4,7 @@ module GraphitiGql
4
4
  class ToMany
5
5
  def initialize(sideload, sideload_type)
6
6
  @sideload = sideload
7
+ @sideload_resource = Schema.registry.get(sideload.resource.class)[:resource]
7
8
  @sideload_type = sideload_type
8
9
  @connection_type = find_or_build_connection
9
10
  end
@@ -19,9 +20,9 @@ module GraphitiGql
19
20
  field_type,
20
21
  **opts
21
22
  unless has_one?
22
- field.extension(RelayConnectionExtension, resource: @sideload.resource.class)
23
+ field.extension(RelayConnectionExtension, resource: @sideload_resource)
23
24
  end
24
- ListArguments.new(@sideload.resource.class, @sideload).apply(field)
25
+ ListArguments.new(@sideload_resource, @sideload).apply(field)
25
26
  _sideload = @sideload
26
27
  type.define_method(@sideload.name) do |**arguments|
27
28
  Util.is_readable_sideload!(_sideload)
@@ -8,10 +8,7 @@ module GraphitiGql
8
8
  end
9
9
 
10
10
  def build
11
- @resources.each { |resource| ResourceType.new(resource).build }
12
11
  define_entrypoints
13
- add_value_objects
14
- add_relationships
15
12
  @query_class
16
13
  end
17
14
 
@@ -29,20 +26,6 @@ module GraphitiGql
29
26
  end
30
27
  end
31
28
  end
32
-
33
- def add_relationships
34
- registry.resource_types.each do |registered|
35
- resource, type = registered[:resource], registered[:type]
36
- ResourceType.add_relationships(resource, type)
37
- end
38
- end
39
-
40
- def add_value_objects
41
- registry.resource_types(value_objects: false).each do |registered|
42
- resource, type = registered[:resource], registered[:type]
43
- ResourceType.add_value_objects(resource, type)
44
- end
45
- end
46
29
  end
47
30
  end
48
31
  end
@@ -119,6 +119,7 @@ module GraphitiGql
119
119
 
120
120
  def generate
121
121
  klass = Class.new(::GraphitiGql.config.base_schema || ::GraphQL::Schema)
122
+ return if klass.query
122
123
  # TODO inherit from klass.query if exists
123
124
  klass.query(Query.new(@resources).build)
124
125
  klass.use(GraphQL::Batch)
@@ -1,3 +1,3 @@
1
1
  module GraphitiGql
2
- VERSION = "0.2.34"
2
+ VERSION = "0.2.36"
3
3
  end
data/lib/graphiti_gql.rb CHANGED
@@ -54,7 +54,6 @@ module GraphitiGql
54
54
  end
55
55
 
56
56
  def self.schema!
57
- Schema::Registry.instance.clear
58
57
  resources ||= Graphiti.resources.reject(&:abstract_class?)
59
58
  @schema = Schema.new(resources).generate
60
59
  end
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.34
4
+ version: 0.2.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2022-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql