elasticgraph-schema_definition 0.19.3.0 → 0.19.3.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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/lib/elastic_graph/schema_definition/api.rb +1 -1
  4. data/lib/elastic_graph/schema_definition/factory.rb +1 -1
  5. data/lib/elastic_graph/schema_definition/indexing/derived_fields/append_only_set.rb +1 -1
  6. data/lib/elastic_graph/schema_definition/indexing/derived_fields/field_initializer_support.rb +1 -1
  7. data/lib/elastic_graph/schema_definition/indexing/derived_fields/immutable_value.rb +1 -1
  8. data/lib/elastic_graph/schema_definition/indexing/derived_fields/min_or_max_value.rb +1 -1
  9. data/lib/elastic_graph/schema_definition/indexing/derived_indexed_type.rb +1 -1
  10. data/lib/elastic_graph/schema_definition/indexing/event_envelope.rb +1 -1
  11. data/lib/elastic_graph/schema_definition/indexing/field.rb +1 -1
  12. data/lib/elastic_graph/schema_definition/indexing/field_reference.rb +1 -1
  13. data/lib/elastic_graph/schema_definition/indexing/field_type/enum.rb +1 -1
  14. data/lib/elastic_graph/schema_definition/indexing/field_type/object.rb +1 -1
  15. data/lib/elastic_graph/schema_definition/indexing/field_type/scalar.rb +1 -1
  16. data/lib/elastic_graph/schema_definition/indexing/field_type/union.rb +1 -1
  17. data/lib/elastic_graph/schema_definition/indexing/index.rb +1 -1
  18. data/lib/elastic_graph/schema_definition/indexing/json_schema_field_metadata.rb +1 -1
  19. data/lib/elastic_graph/schema_definition/indexing/json_schema_with_metadata.rb +1 -1
  20. data/lib/elastic_graph/schema_definition/indexing/list_counts_mapping.rb +1 -1
  21. data/lib/elastic_graph/schema_definition/indexing/relationship_resolver.rb +1 -1
  22. data/lib/elastic_graph/schema_definition/indexing/rollover_config.rb +1 -1
  23. data/lib/elastic_graph/schema_definition/indexing/update_target_factory.rb +1 -1
  24. data/lib/elastic_graph/schema_definition/indexing/update_target_resolver.rb +1 -1
  25. data/lib/elastic_graph/schema_definition/json_schema_pruner.rb +1 -1
  26. data/lib/elastic_graph/schema_definition/mixins/can_be_graphql_only.rb +1 -1
  27. data/lib/elastic_graph/schema_definition/mixins/has_derived_graphql_type_customizations.rb +1 -1
  28. data/lib/elastic_graph/schema_definition/mixins/has_directives.rb +1 -1
  29. data/lib/elastic_graph/schema_definition/mixins/has_documentation.rb +1 -1
  30. data/lib/elastic_graph/schema_definition/mixins/has_indices.rb +1 -1
  31. data/lib/elastic_graph/schema_definition/mixins/has_readable_to_s_and_inspect.rb +1 -1
  32. data/lib/elastic_graph/schema_definition/mixins/has_subtypes.rb +1 -1
  33. data/lib/elastic_graph/schema_definition/mixins/has_type_info.rb +1 -1
  34. data/lib/elastic_graph/schema_definition/mixins/implements_interfaces.rb +13 -2
  35. data/lib/elastic_graph/schema_definition/mixins/supports_default_value.rb +1 -1
  36. data/lib/elastic_graph/schema_definition/mixins/supports_filtering_and_aggregation.rb +1 -1
  37. data/lib/elastic_graph/schema_definition/mixins/verifies_graphql_name.rb +1 -1
  38. data/lib/elastic_graph/schema_definition/rake_tasks.rb +1 -1
  39. data/lib/elastic_graph/schema_definition/results.rb +1 -1
  40. data/lib/elastic_graph/schema_definition/schema_artifact_manager.rb +1 -1
  41. data/lib/elastic_graph/schema_definition/schema_elements/argument.rb +1 -1
  42. data/lib/elastic_graph/schema_definition/schema_elements/built_in_types.rb +109 -1
  43. data/lib/elastic_graph/schema_definition/schema_elements/deprecated_element.rb +1 -1
  44. data/lib/elastic_graph/schema_definition/schema_elements/directive.rb +1 -1
  45. data/lib/elastic_graph/schema_definition/schema_elements/enum_type.rb +1 -1
  46. data/lib/elastic_graph/schema_definition/schema_elements/enum_value.rb +1 -1
  47. data/lib/elastic_graph/schema_definition/schema_elements/enum_value_namer.rb +1 -1
  48. data/lib/elastic_graph/schema_definition/schema_elements/enums_for_indexed_types.rb +1 -1
  49. data/lib/elastic_graph/schema_definition/schema_elements/field.rb +14 -6
  50. data/lib/elastic_graph/schema_definition/schema_elements/field_path.rb +1 -1
  51. data/lib/elastic_graph/schema_definition/schema_elements/field_source.rb +1 -1
  52. data/lib/elastic_graph/schema_definition/schema_elements/graphql_sdl_enumerator.rb +1 -1
  53. data/lib/elastic_graph/schema_definition/schema_elements/input_field.rb +1 -1
  54. data/lib/elastic_graph/schema_definition/schema_elements/input_type.rb +1 -1
  55. data/lib/elastic_graph/schema_definition/schema_elements/interface_type.rb +1 -1
  56. data/lib/elastic_graph/schema_definition/schema_elements/list_counts_state.rb +1 -1
  57. data/lib/elastic_graph/schema_definition/schema_elements/object_type.rb +1 -1
  58. data/lib/elastic_graph/schema_definition/schema_elements/relationship.rb +1 -1
  59. data/lib/elastic_graph/schema_definition/schema_elements/scalar_type.rb +1 -1
  60. data/lib/elastic_graph/schema_definition/schema_elements/sort_order_enum_value.rb +1 -1
  61. data/lib/elastic_graph/schema_definition/schema_elements/sub_aggregation_path.rb +1 -1
  62. data/lib/elastic_graph/schema_definition/schema_elements/type_namer.rb +1 -1
  63. data/lib/elastic_graph/schema_definition/schema_elements/type_reference.rb +10 -7
  64. data/lib/elastic_graph/schema_definition/schema_elements/type_with_subfields.rb +1 -1
  65. data/lib/elastic_graph/schema_definition/schema_elements/union_type.rb +1 -1
  66. data/lib/elastic_graph/schema_definition/scripting/file_system_repository.rb +1 -1
  67. data/lib/elastic_graph/schema_definition/scripting/script.rb +1 -1
  68. data/lib/elastic_graph/schema_definition/state.rb +1 -1
  69. data/lib/elastic_graph/schema_definition/test_support.rb +1 -1
  70. metadata +26 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52eb4e3f895b1134d96c0ea8a276f5455ef27a0f4f05c04291bc577da81d9129
4
- data.tar.gz: 771970069f2b3d26a5c0f3d6790713bc57d35834de8c26a489ce7e7aca0e9332
3
+ metadata.gz: 06ba81265998cca23b0d1cd192b02d2b90dbf5f5ee4719aab4af06928aabd797
4
+ data.tar.gz: f99da1ae45737e89412090c976c1e00fdb64a2c035cd3c3fc90797ce090ec874
5
5
  SHA512:
6
- metadata.gz: 412f07499f48649b2afd70dd49030cdabffb850fb8ee072755b2ed72424d908aafb5b65b76f563ef478e11b1813b052699ac9e897c0923a0c73413c9923ef13b
7
- data.tar.gz: f4ae38086c3de1f0732cda734637c50506c9b08b380ea43b0bf428bca6170cdf9b44461ac07b750cd22e0ff37b86f31e234b21bde68368fe3c954c345b44b97c
6
+ metadata.gz: b1528be317ffe61b04c3a9e8dc5c2f42c55e721d6998365d600219acbaa7b412319220a9a2bd51303bdaf6c20b7cee83f6282bb9469a0faba5c5ecc1b4218a09
7
+ data.tar.gz: ff47ac4507c7cf94e918be6ddf5c72a44d2d6d3712bc7a9101819df8e3b6d1c39bc0e598d5600ce4ab66a73067686940806dfb03ff27fbfb7719bc571f6f66a0
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 - 2025 Block, Inc.
3
+ Copyright (c) 2024 - 2026 Block, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -112,11 +112,22 @@ module ElasticGraph
112
112
  if implemented_interfaces.empty?
113
113
  name
114
114
  else
115
- "#{name} implements #{implemented_interfaces.join(" & ")}"
115
+ # Include all ancestor interfaces in SDL
116
+ all_interfaces = recursively_resolve_interface_supertypes.uniq
117
+ "#{name} implements #{all_interfaces.map(&:name).sort.join(" & ")}"
116
118
  end
117
119
 
118
120
  generate_sdl(name_section: name_section, &field_arg_selector)
119
121
  end
122
+
123
+ private
124
+
125
+ def recursively_resolve_interface_supertypes
126
+ implemented_interfaces.flat_map do |interface_ref|
127
+ interface = interface_ref.resolved # : SchemaElements::InterfaceType
128
+ [interface] + interface.send(:recursively_resolve_interface_supertypes)
129
+ end
130
+ end
120
131
  end
121
132
  end
122
133
  end
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -152,6 +152,15 @@ module ElasticGraph
152
152
  # GeoLocation
153
153
  # : Geographic coordinates representing a location on the Earth's surface.
154
154
  #
155
+ # GeoTile
156
+ # : A tile in the Web Mercator XYZ grid. Its coordinates identify a cell, not a fixed ground distance.
157
+ #
158
+ # GeoTileBounds
159
+ # : The geographic bounds of a Web Mercator XYZ tile. Tiles do not cross the antimeridian.
160
+ #
161
+ # GeoTileCorners
162
+ # : The geographic locations of the four corners of a Web Mercator XYZ tile.
163
+ #
155
164
  # PageInfo
156
165
  # : Provides information about the specific fetched page. This implements the
157
166
  # `PageInfo` specification from the [Relay GraphQL Cursor Connections
@@ -180,6 +189,7 @@ module ElasticGraph
180
189
  register_custom_elastic_graph_scalars
181
190
  register_enum_types
182
191
  register_date_and_time_grouped_by_types
192
+ register_geo_grouped_by_types
183
193
  register_standard_elastic_graph_types
184
194
  register_standard_graphql_resolvers
185
195
  end
@@ -1369,7 +1379,105 @@ module ElasticGraph
1369
1379
  end
1370
1380
  end
1371
1381
 
1382
+ # Registers the geographic grouping operation and its tile, bounds, and corner output types.
1383
+ def register_geo_grouped_by_types
1384
+ register_framework_object_type schema_def_state.type_ref("GeoLocation").as_grouped_by.name do |t|
1385
+ t.documentation "Offers geographic grouping representations for a location."
1386
+ t.resolve_fields_with :object_with_lookahead
1387
+ t.override_runtime_metadata(elasticgraph_category: :geo_location_grouped_by_object)
1388
+
1389
+ t.field names.as_geo_tile, "GeoTile", graphql_only: true do |f|
1390
+ f.resolve_with :as_geo_tile
1391
+
1392
+ f.documentation <<~EOS
1393
+ Groups locations into Web Mercator [XYZ tiles](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames). Missing locations produce a `null` tile.
1394
+ Points beyond ±85.0511° latitude are grouped into the northernmost or southernmost row,
1395
+ so a point can be outside the bounds of the tile it is grouped into.
1396
+ Boundary points are assigned to the tile to the east or south, subject to datastore coordinate encoding.
1397
+ EOS
1398
+
1399
+ f.argument names.zoom_level, "Int!" do |a|
1400
+ a.documentation <<~EOS
1401
+ The Web Mercator zoom level, from #{GEO_TILE_ZOOM_LEVELS.min} through #{GEO_TILE_ZOOM_LEVELS.max}.
1402
+ At zoom level z, the map has 2^z rows and 2^z columns. Increasing the zoom level by 1
1403
+ doubles both, producing four times as many tiles.
1404
+ EOS
1405
+ a.default 7
1406
+ end
1407
+ end
1408
+ end
1409
+
1410
+ register_framework_object_type "GeoTile" do |t|
1411
+ t.documentation "A tile in the Web Mercator XYZ grid. Its coordinates identify a cell, not a fixed ground distance."
1412
+ t.resolve_fields_with :object_without_lookahead
1413
+
1414
+ t.field names.zoom_level, "Int!", graphql_only: true do |f|
1415
+ f.documentation "The zoom level of the tile, from #{GEO_TILE_ZOOM_LEVELS.min} through #{GEO_TILE_ZOOM_LEVELS.max}."
1416
+ end
1417
+
1418
+ {names.x => "west to east", names.y => "north to south"}.each do |name, direction|
1419
+ t.field name, "Int!", graphql_only: true do |f|
1420
+ f.documentation "The zero-based tile coordinate, counted #{direction}, from 0 through 2^zoomLevel - 1."
1421
+ end
1422
+ end
1423
+
1424
+ t.field names.map_center_point, "GeoLocation!", graphql_only: true do |f|
1425
+ f.documentation <<~EOS
1426
+ The center of the tile as drawn on a Web Mercator map, not the average record location or the midpoint
1427
+ of the tile's latitude bounds. These differ noticeably only at low zoom levels: for tile 1/0/0,
1428
+ the map center point is at about 66.51° latitude, but the bounds midpoint is at about 42.53°.
1429
+ EOS
1430
+ end
1431
+
1432
+ t.field names.bounds, "GeoTileBounds!", graphql_only: true do |f|
1433
+ f.documentation "The geographic bounds of the tile. Web Mercator excludes the poles and stops at approximately ±85.0511°."
1434
+ end
1435
+
1436
+ t.field names.corners, "GeoTileCorners!", graphql_only: true do |f|
1437
+ f.documentation "The four corners of the tile, calculated from its geographic bounds."
1438
+ end
1439
+ end
1440
+
1441
+ register_framework_object_type "GeoTileBounds" do |t|
1442
+ t.resolve_fields_with :object_without_lookahead
1443
+ t.documentation "The geographic bounds of a Web Mercator XYZ tile. Tiles do not cross the antimeridian."
1444
+
1445
+ {
1446
+ names.north => "latitude of the northern",
1447
+ names.south => "latitude of the southern",
1448
+ names.east => "longitude of the eastern",
1449
+ names.west => "longitude of the western"
1450
+ }.each do |name, description|
1451
+ t.field name, "Float!", graphql_only: true do |f|
1452
+ f.documentation "The #{description} boundary of the tile."
1453
+ end
1454
+ end
1455
+ end
1456
+
1457
+ register_framework_object_type "GeoTileCorners" do |t|
1458
+ t.resolve_fields_with :object_without_lookahead
1459
+ t.documentation "The geographic locations of the four corners of a Web Mercator XYZ tile."
1460
+
1461
+ {
1462
+ names.northwest => "northwest",
1463
+ names.northeast => "northeast",
1464
+ names.southwest => "southwest",
1465
+ names.southeast => "southeast"
1466
+ }.each do |name, description|
1467
+ t.field name, "GeoLocation!", graphql_only: true do |f|
1468
+ f.documentation "The #{description} corner of the tile."
1469
+ end
1470
+ end
1471
+ end
1472
+ end
1473
+
1372
1474
  def register_standard_graphql_resolvers
1475
+ require(require_path = "elastic_graph/graphql/aggregation/resolvers/as_geo_tile")
1476
+ schema_def_api.register_graphql_resolver :as_geo_tile,
1477
+ GraphQL::Aggregation::Resolvers::AsGeoTile,
1478
+ defined_at: require_path,
1479
+ built_in: true
1480
+
1373
1481
  require(require_path = "elastic_graph/graphql/resolvers/get_record_field_value")
1374
1482
  schema_def_api.register_graphql_resolver :get_record_field_value,
1375
1483
  GraphQL::Resolvers::GetRecordFieldValue,
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -609,13 +609,14 @@ module ElasticGraph
609
609
  # instead.
610
610
  return false if parent_type.indexed? && name == "id"
611
611
 
612
- return false if relationship || type.fully_unwrapped.as_object_type&.does_not_support?(&:groupable?)
612
+ return false if relationship || type_disallows_grouping?
613
613
 
614
614
  # We don't support grouping an entire list of values, but we do support grouping on individual values in a list.
615
615
  # However, we only do so when a `singular_name` has been provided (so that we know what to call the grouped_by field).
616
616
  # The semantics are a little odd (since one document can be duplicated in multiple grouping buckets) so we're ok
617
617
  # with not offering it by default--the user has to opt-in by telling us what to call the field in its singular form.
618
- return list_field_groupable_by_single_values? if type.list? && type.fully_unwrapped.leaf?
618
+ # Types with their own `GroupedBy` type are grouped as individual values, like scalars.
619
+ return list_field_groupable_by_single_values? if type.list? && (type.fully_unwrapped.leaf? || original_type.fully_unwrapped.grouped_by_type_defined?)
619
620
 
620
621
  # Nested fields will be supported through specific nested aggregation support, and do not
621
622
  # work as expected when grouping on the root document type.
@@ -730,11 +731,13 @@ module ElasticGraph
730
731
  end
731
732
  end
732
733
 
734
+ # Returns the GraphQL type used for this field's grouped value.
733
735
  # @private
734
736
  def grouped_by_field_type_name
735
737
  unwrapped_type = type_for_derived_types.fully_unwrapped
736
- if unwrapped_type.scalar_type_needing_grouped_by_object? && !legacy_grouping_schema
737
- unwrapped_type.with_reverted_override.as_grouped_by.name
738
+ original_unwrapped_type = original_type_for_derived_types.fully_unwrapped
739
+ if original_unwrapped_type.grouped_by_type_defined? && !legacy_grouping_schema
740
+ original_unwrapped_type.as_grouped_by.name
738
741
  elsif unwrapped_type.leaf?
739
742
  unwrapped_type.name
740
743
  else
@@ -754,7 +757,7 @@ module ElasticGraph
754
757
  "The `#{name}` field value for this group",
755
758
  list_field_grouped_by_doc_note("the selected subfields of `#{name}`")
756
759
  )
757
- elsif type_for_derived_types.fully_unwrapped.scalar_type_needing_grouped_by_object? && !legacy_grouping_schema
760
+ elsif original_type_for_derived_types.fully_unwrapped.grouped_by_type_defined? && !legacy_grouping_schema
758
761
  derived_documentation("Offers the different grouping options for the `#{name}` value within this group")
759
762
  else
760
763
  derived_documentation("The `#{name}` field value for this group")
@@ -1016,6 +1019,11 @@ module ElasticGraph
1016
1019
  "(#{after_opening_paren}#{args_sdl})"
1017
1020
  end
1018
1021
 
1022
+ # Identifies types that disallow grouping, except for types that define their own `GroupedBy` type.
1023
+ def type_disallows_grouping?
1024
+ !original_type.fully_unwrapped.grouped_by_type_defined? && !!type.fully_unwrapped.as_object_type&.does_not_support?(&:groupable?)
1025
+ end
1026
+
1019
1027
  # Indicates if the field uses the `text` mapping type.
