graphiti_gql 0.2.32 → 0.2.33

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: e8d0cda6314cfd3485283ae277bdaa56494a4b8eae9c62f9037b5b78f17b2825
4
- data.tar.gz: 28fcbab36f65c81bb8a673aefaefe7bd54888f02ca741fcf5a889f2f858e094a
3
+ metadata.gz: 19b3af9f398319f335154dfffbf0eb8b13987a7ce7860bfaf273b18361715a57
4
+ data.tar.gz: e2c2e261a65e161817ed1f1a6aca5d07324dce1df984e37c2a40c18694d6fc27
5
5
  SHA512:
6
- metadata.gz: 864e7b0fbd88fb01f3aa8bc0490ce144a4d62e02c9d9ce30dc032f6209b91cf9e5766b06bf85113cbdb9d4603dd397b8b831fcbc8f76ff123ff12307e82a4815
7
- data.tar.gz: 61304ca30da99696a76c625c3737037429182df25ca6271c9f779bbbfa96740e2d1b3c792cbaaea560a31b52edc90f342b49a8aab12d607ece04804415e3d1e1
6
+ metadata.gz: 9f0cc9d62355cbf98382b1af4f0085fca190a19546be02d8d17e4bd7d93f548964f5716a13f2acc47083484ea386df604e845776bfd76dc2dbd22a44898d1605
7
+ data.tar.gz: 68f697d8c75a8787a9ee23dd0263a96df8bfd70e873015e67f43c34ec7d84e9bf1b07e51766ae550fb503d19cd810a9b014d273902ad0cce2e65dc054d87bb5e
@@ -143,6 +143,14 @@ module GraphitiGql
143
143
  end
144
144
  end
145
145
 
146
+ def paginatable=(val)
147
+ config[:paginatable] = val
148
+ end
149
+
150
+ def paginatable
151
+ config[:paginatable] == false ? false : true
152
+ end
153
+
146
154
  def value_object?
147
155
  !!config[:is_value_object]
148
156
  end
@@ -12,8 +12,8 @@ module GraphitiGql
12
12
  @registered[:type].connection_type,
13
13
  null: false,
14
14
  connection: false,
15
- extensions: [RelayConnectionExtension],
16
15
  extras: [:lookahead]
16
+ field.extension(RelayConnectionExtension, resource: resource)
17
17
  ListArguments.new(resource).apply(field)
18
18
  query.define_method name do |**arguments|
19
19
  params = Util.params_from_args(arguments)
@@ -14,11 +14,13 @@ module GraphitiGql
14
14
  connection: false,
15
15
  extras: [:lookahead]
16
16
  }
17
- opts[:extensions] = [RelayConnectionExtension] unless has_one?
18
17
  field_type = has_one? ? @sideload_type : @connection_type
19
18
  field = type.field @sideload.name,
20
19
  field_type,
21
20
  **opts
21
+ unless has_one?
22
+ field.extension(RelayConnectionExtension, resource: @sideload.resource.class)
23
+ end
22
24
  ListArguments.new(@sideload.resource.class, @sideload).apply(field)
23
25
  _sideload = @sideload
24
26
  type.define_method(@sideload.name) do |**arguments|
@@ -62,6 +62,10 @@ module GraphitiGql
62
62
  }
63
63
 
64
64
  class RelayConnectionExtension < GraphQL::Schema::Field::ConnectionExtension
65
+ def apply
66
+ super if options[:resource].paginatable
67
+ end
68
+
65
69
  def resolve(object:, arguments:, context:)
66
70
  next_args = arguments.dup
67
71
  yield(object, next_args, arguments)
@@ -1,3 +1,3 @@
1
1
  module GraphitiGql
2
- VERSION = "0.2.32"
2
+ VERSION = "0.2.33"
3
3
  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.32
4
+ version: 0.2.33
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-02 00:00:00.000000000 Z
11
+ date: 2022-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql