elasticgraph-schema_definition 0.19.2.2 → 0.19.3.0
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/lib/elastic_graph/schema_definition/api.rb +11 -4
- data/lib/elastic_graph/schema_definition/factory.rb +3 -3
- data/lib/elastic_graph/schema_definition/mixins/has_indices.rb +16 -3
- data/lib/elastic_graph/schema_definition/mixins/supports_filtering_and_aggregation.rb +6 -6
- data/lib/elastic_graph/schema_definition/results.rb +4 -4
- data/lib/elastic_graph/schema_definition/schema_elements/built_in_types.rb +4 -4
- data/lib/elastic_graph/schema_definition/schema_elements/field.rb +80 -7
- data/lib/elastic_graph/schema_definition/schema_elements/type_with_subfields.rb +25 -6
- metadata +23 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52eb4e3f895b1134d96c0ea8a276f5455ef27a0f4f05c04291bc577da81d9129
|
4
|
+
data.tar.gz: 771970069f2b3d26a5c0f3d6790713bc57d35834de8c26a489ce7e7aca0e9332
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 412f07499f48649b2afd70dd49030cdabffb850fb8ee072755b2ed72424d908aafb5b65b76f563ef478e11b1813b052699ac9e897c0923a0c73413c9923ef13b
|
7
|
+
data.tar.gz: f4ae38086c3de1f0732cda734637c50506c9b08b380ea43b0bf428bca6170cdf9b44461ac07b750cd22e0ff37b86f31e234b21bde68368fe3c954c345b44b97c
|
@@ -300,28 +300,35 @@ module ElasticGraph
|
|
300
300
|
# @param defined_at [String] the `require` path of the resolver
|
301
301
|
# @param resolver_config [Hash<Symbol, Object>] configuration options for the resolver, to support parameterized resolvers
|
302
302
|
# @return [void]
|
303
|
+
# @see Mixins::HasIndices#resolve_fields_with
|
304
|
+
# @see SchemaElements::Field#resolve_with
|
303
305
|
#
|
304
306
|
# @example Register a custom resolver for use by a custom `Query` field
|
305
307
|
# # In `add_resolver.rb`:
|
306
308
|
# class AddResolver
|
307
309
|
# def initialize(elasticgraph_graphql:, config:)
|
310
|
+
# @multiplier = config.fetch(:multiplier, 1)
|
308
311
|
# end
|
309
312
|
#
|
310
313
|
# def resolve(field:, object:, args:, context:)
|
311
|
-
# args.fetch("x") + args.fetch("y")
|
314
|
+
# sum = args.fetch("x") + args.fetch("y")
|
315
|
+
# sum * @multiplier
|
312
316
|
# end
|
313
317
|
# end
|
314
318
|
#
|
315
319
|
# # In `config/schema.rb`:
|
316
320
|
# ElasticGraph.define_schema do |schema|
|
317
321
|
# require(resolver_path = "add_resolver")
|
318
|
-
# schema.register_graphql_resolver :add,
|
322
|
+
# schema.register_graphql_resolver :add,
|
323
|
+
# AddResolver,
|
324
|
+
# defined_at: resolver_path,
|
325
|
+
# multiplier: 2 # extra args are passed to the resolver within `config`.
|
319
326
|
#
|
320
327
|
# schema.on_root_query_type do |t|
|
321
328
|
# t.field "add", "Int" do |f|
|
322
329
|
# f.argument "x", "Int!"
|
323
330
|
# f.argument "y", "Int!"
|
324
|
-
# f.
|
331
|
+
# f.resolve_with :add
|
325
332
|
# end
|
326
333
|
# end
|
327
334
|
# end
|
@@ -354,7 +361,7 @@ module ElasticGraph
|
|
354
361
|
#
|
355
362
|
# schema.on_root_query_type do |t|
|
356
363
|
# t.field "artist", "Artist" do |f|
|
357
|
-
# f.
|
364
|
+
# f.resolve_with :artist
|
358
365
|
# end
|
359
366
|
# end
|
360
367
|
# end
|
@@ -286,7 +286,7 @@ module ElasticGraph
|
|
286
286
|
new_object_type @state.type_ref(index_leaf_type).as_aggregated_values.name do |type|
|
287
287
|
type.graphql_only true
|
288
288
|
type.documentation "A return type used from aggregations to provided aggregated values over `#{index_leaf_type}` fields."
|
289
|
-
type.
|
289
|
+
type.resolve_fields_with :object_with_lookahead
|
290
290
|
type.override_runtime_metadata(elasticgraph_category: :scalar_aggregated_values)
|
291
291
|
|
292
292
|
type.field @state.schema_elements.approximate_distinct_value_count, "JsonSafeLong", graphql_only: true do |f|
|
@@ -435,7 +435,7 @@ module ElasticGraph
|
|
435
435
|
type_ref = @state.type_ref(type_name)
|
436
436
|
new_object_type type_ref.as_edge.name do |t|
|
437
437
|
t.relay_pagination_type = true
|
438
|
-
t.
|
438
|
+
t.resolve_fields_with :object_without_lookahead
|
439
439
|
t.override_runtime_metadata(elasticgraph_category: :relay_edge)
|
440
440
|
|
441
441
|
t.documentation <<~EOS
|
@@ -463,7 +463,7 @@ module ElasticGraph
|
|
463
463
|
type_ref = @state.type_ref(type_name)
|
464
464
|
new_object_type type_ref.as_connection.name do |t|
|
465
465
|
t.relay_pagination_type = true
|
466
|
-
t.
|
466
|
+
t.resolve_fields_with :object_without_lookahead
|
467
467
|
t.override_runtime_metadata(elasticgraph_category: :relay_connection)
|
468
468
|
|
469
469
|
if support_pagination
|
@@ -20,14 +20,14 @@ module ElasticGraph
|
|
20
20
|
attr_reader :runtime_metadata_overrides
|
21
21
|
|
22
22
|
# @return [::Symbol, nil] the default GraphQL resolver to use for fields on this type
|
23
|
-
|
24
|
-
# @dynamic default_graphql_resolver
|
23
|
+
attr_reader :default_graphql_resolver
|
24
|
+
# @dynamic default_graphql_resolver
|
25
25
|
|
26
26
|
# @private
|
27
27
|
def initialize(*args, **options)
|
28
28
|
super(*args, **options)
|
29
29
|
@runtime_metadata_overrides = {}
|
30
|
-
|
30
|
+
resolve_fields_with :get_record_field_value
|
31
31
|
yield self
|
32
32
|
|
33
33
|
# Freeze `indices` so that the indexable status of a type does not change after instantiation.
|
@@ -72,6 +72,19 @@ module ElasticGraph
|
|
72
72
|
indices.replace([Indexing::Index.new(name, settings, schema_def_state, self, &block)])
|
73
73
|
end
|
74
74
|
|
75
|
+
# Configures the default GraphQL resolver that will be used to resolve the fields of this type. Individual fields
|
76
|
+
# can override this using {SchemaElements::Field#resolve_with}.
|
77
|
+
#
|
78
|
+
# @param default_resolver_name [Symbol] name of the GraphQL resolver to use as the default for fields of this type
|
79
|
+
# @param config [Hash<Symbol, Object>] configuration parameters for the resolver
|
80
|
+
# @return [void]
|
81
|
+
# @see API#register_graphql_resolver
|
82
|
+
def resolve_fields_with(default_resolver_name, **config)
|
83
|
+
@default_graphql_resolver = default_resolver_name&.then do |name|
|
84
|
+
SchemaArtifacts::RuntimeMetadata::ConfiguredGraphQLResolver.new(name, config)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
75
88
|
# List of indices. (Currently we only store one but we may support multiple in the future).
|
76
89
|
#
|
77
90
|
# @private
|
@@ -46,7 +46,7 @@ module ElasticGraph
|
|
46
46
|
# Record metadata that is necessary for elasticgraph-graphql to correctly recognize and handle
|
47
47
|
# this sub-aggregation correctly.
|
48
48
|
t.override_runtime_metadata(elasticgraph_category: :nested_sub_aggregation_connection)
|
49
|
-
t.
|
49
|
+
t.resolve_fields_with :object_without_lookahead
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -117,7 +117,7 @@ module ElasticGraph
|
|
117
117
|
schema_def_state.sub_aggregation_paths_for(nested_field_ref.parent_type).map do |path|
|
118
118
|
schema_def_state.factory.new_object_type type_ref.as_sub_aggregation(parent_doc_types: path.parent_doc_types).name do |t|
|
119
119
|
t.documentation "Return type representing a bucket of `#{name}` objects for a sub-aggregation within each `#{type_ref.as_parent_aggregation(parent_doc_types: path.parent_doc_types).name}`."
|
120
|
-
t.
|
120
|
+
t.resolve_fields_with :object_without_lookahead
|
121
121
|
|
122
122
|
t.field schema_def_state.schema_elements.count_detail, "AggregationCountDetail", graphql_only: true do |f|
|
123
123
|
f.documentation "Details of the count of `#{name}` documents in a sub-aggregation bucket."
|
@@ -165,7 +165,7 @@ module ElasticGraph
|
|
165
165
|
schema_def_state.factory.new_object_type agg_sub_aggs_type_ref.name do |t|
|
166
166
|
under_field_description = "under `#{path.field_path_string}` " unless path.field_path.empty?
|
167
167
|
t.documentation "Provides access to the `#{schema_def_state.schema_elements.sub_aggregations}` #{under_field_description}within each `#{type_ref.as_parent_aggregation(parent_doc_types: path.parent_doc_types).name}`."
|
168
|
-
t.
|
168
|
+
t.resolve_fields_with :object_with_lookahead
|
169
169
|
|
170
170
|
sub_aggregatable_fields.each do |field|
|
171
171
|
if field.nested?
|
@@ -228,7 +228,7 @@ module ElasticGraph
|
|
228
228
|
|
229
229
|
# Record metadata that is necessary for elasticgraph-graphql to correctly recognize and handle
|
230
230
|
# this indexed aggregation type correctly.
|
231
|
-
t.
|
231
|
+
t.resolve_fields_with :object_without_lookahead
|
232
232
|
t.override_runtime_metadata(source_type: name, elasticgraph_category: :indexed_aggregation)
|
233
233
|
end
|
234
234
|
end
|
@@ -240,7 +240,7 @@ module ElasticGraph
|
|
240
240
|
|
241
241
|
new_non_empty_object_type type_ref.as_grouped_by.name do |t|
|
242
242
|
t.documentation "Type used to specify the `#{name}` fields to group by for aggregations."
|
243
|
-
t.
|
243
|
+
t.resolve_fields_with :object_with_lookahead
|
244
244
|
|
245
245
|
graphql_fields_by_name.values.each do |field|
|
246
246
|
field.define_grouped_by_field(t)
|
@@ -255,7 +255,7 @@ module ElasticGraph
|
|
255
255
|
|
256
256
|
new_non_empty_object_type type_ref.as_aggregated_values.name do |t|
|
257
257
|
t.documentation "Type used to perform aggregation computations on `#{name}` fields."
|
258
|
-
t.
|
258
|
+
t.resolve_fields_with :object_with_lookahead
|
259
259
|
|
260
260
|
graphql_fields_by_name.values.each do |field|
|
261
261
|
field.define_aggregated_values_field(t)
|
@@ -116,7 +116,7 @@ module ElasticGraph
|
|
116
116
|
def define_root_graphql_type
|
117
117
|
state.api.object_type "Query" do |query_type|
|
118
118
|
query_type.documentation "The query entry point for the entire schema."
|
119
|
-
query_type.
|
119
|
+
query_type.resolve_fields_with nil
|
120
120
|
|
121
121
|
state.types_by_name.values.select(&:indexed?).sort_by(&:name).each do |type|
|
122
122
|
# @type var indexed_type: Mixins::HasIndices & _Type
|
@@ -130,7 +130,7 @@ module ElasticGraph
|
|
130
130
|
singular: indexed_type.singular_root_query_field_name
|
131
131
|
) do |f|
|
132
132
|
f.documentation "Fetches `#{indexed_type.name}`s based on the provided arguments."
|
133
|
-
f.
|
133
|
+
f.resolve_with :list_records
|
134
134
|
f.hide_relationship_runtime_metadata = true
|
135
135
|
indexed_type.root_query_fields_customizations&.call(f)
|
136
136
|
end
|
@@ -364,8 +364,8 @@ module ElasticGraph
|
|
364
364
|
.object_types_by_name
|
365
365
|
.each do |type_name, type|
|
366
366
|
type.graphql_fields_by_name.each do |field_name, field|
|
367
|
-
if (
|
368
|
-
fields_by_resolvers[
|
367
|
+
if (resolver_name = field.resolver&.name)
|
368
|
+
fields_by_resolvers[resolver_name] << "#{type_name}.#{field_name}"
|
369
369
|
end
|
370
370
|
end
|
371
371
|
end
|
@@ -394,7 +394,7 @@ module ElasticGraph
|
|
394
394
|
# to go from non-null to null, but is not a breaking change to make it non-null
|
395
395
|
# in the future.
|
396
396
|
register_framework_object_type "PageInfo" do |t|
|
397
|
-
t.
|
397
|
+
t.resolve_fields_with :object_without_lookahead
|
398
398
|
|
399
399
|
t.documentation <<~EOS
|
400
400
|
Provides information about the specific fetched page. This implements the `PageInfo`
|
@@ -512,7 +512,7 @@ module ElasticGraph
|
|
512
512
|
|
513
513
|
register_framework_object_type "AggregationCountDetail" do |t|
|
514
514
|
t.documentation "Provides detail about an aggregation `#{names.count}`."
|
515
|
-
t.
|
515
|
+
t.resolve_fields_with :object_without_lookahead
|
516
516
|
|
517
517
|
t.field names.approximate_value, "JsonSafeLong!", graphql_only: true do |f|
|
518
518
|
f.documentation <<~EOS
|
@@ -1294,7 +1294,7 @@ module ElasticGraph
|
|
1294
1294
|
date = schema_def_state.type_ref("Date")
|
1295
1295
|
register_framework_object_type date.as_grouped_by.name do |t|
|
1296
1296
|
t.documentation "Allows for grouping `Date` values based on the desired return type."
|
1297
|
-
t.
|
1297
|
+
t.resolve_fields_with :object_with_lookahead
|
1298
1298
|
t.override_runtime_metadata(elasticgraph_category: :date_grouped_by_object)
|
1299
1299
|
|
1300
1300
|
t.field names.as_date, "Date", graphql_only: true do |f|
|
@@ -1312,7 +1312,7 @@ module ElasticGraph
|
|
1312
1312
|
date_time = schema_def_state.type_ref("DateTime")
|
1313
1313
|
register_framework_object_type date_time.as_grouped_by.name do |t|
|
1314
1314
|
t.documentation "Allows for grouping `DateTime` values based on the desired return type."
|
1315
|
-
t.
|
1315
|
+
t.resolve_fields_with :object_with_lookahead
|
1316
1316
|
t.override_runtime_metadata(elasticgraph_category: :date_grouped_by_object)
|
1317
1317
|
|
1318
1318
|
t.field names.as_date_time, "DateTime", graphql_only: true do |f|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
require "delegate"
|
10
10
|
require "elastic_graph/constants"
|
11
|
+
require "elastic_graph/schema_artifacts/runtime_metadata/configured_graphql_resolver"
|
11
12
|
require "elastic_graph/schema_definition/indexing/field"
|
12
13
|
require "elastic_graph/schema_definition/indexing/field_reference"
|
13
14
|
require "elastic_graph/schema_definition/mixins/has_directives"
|
@@ -80,8 +81,6 @@ module ElasticGraph
|
|
80
81
|
# @private
|
81
82
|
# @!attribute [rw] non_nullable_in_json_schema
|
82
83
|
# @private
|
83
|
-
# @!attribute [rw] backing_indexing_field
|
84
|
-
# @private
|
85
84
|
# @!attribute [rw] as_input
|
86
85
|
# @private
|
87
86
|
# @!attribute [rw] legacy_grouping_schema
|
@@ -91,7 +90,7 @@ module ElasticGraph
|
|
91
90
|
:filter_customizations, :grouped_by_customizations, :sub_aggregations_customizations,
|
92
91
|
:aggregated_values_customizations, :sort_order_enum_value_customizations,
|
93
92
|
:args, :sortable, :filterable, :aggregatable, :groupable, :graphql_only, :source, :runtime_field_script, :relationship, :singular_name,
|
94
|
-
:computation_detail, :non_nullable_in_json_schema, :
|
93
|
+
:computation_detail, :non_nullable_in_json_schema, :as_input,
|
95
94
|
:legacy_grouping_schema, :name_in_index, :resolver
|
96
95
|
)
|
97
96
|
include Mixins::HasDocumentation
|
@@ -105,7 +104,7 @@ module ElasticGraph
|
|
105
104
|
accuracy_confidence: :high, name_in_index: name,
|
106
105
|
type_for_derived_types: nil, graphql_only: nil, singular: nil,
|
107
106
|
sortable: nil, filterable: nil, aggregatable: nil, groupable: nil,
|
108
|
-
|
107
|
+
as_input: false, legacy_grouping_schema: false, resolver: nil
|
109
108
|
)
|
110
109
|
type_ref = schema_def_state.type_ref(type)
|
111
110
|
super(
|
@@ -134,20 +133,33 @@ module ElasticGraph
|
|
134
133
|
singular_name: singular,
|
135
134
|
name_in_index: name_in_index,
|
136
135
|
non_nullable_in_json_schema: false,
|
137
|
-
backing_indexing_field: backing_indexing_field,
|
138
136
|
as_input: as_input,
|
139
137
|
legacy_grouping_schema: legacy_grouping_schema,
|
140
138
|
resolver: resolver
|
141
139
|
)
|
142
140
|
|
143
|
-
if name != name_in_index
|
144
|
-
|
141
|
+
if name != name_in_index
|
142
|
+
if graphql_only
|
143
|
+
schema_def_state.after_user_definition_complete do
|
144
|
+
unless backing_indexing_field
|
145
|
+
raise Errors::SchemaError,
|
146
|
+
"GraphQL-only field `#{parent_type.name}.#{name}` has a `name_in_index` (#{name_in_index}) which does not reference an " \
|
147
|
+
"existing indexing field. To proceed, remove `graphql_only: true` or update `name_in_index` to match an existing indexing field."
|
148
|
+
end
|
149
|
+
end
|
150
|
+
elsif name_in_index.include?(".")
|
151
|
+
raise Errors::SchemaError,
|
152
|
+
"#{self} has an invalid `name_in_index`: #{name_in_index.inspect}. " \
|
153
|
+
"Only `graphql_only: true` fields can have a `name_in_index` that references a child field."
|
154
|
+
end
|
145
155
|
end
|
146
156
|
|
147
157
|
schema_def_state.register_user_defined_field(self)
|
148
158
|
yield self if block_given?
|
149
159
|
end
|
150
160
|
|
161
|
+
private :resolver=
|
162
|
+
|
151
163
|
# @private
|
152
164
|
@@initialize_param_names = instance_method(:initialize).parameters.map(&:last).to_set
|
153
165
|
|
@@ -448,6 +460,46 @@ module ElasticGraph
|
|
448
460
|
)
|
449
461
|
end
|
450
462
|
|
463
|
+
# Configures the GraphQL resolver used to resolve this field. If not set, the resolver configured on the parent type
|
464
|
+
# via {Mixins::HasIndices#resolve_fields_with} will be used.
|
465
|
+
#
|
466
|
+
# @param resolver_name [Symbol] name of the GraphQL resolver
|
467
|
+
# @param config [Hash<Symbol, Object>] configuration parameters for the resolver
|
468
|
+
# @return [void]
|
469
|
+
# @see API#register_graphql_resolver
|
470
|
+
#
|
471
|
+
# @example Use a custom resolver for a custom `Query` field
|
472
|
+
# # In `add_resolver.rb`:
|
473
|
+
# class AddResolver
|
474
|
+
# def initialize(elasticgraph_graphql:, config:)
|
475
|
+
# @multiplier = config.fetch(:multiplier, 1)
|
476
|
+
# end
|
477
|
+
#
|
478
|
+
# def resolve(field:, object:, args:, context:)
|
479
|
+
# sum = args.fetch("x") + args.fetch("y")
|
480
|
+
# sum * @multiplier
|
481
|
+
# end
|
482
|
+
# end
|
483
|
+
#
|
484
|
+
# # In `config/schema.rb`:
|
485
|
+
# ElasticGraph.define_schema do |schema|
|
486
|
+
# require(resolver_path = "add_resolver")
|
487
|
+
# schema.register_graphql_resolver :add, AddResolver, defined_at: resolver_path
|
488
|
+
#
|
489
|
+
# schema.on_root_query_type do |t|
|
490
|
+
# t.field "add", "Int" do |f|
|
491
|
+
# f.argument "x", "Int!"
|
492
|
+
# f.argument "y", "Int!"
|
493
|
+
#
|
494
|
+
# # Extra args (`multiplier: 2`, in this example) are passed to the resolver within `config`.
|
495
|
+
# f.resolve_with :add, multiplier: 2
|
496
|
+
# end
|
497
|
+
# end
|
498
|
+
# end
|
499
|
+
def resolve_with(resolver_name, **config)
|
500
|
+
self.resolver = resolver_name&.then { |name| SchemaArtifacts::RuntimeMetadata::ConfiguredGraphQLResolver.new(name, config) }
|
501
|
+
end
|
502
|
+
|
451
503
|
# @private
|
452
504
|
def runtime_script(script)
|
453
505
|
self.runtime_field_script = script
|
@@ -934,6 +986,27 @@ module ElasticGraph
|
|
934
986
|
)
|
935
987
|
end
|
936
988
|
|
989
|
+
# The alternate field that is backing this field in the datastore index. Will only be non-`nil` for `graphql_only` fields.
|
990
|
+
# @return [Field, nil] the field backing this field in the index
|
991
|
+
#
|
992
|
+
# @private
|
993
|
+
def backing_indexing_field
|
994
|
+
return nil unless graphql_only
|
995
|
+
|
996
|
+
type = parent_type
|
997
|
+
field = nil
|
998
|
+
|
999
|
+
name_in_index.split(".").each do |path_part|
|
1000
|
+
if (field = type&.indexing_fields_by_name_in_index&.fetch(path_part, nil))
|
1001
|
+
type = field.type.fully_unwrapped.as_object_type
|
1002
|
+
else
|
1003
|
+
return nil
|
1004
|
+
end
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
field
|
1008
|
+
end
|
1009
|
+
|
937
1010
|
private
|
938
1011
|
|
939
1012
|
def args_sdl(joiner:, after_opening_paren: "", &arg_selector)
|
@@ -279,6 +279,12 @@ module ElasticGraph
|
|
279
279
|
# differently named field in the index.
|
280
280
|
# @param singular [String] indicates what the singular form of a field's name is. When provided, ElasticGraph will define a
|
281
281
|
# `groupedBy` field (using the singular form) allowing clients to group by individual values from the field.
|
282
|
+
# @param aggregatable [Boolean] force-enables or disables the ability for aggregation queries to aggregate over this field.
|
283
|
+
# When not provided, ElasticGraph will infer field aggregatability based on the field's GraphQL type and mapping type.
|
284
|
+
# @param filterable [Boolean] force-enables or disables the ability for queries to filter by this field. When not provided,
|
285
|
+
# ElasticGraph will infer field filterability based on the field's GraphQL type and mapping type.
|
286
|
+
# @param groupable [Boolean] force-enables or disables the ability for aggregation queries to group by this field. When
|
287
|
+
# not provided, ElasticGraph will infer field groupability based on the field's GraphQL type and mapping type.
|
282
288
|
# @yield [Field] the field for further customization
|
283
289
|
# @return [void]
|
284
290
|
#
|
@@ -295,24 +301,37 @@ module ElasticGraph
|
|
295
301
|
# t.index "authors"
|
296
302
|
# end
|
297
303
|
# end
|
298
|
-
def paginated_collection_field(
|
304
|
+
def paginated_collection_field(
|
305
|
+
name,
|
306
|
+
element_type,
|
307
|
+
name_in_index: name,
|
308
|
+
graphql_only: false,
|
309
|
+
singular: nil,
|
310
|
+
groupable: !!singular,
|
311
|
+
filterable: nil,
|
312
|
+
aggregatable: nil,
|
313
|
+
&block
|
314
|
+
)
|
299
315
|
element_type_ref = schema_def_state.type_ref(element_type).to_final_form
|
300
316
|
element_type = element_type_ref.name
|
301
317
|
|
302
318
|
schema_def_state.paginated_collection_element_types << element_type
|
303
319
|
|
304
|
-
|
320
|
+
unless graphql_only
|
321
|
+
field(name, "[#{element_type}!]!", indexing_only: true, name_in_index: name_in_index, &block)
|
322
|
+
end
|
305
323
|
|
306
324
|
field(
|
307
325
|
name,
|
308
326
|
element_type_ref.as_connection.name,
|
309
327
|
name_in_index: name_in_index,
|
310
328
|
type_for_derived_types: "[#{element_type}]",
|
311
|
-
groupable: !!singular,
|
312
|
-
sortable: false,
|
313
329
|
graphql_only: true,
|
314
330
|
singular: singular,
|
315
|
-
|
331
|
+
groupable: groupable,
|
332
|
+
filterable: filterable,
|
333
|
+
aggregatable: aggregatable,
|
334
|
+
sortable: false
|
316
335
|
) do |f|
|
317
336
|
f.define_relay_pagination_arguments!
|
318
337
|
block&.call(f)
|
@@ -536,7 +555,7 @@ module ElasticGraph
|
|
536
555
|
)
|
537
556
|
|
538
557
|
field.relationship = relationship
|
539
|
-
field.
|
558
|
+
field.resolve_with :nested_relationships
|
540
559
|
|
541
560
|
yield relationship if block_given?
|
542
561
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticgraph-schema_definition
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.19.
|
4
|
+
version: 0.19.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Myron Marston
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
- Block Engineering
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: elasticgraph-graphql
|
@@ -17,70 +17,70 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.19.
|
20
|
+
version: 0.19.3.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.19.
|
27
|
+
version: 0.19.3.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: elasticgraph-indexer
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '='
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.19.
|
34
|
+
version: 0.19.3.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - '='
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.19.
|
41
|
+
version: 0.19.3.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: elasticgraph-json_schema
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 0.19.
|
48
|
+
version: 0.19.3.0
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.19.
|
55
|
+
version: 0.19.3.0
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: elasticgraph-schema_artifacts
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.19.
|
62
|
+
version: 0.19.3.0
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.19.
|
69
|
+
version: 0.19.3.0
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: elasticgraph-support
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - '='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.19.
|
76
|
+
version: 0.19.3.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 0.19.
|
83
|
+
version: 0.19.3.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: graphql
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,56 +141,56 @@ dependencies:
|
|
141
141
|
requirements:
|
142
142
|
- - '='
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: 0.19.
|
144
|
+
version: 0.19.3.0
|
145
145
|
type: :development
|
146
146
|
prerelease: false
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - '='
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: 0.19.
|
151
|
+
version: 0.19.3.0
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: elasticgraph-datastore_core
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - '='
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: 0.19.
|
158
|
+
version: 0.19.3.0
|
159
159
|
type: :development
|
160
160
|
prerelease: false
|
161
161
|
version_requirements: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - '='
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: 0.19.
|
165
|
+
version: 0.19.3.0
|
166
166
|
- !ruby/object:Gem::Dependency
|
167
167
|
name: elasticgraph-elasticsearch
|
168
168
|
requirement: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
170
|
- - '='
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: 0.19.
|
172
|
+
version: 0.19.3.0
|
173
173
|
type: :development
|
174
174
|
prerelease: false
|
175
175
|
version_requirements: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - '='
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: 0.19.
|
179
|
+
version: 0.19.3.0
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: elasticgraph-opensearch
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
183
183
|
requirements:
|
184
184
|
- - '='
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: 0.19.
|
186
|
+
version: 0.19.3.0
|
187
187
|
type: :development
|
188
188
|
prerelease: false
|
189
189
|
version_requirements: !ruby/object:Gem::Requirement
|
190
190
|
requirements:
|
191
191
|
- - '='
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: 0.19.
|
193
|
+
version: 0.19.3.0
|
194
194
|
email:
|
195
195
|
- myron@squareup.com
|
196
196
|
executables: []
|
@@ -275,10 +275,10 @@ licenses:
|
|
275
275
|
- MIT
|
276
276
|
metadata:
|
277
277
|
bug_tracker_uri: https://github.com/block/elasticgraph/issues
|
278
|
-
changelog_uri: https://github.com/block/elasticgraph/releases/tag/v0.19.
|
279
|
-
documentation_uri: https://block.github.io/elasticgraph/api-docs/v0.19.
|
278
|
+
changelog_uri: https://github.com/block/elasticgraph/releases/tag/v0.19.3.0
|
279
|
+
documentation_uri: https://block.github.io/elasticgraph/api-docs/v0.19.3.0/
|
280
280
|
homepage_uri: https://block.github.io/elasticgraph/
|
281
|
-
source_code_uri: https://github.com/block/elasticgraph/tree/v0.19.
|
281
|
+
source_code_uri: https://github.com/block/elasticgraph/tree/v0.19.3.0/elasticgraph-schema_definition
|
282
282
|
gem_category: local
|
283
283
|
rdoc_options: []
|
284
284
|
require_paths:
|