1020
1028
  def text?
1021
1029
  mapping_type == "text"
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -153,12 +153,15 @@ module ElasticGraph
153
153
  .sub(/[\]!]+\z/, "") # strip `]` and `!` characters from the end: https://rubular.com/r/pC8C0i7EpvHDbf
154
154
  end
155
155
 
156
- # Generally speaking, scalar types have `grouped_by` fields which are scalars of the same types,
157
- # and object types have `grouped_by` fields which are special `[object_type]GroupedBy` types.
158
- #
159
- # ...except for some special cases (Date and DateTime), which this predicate detects.
160
- def scalar_type_needing_grouped_by_object?
161
- %w[Date DateTime].include?(type_namer.revert_override_for(name))
156
+ # Indicates if this type opts into specialized grouping by defining its own `[type]GroupedBy` type.
157
+ # Use the original type name, before overrides, since an overridden name may identify another type.
158
+ # Only call this after the user definition is complete, when all grouping types are known.
159
+ def grouped_by_type_defined?
160
+ unless schema_def_state.user_definition_complete
161
+ raise Errors::SchemaError, "Cannot call `grouped_by_type_defined?` until the schema definition is complete."
162
+ end
163
+
164
+ schema_def_state.types_by_name.key?(as_grouped_by.name)
162
165
  end
163
166
 
164
167
  # Returns a new `TypeReference` with any type name overrides reverted (to provide the "original" type name).
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
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.3.0
4
+ version: 0.19.3.1
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-06-20 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: elasticgraph-graphql
@@ -17,84 +17,84 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.19.3.0
20
+ version: 0.19.3.1
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.3.0
27
+ version: 0.19.3.1
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.3.0
34
+ version: 0.19.3.1
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.3.0
41
+ version: 0.19.3.1
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.3.0
48
+ version: 0.19.3.1
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.3.0
55
+ version: 0.19.3.1
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.3.0
62
+ version: 0.19.3.1
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.3.0
69
+ version: 0.19.3.1
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.3.0
76
+ version: 0.19.3.1
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.3.0
83
+ version: 0.19.3.1
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: graphql
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 2.5.4
90
+ version: 2.6.6
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 2.5.4
97
+ version: 2.6.6
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: graphql-c_parser
100
100
  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.3.0
144
+ version: 0.19.3.1
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.3.0
151
+ version: 0.19.3.1
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.3.0
158
+ version: 0.19.3.1
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.3.0
165
+ version: 0.19.3.1
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.3.0
172
+ version: 0.19.3.1
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.3.0
179
+ version: 0.19.3.1
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.3.0
186
+ version: 0.19.3.1
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.3.0
193
+ version: 0.19.3.1
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.3.0
279
- documentation_uri: https://block.github.io/elasticgraph/api-docs/v0.19.3.0/
278
+ changelog_uri: https://github.com/block/elasticgraph/releases/tag/v0.19.3.1
279
+ documentation_uri: https://block.github.io/elasticgraph/api-docs/v0.19.3.1/
280
280
  homepage_uri: https://block.github.io/elasticgraph/
281
- source_code_uri: https://github.com/block/elasticgraph/tree/v0.19.3.0/elasticgraph-schema_definition
281
+ source_code_uri: https://github.com/block/elasticgraph/tree/v0.19.3.1/elasticgraph-schema_definition
282
282
  gem_category: local
283
283
  rdoc_options: []
284
284
  require_paths:
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  - !ruby/object:Gem::Version
298
298
  version: '0'
299
299
  requirements: []
300
- rubygems_version: 3.6.2
300
+ rubygems_version: 3.6.9
301
301
  specification_version: 4
302
302
  summary: ElasticGraph gem that provides the schema definition API and generates schema
303
303
  artifacts.