elasticgraph-apollo 1.0.0.rc2 → 1.0.0.rc4

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: 2a5b00c646e8a8c5ce2d9594f886737a350f944757da43c2a57192f675df7600
4
- data.tar.gz: e4dfe7d1df6377189efb3659c4168459064d7f03222914f6f54b5407da970bfb
3
+ metadata.gz: eace79ec40755a2aeb7cfbd9aea6ad6361bf6f6c0bded9fff52d1e73f1afe1cd
4
+ data.tar.gz: eafbc25b3e603edf187b2160a9e564c6a2f578906268a614892a261b293ea261
5
5
  SHA512:
6
- metadata.gz: fb058de1cc03557308d8bfdb658b16f6296a19ca876ab7066dbedfe6af9f1ce7bb94b5c9690e13cfad5ec556e05c013069cb26b28503a79172702f04cb14e9cd
7
- data.tar.gz: f6b160f9507d24b0f94da8de548299d86fc055000533fb920994ce87fc4c35976fd055f00e5002abb24593da3422ab96c3350a851746c014d4f94c17c3e58d60
6
+ metadata.gz: 994ef039551bc0a09ce4e3722c4bdb6bf92adc92fcc8fadc6715e16372451be7b107b6a1f9d65478e4b5ca991f766ce9c334546802e7585635be8938ec29165a
7
+ data.tar.gz: 579505689ff980f0eda01a52fb09908819add72ea805333f837a0234e18cdc083ce693ed1db497713c843a5e9c2d759554128553d02b589d8a0a8a65ca59ca17
data/README.md CHANGED
@@ -32,57 +32,75 @@ graph LR;
32
32
 
33
33
  ## Usage
34
34
 
35
- First, add `elasticgraph-apollo` to your `Gemfile`:
35
+ First, add `elasticgraph-apollo` to your `Gemfile`, alongside the other ElasticGraph gems:
36
+
37
+ ```diff
38
+ diff --git a/Gemfile b/Gemfile
39
+ index 4a5ef1e..5c16c2b 100644
40
+ --- a/Gemfile
41
+ +++ b/Gemfile
42
+ @@ -8,6 +8,7 @@ gem "elasticgraph-query_registry", *elasticgraph_details
43
+
44
+ # Can be elasticgraph-elasticsearch or elasticgraph-opensearch based on the datastore you want to use.
45
+ gem "elasticgraph-opensearch", *elasticgraph_details
46
+ +gem "elasticgraph-apollo", *elasticgraph_details
47
+
48
+ gem "httpx", "~> 1.3"
36
49
 
37
- ``` ruby
38
- gem "elasticgraph-apollo"
39
50
  ```
40
51
 
41
- Finally, update your ElasticGraph schema artifact rake tasks in your `Rakefile`
42
- so that `ElasticGraph::GraphQL::Apollo::SchemaDefinition::APIExtension` is
43
- passed as one of the `extension_modules`:
44
-
45
- ``` ruby
46
- require "elastic_graph/schema_definition/rake_tasks"
47
- require "elastic_graph/apollo/schema_definition/api_extension"
48
-
49
- ElasticGraph::SchemaDefinition::RakeTasks.new(
50
- schema_element_name_form: :snake_case,
51
- index_document_sizes: true,
52
- path_to_schema: "config/schema.rb",
53
- schema_artifacts_directory: artifacts_dir,
54
- extension_modules: [ElasticGraph::Apollo::SchemaDefinition::APIExtension]
55
- )
52
+ Finally, update `Rakefile` so that `ElasticGraph::GraphQL::Apollo::SchemaDefinition::APIExtension` is
53
+ used as one of the `extension_modules`:
54
+
55
+ ```diff
56
+ diff --git a/Rakefile b/Rakefile
57
+ index 2943335..26633c3 100644
58
+ --- a/Rakefile
59
+ +++ b/Rakefile
60
+ @@ -1,5 +1,6 @@
61
+ project_root = File.expand_path(__dir__)
62
+
63
+ +require "elastic_graph/apollo/schema_definition/api_extension"
64
+ require "elastic_graph/local/rake_tasks"
65
+ require "elastic_graph/query_registry/rake_tasks"
66
+ require "rspec/core/rake_task"
67
+ @@ -12,6 +13,8 @@ ElasticGraph::Local::RakeTasks.new(
68
+ local_config_yaml: settings_file,
69
+ path_to_schema: "#{project_root}/config/schema.rb"
70
+ ) do |tasks|
71
+ + tasks.schema_definition_extension_modules = [ElasticGraph::Apollo::SchemaDefinition::APIExtension]
72
+ +
73
+ # Set this to true once you're beyond the prototyping stage.
74
+ tasks.enforce_json_schema_version = false
75
+
56
76
  ```
57
77
 
58
78
  That's it!
59
79
 
60
80
  ## Federation Version Support
61
81
 
62
- This library supports multiple versions of Apollo federation. As of Jan. 2024, it supports:
82
+ This library supports multiple versions of Apollo federation. The latest release supports:
63
83
 
64
84
  * v2.0
65
85
  * v2.3
66
86
  * v2.5
67
87
  * v2.6
68
88
 
69
- By default, the newest version is targeted. If you need an older version (e.g. because your organization is
70
- running an older Apollo version), you can configure it in your schema definition with:
71
-
72
- ```ruby
73
- schema.target_apollo_federation_version "2.3"
74
- ```
75
-
76
- ## Testing Notes
77
-
78
- This project uses https://github.com/apollographql/apollo-federation-subgraph-compatibility
79
- to verify compatibility with Apollo. Things to note:
80
-
81
- - Run `elasticgraph-apollo/script/test_compatibility` to run the compatibility tests (the CI build runs this).
82
- - Run `elasticgraph-apollo/script/boot_eg_apollo_implementation` to boot the ElasticGraph compatibility test implementation (can be useful for debugging `test_compatibility` failures).
83
- - These scripts require some additional dependencies to be installed (such as `docker`, `node`, and `npm`).
84
- - To get that to pass locally on my Mac, I had to enable the `Use Docker Compose V2` flag in Docker Desktop (under "Preferences -> General"). Without that checked, I got errors like this:
85
-
86
- ```
87
- ERROR: for apollo-federation-subgraph-compatibility_router_1 Cannot start service router: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/host_mnt/Users/myron/Development/sq-elasticgraph-ruby/elasticgraph-apollo/vendor/apollo-federation-subgraph-compatibility/supergraph.graphql" to rootfs at "/etc/config/supergraph.graphql" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
89
+ By default, the newest version is targeted. If you need an older version (e.g. because your organization is running
90
+ an older Apollo version), you can configure it in your schema definition with `schema.target_apollo_federation_version`:
91
+
92
+ ```diff
93
+ diff --git a/config/schema.rb b/config/schema.rb
94
+ index 015c5fa..362cdcb 100644
95
+ --- a/config/schema.rb
96
+ +++ b/config/schema.rb
97
+ @@ -4,6 +4,8 @@ ElasticGraph.define_schema do |schema|
98
+ # ElasticGraph will tell you when you need to bump this.
99
+ schema.json_schema_version 1
100
+
101
+ + schema.target_apollo_federation_version "2.3"
102
+ +
103
+ # This registers the elasticgraph-query_registry extension, which can be used to reject queries that
104
+ # clients have not registered (and to reject queries that differ from what a client has registered).
105
+ # In addition, every registered query is validated against the schema in the CI build, giving you
88
106
  ```
@@ -11,6 +11,7 @@ COPY elasticgraph-admin /web/elasticgraph-admin
11
11
  COPY elasticgraph-apollo /web/elasticgraph-apollo
12
12
  COPY elasticgraph-datastore_core /web/elasticgraph-datastore_core
13
13
  COPY elasticgraph-elasticsearch /web/elasticgraph-elasticsearch
14
+ COPY elasticgraph-graphiql /web/elasticgraph-graphiql
14
15
  COPY elasticgraph-graphql /web/elasticgraph-graphql
15
16
  COPY elasticgraph-indexer /web/elasticgraph-indexer
16
17
  COPY elasticgraph-json_schema /web/elasticgraph-json_schema
@@ -13,6 +13,7 @@ source "https://rubygems.org"
13
13
  apollo
14
14
  datastore_core
15
15
  elasticsearch
16
+ graphiql
16
17
  graphql
17
18
  indexer
18
19
  json_schema
@@ -9,7 +9,7 @@
9
9
  require "elastic_graph/admin"
10
10
  require "elastic_graph/graphql"
11
11
  require "elastic_graph/indexer"
12
- require "elastic_graph/rack/graphiql"
12
+ require "elastic_graph/graphiql"
13
13
  require "elastic_graph/indexer/test_support/converters"
14
14
 
15
15
  admin = ElasticGraph::Admin.from_yaml_file("config/settings.yaml")
@@ -119,4 +119,4 @@ indexer.processor.process(events, refresh_indices: true)
119
119
  puts "Elasticsearch bootstrapping done. Booting the GraphQL server."
120
120
 
121
121
  use Rack::ShowExceptions
122
- run ElasticGraph::Rack::GraphiQL.new(graphql)
122
+ run ElasticGraph::GraphiQL.new(graphql)
@@ -22,9 +22,9 @@ script_dir=$(dirname $0)
22
22
  # Default to the Apollo federation version 2.6, as higher versions are not supported by the test suite properly.
23
23
  apollo_federation_version=${1:-2.6}
24
24
 
25
- # Latest version as of 2024-05-08. Gotten from:
25
+ # Latest version as of 2025-08-01. Gotten from:
26
26
  # https://www.npmjs.com/package/@apollo/federation-subgraph-compatibility?activeTab=versions
27
- apollo_subgraph_tests_version=2.2.0
27
+ apollo_subgraph_tests_version=2.2.1
28
28
 
29
29
  TARGET_APOLLO_FEDERATION_VERSION=$apollo_federation_version bundle exec rake \
30
30
  --rakefile $script_dir/../apollo_tests_implementation/Rakefile schema_artifacts:dump
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticgraph-apollo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc2
4
+ version: 1.0.0.rc4
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.rc2
20
+ version: 1.0.0.rc4
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.rc2
27
+ version: 1.0.0.rc4
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: elasticgraph-support
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 1.0.0.rc2
34
+ version: 1.0.0.rc4
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: 1.0.0.rc2
41
+ version: 1.0.0.rc4
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: graphql
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 2.5.10
48
+ version: 2.5.11
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: 2.5.10
55
+ version: 2.5.11
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: apollo-federation
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -79,70 +79,70 @@ dependencies:
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 1.0.0.rc2
82
+ version: 1.0.0.rc4
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 1.0.0.rc2
89
+ version: 1.0.0.rc4
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: elasticgraph-admin
92
92
  requirement: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 1.0.0.rc2
96
+ version: 1.0.0.rc4
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 1.0.0.rc2
103
+ version: 1.0.0.rc4
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: elasticgraph-elasticsearch
106
106
  requirement: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 1.0.0.rc2
110
+ version: 1.0.0.rc4
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.0.0.rc2
117
+ version: 1.0.0.rc4
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: elasticgraph-opensearch
120
120
  requirement: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 1.0.0.rc2
124
+ version: 1.0.0.rc4
125
125
  type: :development
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 1.0.0.rc2
131
+ version: 1.0.0.rc4
132
132
  - !ruby/object:Gem::Dependency
133
133
  name: elasticgraph-indexer
134
134
  requirement: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 1.0.0.rc2
138
+ version: 1.0.0.rc4
139
139
  type: :development
140
140
  prerelease: false
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 1.0.0.rc2
145
+ version: 1.0.0.rc4
146
146
  email:
147
147
  - myron@squareup.com
148
148
  executables: []
@@ -188,10 +188,10 @@ licenses:
188
188
  - MIT
189
189
  metadata:
190
190
  bug_tracker_uri: https://github.com/block/elasticgraph/issues
191
- changelog_uri: https://github.com/block/elasticgraph/releases/tag/v1.0.0.rc2
192
- documentation_uri: https://block.github.io/elasticgraph/api-docs/v1.0.0.rc2/
191
+ changelog_uri: https://github.com/block/elasticgraph/releases/tag/v1.0.0.rc4
192
+ documentation_uri: https://block.github.io/elasticgraph/api-docs/v1.0.0.rc4/
193
193
  homepage_uri: https://block.github.io/elasticgraph/
194
- source_code_uri: https://github.com/block/elasticgraph/tree/v1.0.0.rc2/elasticgraph-apollo
194
+ source_code_uri: https://github.com/block/elasticgraph/tree/v1.0.0.rc4/elasticgraph-apollo
195
195
  gem_category: extension
196
196
  rdoc_options: []
197
197
  require_paths:
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  - !ruby/object:Gem::Version
211
211
  version: '0'
212
212
  requirements: []
213
- rubygems_version: 3.6.7
213
+ rubygems_version: 3.6.9
214
214
  specification_version: 4
215
- summary: An ElasticGraph extension that implements the Apollo federation spec.
215
+ summary: Transforms an ElasticGraph project into an Apollo subgraph.
216
216
  test_files: []