elasticgraph-schema_artifacts 1.0.0.rc1 → 1.0.0.rc2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee87ed29ac7ce2c46f8c4a3f104e716d98cea3cdefb3e81df3523b729c465cb5
4
- data.tar.gz: 2efaeedcfbec47cb7cdf9e3d3649d09863498f12f7ed1fe25db63ad15035afca
3
+ metadata.gz: 5e8e11735696af394f6ddc86e25243cc5eec4adc60c9a4c895b3a1a783cbb8a4
4
+ data.tar.gz: 71638cad65652eafcaaa0cbdb34727aaadedf7d1d4c27e76dfc2c882f7e1358e
5
5
  SHA512:
6
- metadata.gz: 65a0168084e7499b240f628093c9ff1b9d86a67c273fdba7ae62e086e3dd6e62f6ad5b4ccd5894566cb5365b99ba35ec91ba8bf3bf873018b53b0a33c92ff7a1
7
- data.tar.gz: 10528ae4b46b65f32ccc17a0f7f5e2c5fde9573d4d00661ecd9184850552b099c4f15b0187065de13fab1c04a099528149da1aeb6d39fd286def6a51f43c3663
6
+ metadata.gz: 24fbcdccefec08b73d8f128ae9d141d631eb270ef2b8c1edd2a4030f03d7518913b9055646e88ed8b1c867a5b8bc940d254d53938d146e30bf29990b88ecbb1a
7
+ data.tar.gz: 0337417d2246da9439688563271a027a7f7a4c3c17d38f5d691f8609a4bc4a52e6ee3d25076bb576079929371f69edd532b64090950503744c42a35ffafa3164
data/README.md CHANGED
@@ -1,3 +1,35 @@
1
1
  # ElasticGraph::SchemaArtifacts
2
2
 
3
3
  Contains code related to ElasticGraph's generated schema artifacts.
4
+
5
+ ## Dependency Diagram
6
+
7
+ ```mermaid
8
+ graph LR;
9
+ classDef targetGemStyle fill:#FADBD8,stroke:#EC7063,color:#000,stroke-width:2px;
10
+ classDef otherEgGemStyle fill:#A9DFBF,stroke:#2ECC71,color:#000;
11
+ classDef externalGemStyle fill:#E0EFFF,stroke:#70A1D7,color:#2980B9;
12
+ elasticgraph-schema_artifacts["elasticgraph-schema_artifacts"];
13
+ class elasticgraph-schema_artifacts targetGemStyle;
14
+ elasticgraph-support["elasticgraph-support"];
15
+ elasticgraph-schema_artifacts --> elasticgraph-support;
16
+ class elasticgraph-support otherEgGemStyle;
17
+ elasticgraph-admin["elasticgraph-admin"];
18
+ elasticgraph-admin --> elasticgraph-schema_artifacts;
19
+ class elasticgraph-admin otherEgGemStyle;
20
+ elasticgraph-datastore_core["elasticgraph-datastore_core"];
21
+ elasticgraph-datastore_core --> elasticgraph-schema_artifacts;
22
+ class elasticgraph-datastore_core otherEgGemStyle;
23
+ elasticgraph-graphql["elasticgraph-graphql"];
24
+ elasticgraph-graphql --> elasticgraph-schema_artifacts;
25
+ class elasticgraph-graphql otherEgGemStyle;
26
+ elasticgraph-indexer["elasticgraph-indexer"];
27
+ elasticgraph-indexer --> elasticgraph-schema_artifacts;
28
+ class elasticgraph-indexer otherEgGemStyle;
29
+ elasticgraph-query_interceptor["elasticgraph-query_interceptor"];
30
+ elasticgraph-query_interceptor --> elasticgraph-schema_artifacts;
31
+ class elasticgraph-query_interceptor otherEgGemStyle;
32
+ elasticgraph-schema_definition["elasticgraph-schema_definition"];
33
+ elasticgraph-schema_definition --> elasticgraph-schema_artifacts;
34
+ class elasticgraph-schema_definition otherEgGemStyle;
35
+ ```
@@ -0,0 +1,37 @@
1
+ # Copyright 2024 - 2025 Block, Inc.
2
+ #
3
+ # Use of this source code is governed by an MIT-style
4
+ # license that can be found in the LICENSE file or at
5
+ # https://opensource.org/licenses/MIT.
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require "elastic_graph/schema_artifacts/runtime_metadata/extension_loader"
10
+ require "elastic_graph/support/hash_util"
11
+
12
+ module ElasticGraph
13
+ module SchemaArtifacts
14
+ module RuntimeMetadata
15
+ # @private
16
+ class ConfiguredGraphQLResolver < ::Data.define(:name, :config)
17
+ NAME = "name"
18
+ CONFIG = "config"
19
+
20
+ def self.from_hash(hash)
21
+ new(
22
+ name: hash.fetch(NAME).to_sym,
23
+ config: Support::HashUtil.symbolize_keys(hash[CONFIG] || {})
24
+ )
25
+ end
26
+
27
+ def to_dumpable_hash
28
+ {
29
+ # Keys here are ordered alphabetically; please keep them that way.
30
+ CONFIG => Support::HashUtil.stringify_keys(config),
31
+ NAME => name.to_s
32
+ }.reject { |_, v| v.empty? }
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -7,6 +7,7 @@
7
7
  # frozen_string_literal: true
8
8
 
9
9
  require "elastic_graph/schema_artifacts/runtime_metadata/computation_detail"
10
+ require "elastic_graph/schema_artifacts/runtime_metadata/configured_graphql_resolver"
10
11
  require "elastic_graph/schema_artifacts/runtime_metadata/relation"
11
12
 
12
13
  module ElasticGraph
@@ -25,7 +26,7 @@ module ElasticGraph
25
26
  name_in_index: hash[NAME_IN_INDEX],
26
27
  relation: hash[RELATION]&.then { |rel_hash| Relation.from_hash(rel_hash) },
27
28
  computation_detail: hash[AGGREGATION_DETAIL]&.then { |agg_hash| ComputationDetail.from_hash(agg_hash) },
28
- resolver: hash[RESOLVER]&.to_sym
29
+ resolver: hash[RESOLVER]&.then { |res_hash| ConfiguredGraphQLResolver.from_hash(res_hash) }
29
30
  )
30
31
  end
31
32
 
@@ -35,7 +36,7 @@ module ElasticGraph
35
36
  AGGREGATION_DETAIL => computation_detail&.to_dumpable_hash,
36
37
  NAME_IN_INDEX => name_in_index,
37
38
  RELATION => relation&.to_dumpable_hash,
38
- RESOLVER => resolver&.to_s
39
+ RESOLVER => resolver&.to_dumpable_hash
39
40
  }
40
41
  end
41
42
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticgraph-schema_artifacts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myron Marston
@@ -17,42 +17,42 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 1.0.0.rc1
20
+ version: 1.0.0.rc2
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: 1.0.0.rc1
27
+ version: 1.0.0.rc2
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: elasticgraph-graphql
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 1.0.0.rc1
34
+ version: 1.0.0.rc2
35
35
  type: :development
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: 1.0.0.rc1
41
+ version: 1.0.0.rc2
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: elasticgraph-indexer
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: 1.0.0.rc1
48
+ version: 1.0.0.rc2
49
49
  type: :development
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: 1.0.0.rc1
55
+ version: 1.0.0.rc2
56
56
  email:
57
57
  - myron@squareup.com
58
58
  executables: []
@@ -64,6 +64,7 @@ files:
64
64
  - lib/elastic_graph/schema_artifacts/artifacts_helper_methods.rb
65
65
  - lib/elastic_graph/schema_artifacts/from_disk.rb
66
66
  - lib/elastic_graph/schema_artifacts/runtime_metadata/computation_detail.rb
67
+ - lib/elastic_graph/schema_artifacts/runtime_metadata/configured_graphql_resolver.rb
67
68
  - lib/elastic_graph/schema_artifacts/runtime_metadata/enum.rb
68
69
  - lib/elastic_graph/schema_artifacts/runtime_metadata/extension.rb
69
70
  - lib/elastic_graph/schema_artifacts/runtime_metadata/extension_loader.rb
@@ -87,10 +88,10 @@ licenses:
87
88
  - MIT
88
89
  metadata:
89
90
  bug_tracker_uri: https://github.com/block/elasticgraph/issues
90
- changelog_uri: https://github.com/block/elasticgraph/releases/tag/v1.0.0.rc1
91
- documentation_uri: https://block.github.io/elasticgraph/api-docs/v1.0.0.rc1/
91
+ changelog_uri: https://github.com/block/elasticgraph/releases/tag/v1.0.0.rc2
92
+ documentation_uri: https://block.github.io/elasticgraph/api-docs/v1.0.0.rc2/
92
93
  homepage_uri: https://block.github.io/elasticgraph/
93
- source_code_uri: https://github.com/block/elasticgraph/tree/v1.0.0.rc1/elasticgraph-schema_artifacts
94
+ source_code_uri: https://github.com/block/elasticgraph/tree/v1.0.0.rc2/elasticgraph-schema_artifacts
94
95
  gem_category: core
95
96
  rdoc_options: []
96
97
  require_paths: