elasticgraph-apollo 0.18.0.3 → 0.18.0.5
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/apollo_tests_implementation/config/products_schema.rb +2 -0
 - data/apollo_tests_implementation/lib/test_implementation_extension.rb +2 -0
 - data/lib/elastic_graph/apollo/graphql/engine_extension.rb +9 -0
 - data/lib/elastic_graph/apollo/graphql/entities_field_resolver.rb +9 -2
 - data/lib/elastic_graph/apollo/graphql/http_endpoint_extension.rb +2 -0
 - data/lib/elastic_graph/apollo/graphql/service_field_resolver.rb +2 -0
 - data/lib/elastic_graph/apollo/schema_definition/api_extension.rb +67 -13
 - data/lib/elastic_graph/apollo/schema_definition/apollo_directives.rb +194 -26
 - data/lib/elastic_graph/apollo/schema_definition/argument_extension.rb +1 -0
 - data/lib/elastic_graph/apollo/schema_definition/entity_type_extension.rb +2 -0
 - data/lib/elastic_graph/apollo/schema_definition/enum_type_extension.rb +1 -0
 - data/lib/elastic_graph/apollo/schema_definition/enum_value_extension.rb +1 -0
 - data/lib/elastic_graph/apollo/schema_definition/factory_extension.rb +2 -0
 - data/lib/elastic_graph/apollo/schema_definition/field_extension.rb +23 -6
 - data/lib/elastic_graph/apollo/schema_definition/graphql_sdl_enumerator_extension.rb +2 -0
 - data/lib/elastic_graph/apollo/schema_definition/input_type_extension.rb +1 -0
 - data/lib/elastic_graph/apollo/schema_definition/interface_type_extension.rb +1 -0
 - data/lib/elastic_graph/apollo/schema_definition/object_type_extension.rb +1 -0
 - data/lib/elastic_graph/apollo/schema_definition/scalar_type_extension.rb +1 -0
 - data/lib/elastic_graph/apollo/schema_definition/state_extension.rb +2 -0
 - data/lib/elastic_graph/apollo/schema_definition/union_type_extension.rb +1 -0
 - data/script/export_docker_env_vars.sh +1 -1
 - metadata +18 -16
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3235e538afce544de3826c7a362fe218f5e964b79cab3d6920ea10ac2c4b9472
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f2f70701103e038b6aef58ede5336246515a6b8366d00d60f2d01074be7572ad
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2983677d53e108788a4ce91d53992eafa620910a972ca66dabb40900795df1c5a9761b8bfffe91256c1e64412c3f76ad6900fa167fbdfdb62c04a3232d2ab033
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f757d64002f6da0a093cca909eb29340df512f5f9eb2503dc328dc197319e05b1081512f3f7ff41a44457cc90c5187faa4c15c372b6ecc44ea9ed4d44c87b5b8
         
     | 
| 
         @@ -6,6 +6,7 @@ 
     | 
|
| 
       6 
6 
     | 
    
         
             
            #
         
     | 
| 
       7 
7 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
      
 9 
     | 
    
         
            +
            # @private
         
     | 
| 
       9 
10 
     | 
    
         
             
            module ApolloTestImpl
         
     | 
| 
       10 
11 
     | 
    
         
             
              module GraphQLSDLEnumeratorExtension
         
     | 
| 
       11 
12 
     | 
    
         
             
                # The `apollo-federation-subgraph-compatibility` project requires[^1] that each tested implementation provide
         
     | 
| 
         @@ -38,6 +39,7 @@ module ApolloTestImpl 
     | 
|
| 
       38 
39 
     | 
    
         
             
                end
         
     | 
| 
       39 
40 
     | 
    
         
             
              end
         
     | 
| 
       40 
41 
     | 
    
         | 
| 
      
 42 
     | 
    
         
            +
              # @private
         
     | 
| 
       41 
43 
     | 
    
         
             
              module SchemaDefFactoryExtension
         
     | 
| 
       42 
44 
     | 
    
         
             
                def new_graphql_sdl_enumerator(all_types_except_root_query_type)
         
     | 
| 
       43 
45 
     | 
    
         
             
                  super(all_types_except_root_query_type).tap do |enum|
         
     | 
| 
         @@ -13,6 +13,7 @@ 
     | 
|
| 
       13 
13 
     | 
    
         
             
            # it.
         
     | 
| 
       14 
14 
     | 
    
         
             
            #
         
     | 
| 
       15 
15 
     | 
    
         
             
            # This defines an extension that injects a custom resolver that supports the field.
         
     | 
| 
      
 16 
     | 
    
         
            +
            # @private
         
     | 
| 
       16 
17 
     | 
    
         
             
            module ApolloTestImplementationExtension
         
     | 
| 
       17 
18 
     | 
    
         
             
              def graphql_resolvers
         
     | 
| 
       18 
19 
     | 
    
         
             
                @graphql_resolvers ||= [product_field_resolver] + super
         
     | 
| 
         @@ -26,6 +27,7 @@ module ApolloTestImplementationExtension 
     | 
|
| 
       26 
27 
     | 
    
         
             
                )
         
     | 
| 
       27 
28 
     | 
    
         
             
              end
         
     | 
| 
       28 
29 
     | 
    
         | 
| 
      
 30 
     | 
    
         
            +
              # @private
         
     | 
| 
       29 
31 
     | 
    
         
             
              class ProductFieldResolver
         
     | 
| 
       30 
32 
     | 
    
         
             
                def initialize(datastore_query_builder:, product_index_def:, datastore_router:)
         
     | 
| 
       31 
33 
     | 
    
         
             
                  @datastore_query_builder = datastore_query_builder
         
     | 
| 
         @@ -8,10 +8,17 @@ 
     | 
|
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       10 
10 
     | 
    
         
             
              module Apollo
         
     | 
| 
      
 11 
     | 
    
         
            +
                # Namespace for all Apollo GraphQL enging logic.
         
     | 
| 
      
 12 
     | 
    
         
            +
                #
         
     | 
| 
      
 13 
     | 
    
         
            +
                # @note This module provides no public types or APIs. It will be used automatically when you use
         
     | 
| 
      
 14 
     | 
    
         
            +
                #   {SchemaDefinition::APIExtension} as a schema definition extension module.
         
     | 
| 
       11 
15 
     | 
    
         
             
                module GraphQL
         
     | 
| 
       12 
16 
     | 
    
         
             
                  # ElasticGraph application extension module designed to hook into the ElasticGraph
         
     | 
| 
       13 
17 
     | 
    
         
             
                  # GraphQL engine in order to support Apollo-specific fields.
         
     | 
| 
      
 18 
     | 
    
         
            +
                  #
         
     | 
| 
      
 19 
     | 
    
         
            +
                  # @private
         
     | 
| 
       14 
20 
     | 
    
         
             
                  module EngineExtension
         
     | 
| 
      
 21 
     | 
    
         
            +
                    # @private
         
     | 
| 
       15 
22 
     | 
    
         
             
                    def graphql_resolvers
         
     | 
| 
       16 
23 
     | 
    
         
             
                      @graphql_resolvers ||= begin
         
     | 
| 
       17 
24 
     | 
    
         
             
                        require "elastic_graph/apollo/graphql/entities_field_resolver"
         
     | 
| 
         @@ -27,6 +34,7 @@ module ElasticGraph 
     | 
|
| 
       27 
34 
     | 
    
         
             
                      end
         
     | 
| 
       28 
35 
     | 
    
         
             
                    end
         
     | 
| 
       29 
36 
     | 
    
         | 
| 
      
 37 
     | 
    
         
            +
                    # @private
         
     | 
| 
       30 
38 
     | 
    
         
             
                    def graphql_gem_plugins
         
     | 
| 
       31 
39 
     | 
    
         
             
                      @graphql_gem_plugins ||= begin
         
     | 
| 
       32 
40 
     | 
    
         
             
                        require "apollo-federation/tracing/proto"
         
     | 
| 
         @@ -40,6 +48,7 @@ module ElasticGraph 
     | 
|
| 
       40 
48 
     | 
    
         
             
                      end
         
     | 
| 
       41 
49 
     | 
    
         
             
                    end
         
     | 
| 
       42 
50 
     | 
    
         | 
| 
      
 51 
     | 
    
         
            +
                    # @private
         
     | 
| 
       43 
52 
     | 
    
         
             
                    def graphql_http_endpoint
         
     | 
| 
       44 
53 
     | 
    
         
             
                      @graphql_http_endpoint ||= super.tap do |endpoint|
         
     | 
| 
       45 
54 
     | 
    
         
             
                        require "elastic_graph/apollo/graphql/http_endpoint_extension"
         
     | 
| 
         @@ -6,7 +6,7 @@ 
     | 
|
| 
       6 
6 
     | 
    
         
             
            #
         
     | 
| 
       7 
7 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
            require "elastic_graph/ 
     | 
| 
      
 9 
     | 
    
         
            +
            require "elastic_graph/errors"
         
     | 
| 
       10 
10 
     | 
    
         
             
            require "elastic_graph/graphql/query_adapter/requested_fields"
         
     | 
| 
       11 
11 
     | 
    
         
             
            require "elastic_graph/graphql/resolvers/query_source"
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
         @@ -16,6 +16,8 @@ module ElasticGraph 
     | 
|
| 
       16 
16 
     | 
    
         
             
                  # GraphQL resolver for the Apollo `Query._entities` field. For details on this field, see:
         
     | 
| 
       17 
17 
     | 
    
         
             
                  #
         
     | 
| 
       18 
18 
     | 
    
         
             
                  # https://www.apollographql.com/docs/federation/subgraph-spec/#resolve-requests-for-entities
         
     | 
| 
      
 19 
     | 
    
         
            +
                  #
         
     | 
| 
      
 20 
     | 
    
         
            +
                  # @private
         
     | 
| 
       19 
21 
     | 
    
         
             
                  class EntitiesFieldResolver
         
     | 
| 
       20 
22 
     | 
    
         
             
                    def initialize(datastore_query_builder:, schema_element_names:)
         
     | 
| 
       21 
23 
     | 
    
         
             
                      @datastore_query_builder = datastore_query_builder
         
     | 
| 
         @@ -100,7 +102,7 @@ module ElasticGraph 
     | 
|
| 
       100 
102 
     | 
    
         | 
| 
       101 
103 
     | 
    
         
             
                      type = begin
         
     | 
| 
       102 
104 
     | 
    
         
             
                        schema.type_named(typename)
         
     | 
| 
       103 
     | 
    
         
            -
                      rescue ElasticGraph::NotFoundError
         
     | 
| 
      
 105 
     | 
    
         
            +
                      rescue ElasticGraph::Errors::NotFoundError
         
     | 
| 
       104 
106 
     | 
    
         
             
                        notify_error.call("has an unrecognized `__typename`: #{typename}")
         
     | 
| 
       105 
107 
     | 
    
         
             
                      end
         
     | 
| 
       106 
108 
     | 
    
         | 
| 
         @@ -145,6 +147,8 @@ module ElasticGraph 
     | 
|
| 
       145 
147 
     | 
    
         
             
                    end
         
     | 
| 
       146 
148 
     | 
    
         | 
| 
       147 
149 
     | 
    
         
             
                    # A simple value object containing a parsed form of an `_Any` representation when there's an `id` field.
         
     | 
| 
      
 150 
     | 
    
         
            +
                    #
         
     | 
| 
      
 151 
     | 
    
         
            +
                    # @private
         
     | 
| 
       148 
152 
     | 
    
         
             
                    class RepresentationWithId < ::Data.define(:type, :id, :other_fields, :schema_element_names, :adapter)
         
     | 
| 
       149 
153 
     | 
    
         
             
                      def initialize(type:, id:, other_fields:, schema_element_names:)
         
     | 
| 
       150 
154 
     | 
    
         
             
                        super(
         
     | 
| 
         @@ -225,6 +229,8 @@ module ElasticGraph 
     | 
|
| 
       225 
229 
     | 
    
         
             
                    end
         
     | 
| 
       226 
230 
     | 
    
         | 
| 
       227 
231 
     | 
    
         
             
                    # A simple value object containing a parsed form of an `_Any` representation when there's no `id` field.
         
     | 
| 
      
 232 
     | 
    
         
            +
                    #
         
     | 
| 
      
 233 
     | 
    
         
            +
                    # @private
         
     | 
| 
       228 
234 
     | 
    
         
             
                    class RepresentationWithoutId < ::Data.define(:type, :fields, :schema_element_names)
         
     | 
| 
       229 
235 
     | 
    
         
             
                      # @dynamic type
         
     | 
| 
       230 
236 
     | 
    
         | 
| 
         @@ -277,6 +283,7 @@ module ElasticGraph 
     | 
|
| 
       277 
283 
     | 
    
         
             
                      end
         
     | 
| 
       278 
284 
     | 
    
         
             
                    end
         
     | 
| 
       279 
285 
     | 
    
         | 
| 
      
 286 
     | 
    
         
            +
                    # @private
         
     | 
| 
       280 
287 
     | 
    
         
             
                    class RepresentationWithoutIndex < ::Data.define(:type, :representation_hash)
         
     | 
| 
       281 
288 
     | 
    
         
             
                      # @dynamic type
         
     | 
| 
       282 
289 
     | 
    
         
             
                      def adapter
         
     | 
| 
         @@ -23,6 +23,8 @@ module ElasticGraph 
     | 
|
| 
       23 
23 
     | 
    
         
             
                  #
         
     | 
| 
       24 
24 
     | 
    
         
             
                  # This extension handles the latter requirement. For more info, see:
         
     | 
| 
       25 
25 
     | 
    
         
             
                  # https://github.com/Gusto/apollo-federation-ruby#tracing
         
     | 
| 
      
 26 
     | 
    
         
            +
                  #
         
     | 
| 
      
 27 
     | 
    
         
            +
                  # @private
         
     | 
| 
       26 
28 
     | 
    
         
             
                  module HTTPEndpointExtension
         
     | 
| 
       27 
29 
     | 
    
         
             
                    def with_context(request)
         
     | 
| 
       28 
30 
     | 
    
         
             
                      # Steep has an error here for some reason:
         
     | 
| 
         @@ -10,6 +10,8 @@ module ElasticGraph 
     | 
|
| 
       10 
10 
     | 
    
         
             
              module Apollo
         
     | 
| 
       11 
11 
     | 
    
         
             
                module GraphQL
         
     | 
| 
       12 
12 
     | 
    
         
             
                  # GraphQL resolver for the Apollo `Query._service` field.
         
     | 
| 
      
 13 
     | 
    
         
            +
                  #
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # @private
         
     | 
| 
       13 
15 
     | 
    
         
             
                  class ServiceFieldResolver
         
     | 
| 
       14 
16 
     | 
    
         
             
                    def can_resolve?(field:, object:)
         
     | 
| 
       15 
17 
     | 
    
         
             
                      field.parent_type.name == :Query && field.name == :_service
         
     | 
| 
         @@ -6,7 +6,7 @@ 
     | 
|
| 
       6 
6 
     | 
    
         
             
            #
         
     | 
| 
       7 
7 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
            require "elastic_graph/ 
     | 
| 
      
 9 
     | 
    
         
            +
            require "elastic_graph/errors"
         
     | 
| 
       10 
10 
     | 
    
         
             
            require "elastic_graph/version"
         
     | 
| 
       11 
11 
     | 
    
         
             
            require "elastic_graph/apollo/graphql/engine_extension"
         
     | 
| 
       12 
12 
     | 
    
         
             
            require "elastic_graph/apollo/schema_definition/entity_type_extension"
         
     | 
| 
         @@ -14,17 +14,52 @@ require "elastic_graph/apollo/schema_definition/factory_extension" 
     | 
|
| 
       14 
14 
     | 
    
         
             
            require "elastic_graph/apollo/schema_definition/state_extension"
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
      
 17 
     | 
    
         
            +
              # ElasticGraph extension library that implements the [Apollo subgraph federation
         
     | 
| 
      
 18 
     | 
    
         
            +
              # spec](https://www.apollographql.com/docs/federation/subgraph-spec/), turning
         
     | 
| 
      
 19 
     | 
    
         
            +
              # any ElasticGraph instance into an Apollo subgraph.
         
     | 
| 
      
 20 
     | 
    
         
            +
              #
         
     | 
| 
      
 21 
     | 
    
         
            +
              # `ElasticGraph::Apollo` has two parts:
         
     | 
| 
      
 22 
     | 
    
         
            +
              #
         
     | 
| 
      
 23 
     | 
    
         
            +
              # * {Apollo::SchemaDefinition} is an extension used while defining an ElasticGraph schema. It includes all schema elements that are part
         
     | 
| 
      
 24 
     | 
    
         
            +
              #   of the Apollo spec, including `_Entity` and the various directives.
         
     | 
| 
      
 25 
     | 
    
         
            +
              # * {Apollo::GraphQL} is an extension used by `elasticgraph-graphql` to support queries against Apollo's subgraph schema additions (e.g.
         
     | 
| 
      
 26 
     | 
    
         
            +
              #   `_service` and `_entities`). It includes [reference resolvers](https://www.apollographql.com/docs/federation/entities/#2-define-a-reference-resolver)
         
     | 
| 
      
 27 
     | 
    
         
            +
              #   for all indexed types in your schema.
         
     | 
| 
      
 28 
     | 
    
         
            +
              #
         
     | 
| 
      
 29 
     | 
    
         
            +
              # To use `elasticgraph-apollo`, simply use {Apollo::SchemaDefinition::APIExtension} as a schema definition extension module. The GraphQL
         
     | 
| 
      
 30 
     | 
    
         
            +
              # extension module will get used by `elasticgraph-graphql` automatically.
         
     | 
| 
      
 31 
     | 
    
         
            +
              #
         
     | 
| 
      
 32 
     | 
    
         
            +
              # @example Use elasticgraph-apollo in a project
         
     | 
| 
      
 33 
     | 
    
         
            +
              #   require "elastic_graph/apollo/schema_definition/api_extension"
         
     | 
| 
      
 34 
     | 
    
         
            +
              #
         
     | 
| 
      
 35 
     | 
    
         
            +
              #   ElasticGraph::Local::RakeTasks.new(
         
     | 
| 
      
 36 
     | 
    
         
            +
              #     local_config_yaml: "config/settings/local.yaml",
         
     | 
| 
      
 37 
     | 
    
         
            +
              #     path_to_schema: "config/schema.rb"
         
     | 
| 
      
 38 
     | 
    
         
            +
              #   ) do |tasks|
         
     | 
| 
      
 39 
     | 
    
         
            +
              #     tasks.schema_definition_extension_modules = [ElasticGraph::Apollo::SchemaDefinition::APIExtension]
         
     | 
| 
      
 40 
     | 
    
         
            +
              #   end
         
     | 
| 
       17 
41 
     | 
    
         
             
              module Apollo
         
     | 
| 
      
 42 
     | 
    
         
            +
                # Namespace for all Apollo schema definition support.
         
     | 
| 
      
 43 
     | 
    
         
            +
                #
         
     | 
| 
      
 44 
     | 
    
         
            +
                # {SchemaDefinition::APIExtension} is the primary entry point and should be used as a schema definition extension module.
         
     | 
| 
       18 
45 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
       19 
     | 
    
         
            -
                  # Module designed to be extended onto an  
     | 
| 
       20 
     | 
    
         
            -
                  # to customize the schema artifacts based on the Apollo Federation subgraph 
     | 
| 
      
 46 
     | 
    
         
            +
                  # Module designed to be extended onto an {ElasticGraph::SchemaDefinition::API} instance
         
     | 
| 
      
 47 
     | 
    
         
            +
                  # to customize the schema artifacts based on the [Apollo Federation subgraph
         
     | 
| 
      
 48 
     | 
    
         
            +
                  # spec](https://www.apollographql.com/docs/federation/subgraph-spec/).
         
     | 
| 
       21 
49 
     | 
    
         
             
                  #
         
     | 
| 
       22 
     | 
    
         
            -
                  #  
     | 
| 
      
 50 
     | 
    
         
            +
                  # To use this module, pass it in `schema_definition_extension_modules` when defining your {ElasticGraph::Local::RakeTasks}.
         
     | 
| 
       23 
51 
     | 
    
         
             
                  #
         
     | 
| 
       24 
     | 
    
         
            -
                  #  
     | 
| 
       25 
     | 
    
         
            -
                  #  
     | 
| 
       26 
     | 
    
         
            -
                  # 
     | 
| 
      
 52 
     | 
    
         
            +
                  # @example Define local rake tasks with this extension module
         
     | 
| 
      
 53 
     | 
    
         
            +
                  #   require "elastic_graph/apollo/schema_definition/api_extension"
         
     | 
| 
      
 54 
     | 
    
         
            +
                  #
         
     | 
| 
      
 55 
     | 
    
         
            +
                  #   ElasticGraph::Local::RakeTasks.new(
         
     | 
| 
      
 56 
     | 
    
         
            +
                  #     local_config_yaml: "config/settings/local.yaml",
         
     | 
| 
      
 57 
     | 
    
         
            +
                  #     path_to_schema: "config/schema.rb"
         
     | 
| 
      
 58 
     | 
    
         
            +
                  #   ) do |tasks|
         
     | 
| 
      
 59 
     | 
    
         
            +
                  #     tasks.schema_definition_extension_modules = [ElasticGraph::Apollo::SchemaDefinition::APIExtension]
         
     | 
| 
      
 60 
     | 
    
         
            +
                  #   end
         
     | 
| 
       27 
61 
     | 
    
         
             
                  module APIExtension
         
     | 
| 
      
 62 
     | 
    
         
            +
                    # @private
         
     | 
| 
       28 
63 
     | 
    
         
             
                    def results
         
     | 
| 
       29 
64 
     | 
    
         
             
                      register_graphql_extension GraphQL::EngineExtension, defined_at: "elastic_graph/apollo/graphql/engine_extension"
         
     | 
| 
       30 
65 
     | 
    
         
             
                      define_apollo_schema_elements
         
     | 
| 
         @@ -32,18 +67,37 @@ module ElasticGraph 
     | 
|
| 
       32 
67 
     | 
    
         
             
                      super
         
     | 
| 
       33 
68 
     | 
    
         
             
                    end
         
     | 
| 
       34 
69 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
                    #  
     | 
| 
       36 
     | 
    
         
            -
                    # 
     | 
| 
      
 70 
     | 
    
         
            +
                    # Applies an apollo tag to built-in types so that they are included in the Apollo contract schema.
         
     | 
| 
      
 71 
     | 
    
         
            +
                    #
         
     | 
| 
      
 72 
     | 
    
         
            +
                    # @param name [String] tag name
         
     | 
| 
      
 73 
     | 
    
         
            +
                    # @param except [Array<String>] built-in types not to tag
         
     | 
| 
      
 74 
     | 
    
         
            +
                    # @return [void]
         
     | 
| 
      
 75 
     | 
    
         
            +
                    # @see ApolloDirectives::Tag
         
     | 
| 
      
 76 
     | 
    
         
            +
                    # @see FieldExtension#tag_with
         
     | 
| 
      
 77 
     | 
    
         
            +
                    #
         
     | 
| 
      
 78 
     | 
    
         
            +
                    # @example Tag all built-in types (except two) for inclusion in the `public` schema
         
     | 
| 
      
 79 
     | 
    
         
            +
                    #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 80 
     | 
    
         
            +
                    #     schema.tag_built_in_types_with "public", except: ["IntAggregatedValue", "FloatAggregatedValues"]
         
     | 
| 
      
 81 
     | 
    
         
            +
                    #   end
         
     | 
| 
       37 
82 
     | 
    
         
             
                    def tag_built_in_types_with(name, except: [])
         
     | 
| 
       38 
83 
     | 
    
         
             
                      except_set = except.to_set
         
     | 
| 
       39 
84 
     | 
    
         
             
                      on_built_in_types do |type|
         
     | 
| 
       40 
     | 
    
         
            -
                         
     | 
| 
      
 85 
     | 
    
         
            +
                        apollo_type = (_ = type) # : ApolloDirectives::Tag
         
     | 
| 
      
 86 
     | 
    
         
            +
                        apollo_type.apollo_tag(name: name) unless except_set.include?(type.name)
         
     | 
| 
       41 
87 
     | 
    
         
             
                      end
         
     | 
| 
       42 
88 
     | 
    
         
             
                    end
         
     | 
| 
       43 
89 
     | 
    
         | 
| 
       44 
90 
     | 
    
         
             
                    # Picks which version of Apollo federation to target. By default, the latest supported version is
         
     | 
| 
       45 
91 
     | 
    
         
             
                    # targeted, but you can call this to pick an earlier version, which may be necessary if your
         
     | 
| 
       46 
     | 
    
         
            -
                    # organization is  
     | 
| 
      
 92 
     | 
    
         
            +
                    # organization is on an older version of Apollo federation.
         
     | 
| 
      
 93 
     | 
    
         
            +
                    #
         
     | 
| 
      
 94 
     | 
    
         
            +
                    # @param version [String] version number
         
     | 
| 
      
 95 
     | 
    
         
            +
                    # @return [void]
         
     | 
| 
      
 96 
     | 
    
         
            +
                    #
         
     | 
| 
      
 97 
     | 
    
         
            +
                    # @example Set the Apollo Federation Version
         
     | 
| 
      
 98 
     | 
    
         
            +
                    #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 99 
     | 
    
         
            +
                    #     schema.target_apollo_federation_version "2.6"
         
     | 
| 
      
 100 
     | 
    
         
            +
                    #   end
         
     | 
| 
       47 
101 
     | 
    
         
             
                    def target_apollo_federation_version(version)
         
     | 
| 
       48 
102 
     | 
    
         
             
                      # Allow the version to have the `v` prefix, but don't require it.
         
     | 
| 
       49 
103 
     | 
    
         
             
                      version = version.delete_prefix("v")
         
     | 
| 
         @@ -53,7 +107,7 @@ module ElasticGraph 
     | 
|
| 
       53 
107 
     | 
    
         
             
                          "v#{version_number}"
         
     | 
| 
       54 
108 
     | 
    
         
             
                        end.join(", ")
         
     | 
| 
       55 
109 
     | 
    
         | 
| 
       56 
     | 
    
         
            -
                        raise SchemaError, "elasticgraph-apollo v#{ElasticGraph::VERSION} does not support Apollo federation v#{version}. " \
         
     | 
| 
      
 110 
     | 
    
         
            +
                        raise Errors::SchemaError, "elasticgraph-apollo v#{ElasticGraph::VERSION} does not support Apollo federation v#{version}. " \
         
     | 
| 
       57 
111 
     | 
    
         
             
                          "Pick one of the supported versions (#{supported_version_descriptions}) instead."
         
     | 
| 
       58 
112 
     | 
    
         
             
                      end
         
     | 
| 
       59 
113 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -390,7 +444,7 @@ module ElasticGraph 
     | 
|
| 
       390 
444 
     | 
    
         
             
                        end
         
     | 
| 
       391 
445 
     | 
    
         | 
| 
       392 
446 
     | 
    
         
             
                      if unresolvable_field_errors.any?
         
     | 
| 
       393 
     | 
    
         
            -
                        raise SchemaError, unresolvable_field_errors.join("\n#{"-" * 100}\n")
         
     | 
| 
      
 447 
     | 
    
         
            +
                        raise Errors::SchemaError, unresolvable_field_errors.join("\n#{"-" * 100}\n")
         
     | 
| 
       394 
448 
     | 
    
         
             
                      end
         
     | 
| 
       395 
449 
     | 
    
         
             
                    end
         
     | 
| 
       396 
450 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -9,106 +9,274 @@ 
     | 
|
| 
       9 
9 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       10 
10 
     | 
    
         
             
              module Apollo
         
     | 
| 
       11 
11 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 12 
     | 
    
         
            +
                  # Namespace for mixins that provide support for Apollo's [federation directives](https://www.apollographql.com/docs/federation/federated-schemas/federated-directives/).
         
     | 
| 
      
 13 
     | 
    
         
            +
                  # Each Apollo federation directive is offered via an API starting with `apollo`. For example, `apollo_key` can be used to define an
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Apollo `@key`.
         
     | 
| 
       12 
15 
     | 
    
         
             
                  module ApolloDirectives
         
     | 
| 
      
 16 
     | 
    
         
            +
                    # Supports Apollo's [`@authenticated` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#authenticated).
         
     | 
| 
       13 
17 
     | 
    
         
             
                    module Authenticated
         
     | 
| 
       14 
     | 
    
         
            -
                      #  
     | 
| 
       15 
     | 
    
         
            -
                      #  
     | 
| 
      
 18 
     | 
    
         
            +
                      # Adds the [`@authenticated` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#authenticated)
         
     | 
| 
      
 19 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 20 
     | 
    
         
            +
                      #
         
     | 
| 
      
 21 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 22 
     | 
    
         
            +
                      #
         
     | 
| 
      
 23 
     | 
    
         
            +
                      # @example Add `@authenticated` to a type
         
     | 
| 
      
 24 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 25 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 26 
     | 
    
         
            +
                      #       t.apollo_authenticated
         
     | 
| 
      
 27 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 28 
     | 
    
         
            +
                      #   end
         
     | 
| 
       16 
29 
     | 
    
         
             
                      def apollo_authenticated
         
     | 
| 
       17 
30 
     | 
    
         
             
                        directive "authenticated"
         
     | 
| 
       18 
31 
     | 
    
         
             
                      end
         
     | 
| 
       19 
32 
     | 
    
         
             
                    end
         
     | 
| 
       20 
33 
     | 
    
         | 
| 
      
 34 
     | 
    
         
            +
                    # Supports Apollo's [`@extends` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#extends).
         
     | 
| 
       21 
35 
     | 
    
         
             
                    module Extends
         
     | 
| 
       22 
     | 
    
         
            -
                      #  
     | 
| 
       23 
     | 
    
         
            -
                      #  
     | 
| 
      
 36 
     | 
    
         
            +
                      # Adds the [`@extends` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#extends)
         
     | 
| 
      
 37 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 38 
     | 
    
         
            +
                      #
         
     | 
| 
      
 39 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 40 
     | 
    
         
            +
                      #
         
     | 
| 
      
 41 
     | 
    
         
            +
                      # @example Add `@extends` to a type
         
     | 
| 
      
 42 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 43 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 44 
     | 
    
         
            +
                      #       t.apollo_extends
         
     | 
| 
      
 45 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 46 
     | 
    
         
            +
                      #   end
         
     | 
| 
       24 
47 
     | 
    
         
             
                      def apollo_extends
         
     | 
| 
       25 
48 
     | 
    
         
             
                        directive "extends"
         
     | 
| 
       26 
49 
     | 
    
         
             
                      end
         
     | 
| 
       27 
50 
     | 
    
         
             
                    end
         
     | 
| 
       28 
51 
     | 
    
         | 
| 
      
 52 
     | 
    
         
            +
                    # Supports Apollo's [`@external` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#external).
         
     | 
| 
       29 
53 
     | 
    
         
             
                    module External
         
     | 
| 
       30 
     | 
    
         
            -
                      #  
     | 
| 
       31 
     | 
    
         
            -
                      #  
     | 
| 
      
 54 
     | 
    
         
            +
                      # Adds the [`@external` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#external)
         
     | 
| 
      
 55 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 56 
     | 
    
         
            +
                      #
         
     | 
| 
      
 57 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 58 
     | 
    
         
            +
                      #
         
     | 
| 
      
 59 
     | 
    
         
            +
                      # @example Add `@external` to a type
         
     | 
| 
      
 60 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 61 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 62 
     | 
    
         
            +
                      #       t.apollo_external
         
     | 
| 
      
 63 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 64 
     | 
    
         
            +
                      #   end
         
     | 
| 
       32 
65 
     | 
    
         
             
                      def apollo_external
         
     | 
| 
       33 
66 
     | 
    
         
             
                        directive "external"
         
     | 
| 
       34 
67 
     | 
    
         
             
                      end
         
     | 
| 
       35 
68 
     | 
    
         
             
                    end
         
     | 
| 
       36 
69 
     | 
    
         | 
| 
      
 70 
     | 
    
         
            +
                    # Supports Apollo's [`@inaccessible` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#inaccessible).
         
     | 
| 
       37 
71 
     | 
    
         
             
                    module Inaccessible
         
     | 
| 
       38 
     | 
    
         
            -
                      #  
     | 
| 
       39 
     | 
    
         
            -
                      #  
     | 
| 
      
 72 
     | 
    
         
            +
                      # Adds the [`@inaccessible` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#inaccessible)
         
     | 
| 
      
 73 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 74 
     | 
    
         
            +
                      #
         
     | 
| 
      
 75 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 76 
     | 
    
         
            +
                      #
         
     | 
| 
      
 77 
     | 
    
         
            +
                      # @example Add `@inaccessible` to a type
         
     | 
| 
      
 78 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 79 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 80 
     | 
    
         
            +
                      #       t.apollo_inaccessible
         
     | 
| 
      
 81 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 82 
     | 
    
         
            +
                      #   end
         
     | 
| 
       40 
83 
     | 
    
         
             
                      def apollo_inaccessible
         
     | 
| 
       41 
84 
     | 
    
         
             
                        directive "inaccessible"
         
     | 
| 
       42 
85 
     | 
    
         
             
                      end
         
     | 
| 
       43 
86 
     | 
    
         
             
                    end
         
     | 
| 
       44 
87 
     | 
    
         | 
| 
      
 88 
     | 
    
         
            +
                    # Supports Apollo's [`@interfaceObject` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#interfaceobject).
         
     | 
| 
       45 
89 
     | 
    
         
             
                    module InterfaceObject
         
     | 
| 
       46 
     | 
    
         
            -
                      #  
     | 
| 
       47 
     | 
    
         
            -
                      #  
     | 
| 
      
 90 
     | 
    
         
            +
                      # Adds the [`@interfaceObject` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#interfaceobject)
         
     | 
| 
      
 91 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 92 
     | 
    
         
            +
                      #
         
     | 
| 
      
 93 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 94 
     | 
    
         
            +
                      #
         
     | 
| 
      
 95 
     | 
    
         
            +
                      # @example Add `@interfaceObject` to a type
         
     | 
| 
      
 96 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 97 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 98 
     | 
    
         
            +
                      #       t.apollo_interface_object
         
     | 
| 
      
 99 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 100 
     | 
    
         
            +
                      #   end
         
     | 
| 
       48 
101 
     | 
    
         
             
                      def apollo_interface_object
         
     | 
| 
       49 
102 
     | 
    
         
             
                        directive "interfaceObject"
         
     | 
| 
       50 
103 
     | 
    
         
             
                      end
         
     | 
| 
       51 
104 
     | 
    
         
             
                    end
         
     | 
| 
       52 
105 
     | 
    
         | 
| 
      
 106 
     | 
    
         
            +
                    # Supports Apollo's [`@key` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#key).
         
     | 
| 
       53 
107 
     | 
    
         
             
                    module Key
         
     | 
| 
       54 
     | 
    
         
            -
                      #  
     | 
| 
       55 
     | 
    
         
            -
                      #  
     | 
| 
      
 108 
     | 
    
         
            +
                      # Adds the [`@key` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#key)
         
     | 
| 
      
 109 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 110 
     | 
    
         
            +
                      #
         
     | 
| 
      
 111 
     | 
    
         
            +
                      # @param fields [String] A GraphQL selection set (provided as a string) of fields and subfields that contribute to the entity's
         
     | 
| 
      
 112 
     | 
    
         
            +
                      #   unique key.
         
     | 
| 
      
 113 
     | 
    
         
            +
                      # @param resolvable [Boolean] If false, indicates to the Apollo router that this subgraph doesn't define a reference resolver for
         
     | 
| 
      
 114 
     | 
    
         
            +
                      #   this entity. This means that router query plans can't "jump to" this subgraph to resolve fields that aren't defined in another
         
     | 
| 
      
 115 
     | 
    
         
            +
                      #   subgraph.
         
     | 
| 
      
 116 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 117 
     | 
    
         
            +
                      #
         
     | 
| 
      
 118 
     | 
    
         
            +
                      # @example Define a `@key` on a non-indexed type
         
     | 
| 
      
 119 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 120 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 121 
     | 
    
         
            +
                      #       t.field "organizationId", "ID"
         
     | 
| 
      
 122 
     | 
    
         
            +
                      #       t.field "id", "ID"
         
     | 
| 
      
 123 
     | 
    
         
            +
                      #       t.apollo_key fields: "id organizationId", resolvable: false
         
     | 
| 
      
 124 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 125 
     | 
    
         
            +
                      #   end
         
     | 
| 
      
 126 
     | 
    
         
            +
                      #
         
     | 
| 
      
 127 
     | 
    
         
            +
                      # @note ElasticGraph automatically defines an `apollo_key` of `id` for every indexed type. This API is only needed when defining
         
     | 
| 
      
 128 
     | 
    
         
            +
                      #   additional keys on an indexed type, or defining a key for a non-indexed type.
         
     | 
| 
       56 
129 
     | 
    
         
             
                      def apollo_key(fields:, resolvable: true)
         
     | 
| 
       57 
130 
     | 
    
         
             
                        directive "key", fields: fields, resolvable: resolvable
         
     | 
| 
       58 
131 
     | 
    
         
             
                      end
         
     | 
| 
       59 
132 
     | 
    
         
             
                    end
         
     | 
| 
       60 
133 
     | 
    
         | 
| 
      
 134 
     | 
    
         
            +
                    # Supports Apollo's [`@override` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#override).
         
     | 
| 
       61 
135 
     | 
    
         
             
                    module Override
         
     | 
| 
       62 
     | 
    
         
            -
                      #  
     | 
| 
       63 
     | 
    
         
            -
                      #  
     | 
| 
      
 136 
     | 
    
         
            +
                      # Adds the [`@override` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#override)
         
     | 
| 
      
 137 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 138 
     | 
    
         
            +
                      #
         
     | 
| 
      
 139 
     | 
    
         
            +
                      # @param from [String] The name of the other subgraph that no longer resolves the field.
         
     | 
| 
      
 140 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 141 
     | 
    
         
            +
                      #
         
     | 
| 
      
 142 
     | 
    
         
            +
                      # @example Add `@override` to a field
         
     | 
| 
      
 143 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 144 
     | 
    
         
            +
                      #     schema.object_type "Product" do |t|
         
     | 
| 
      
 145 
     | 
    
         
            +
                      #       t.field "inStock", "Boolean" do |f|
         
     | 
| 
      
 146 
     | 
    
         
            +
                      #         f.apollo_override from: "Products"
         
     | 
| 
      
 147 
     | 
    
         
            +
                      #       end
         
     | 
| 
      
 148 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 149 
     | 
    
         
            +
                      #   end
         
     | 
| 
       64 
150 
     | 
    
         
             
                      def apollo_override(from:)
         
     | 
| 
       65 
151 
     | 
    
         
             
                        directive "override", from: from
         
     | 
| 
       66 
152 
     | 
    
         
             
                      end
         
     | 
| 
       67 
153 
     | 
    
         
             
                    end
         
     | 
| 
       68 
154 
     | 
    
         | 
| 
      
 155 
     | 
    
         
            +
                    # Supports Apollo's [`@policy` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#policy).
         
     | 
| 
       69 
156 
     | 
    
         
             
                    module Policy
         
     | 
| 
       70 
     | 
    
         
            -
                      #  
     | 
| 
       71 
     | 
    
         
            -
                      #  
     | 
| 
      
 157 
     | 
    
         
            +
                      # Adds the [`@policy` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#policy)
         
     | 
| 
      
 158 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 159 
     | 
    
         
            +
                      #
         
     | 
| 
      
 160 
     | 
    
         
            +
                      # @param policies [Array<String>] List of authorization policies.
         
     | 
| 
      
 161 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 162 
     | 
    
         
            +
                      #
         
     | 
| 
      
 163 
     | 
    
         
            +
                      # @example Add `@policy` to a type
         
     | 
| 
      
 164 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 165 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 166 
     | 
    
         
            +
                      #       t.apollo_policy policies: ["Policy1", "Policy2"]
         
     | 
| 
      
 167 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 168 
     | 
    
         
            +
                      #   end
         
     | 
| 
       72 
169 
     | 
    
         
             
                      def apollo_policy(policies:)
         
     | 
| 
       73 
170 
     | 
    
         
             
                        directive "policy", policies: policies
         
     | 
| 
       74 
171 
     | 
    
         
             
                      end
         
     | 
| 
       75 
172 
     | 
    
         
             
                    end
         
     | 
| 
       76 
173 
     | 
    
         | 
| 
      
 174 
     | 
    
         
            +
                    # Supports Apollo's [`@provides` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#provides).
         
     | 
| 
       77 
175 
     | 
    
         
             
                    module Provides
         
     | 
| 
       78 
     | 
    
         
            -
                      #  
     | 
| 
       79 
     | 
    
         
            -
                      #  
     | 
| 
      
 176 
     | 
    
         
            +
                      # Adds the [`@provides` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#provides)
         
     | 
| 
      
 177 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 178 
     | 
    
         
            +
                      #
         
     | 
| 
      
 179 
     | 
    
         
            +
                      # @param fields [String] A GraphQL selection set (provided as a string) of object fields and subfields that the subgraph can
         
     | 
| 
      
 180 
     | 
    
         
            +
                      #   resolve only at this query path.
         
     | 
| 
      
 181 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 182 
     | 
    
         
            +
                      #
         
     | 
| 
      
 183 
     | 
    
         
            +
                      # @example Add `@provides` to a field
         
     | 
| 
      
 184 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 185 
     | 
    
         
            +
                      #     schema.object_type "Product" do |t|
         
     | 
| 
      
 186 
     | 
    
         
            +
                      #       t.field "name", "String"
         
     | 
| 
      
 187 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 188 
     | 
    
         
            +
                      #
         
     | 
| 
      
 189 
     | 
    
         
            +
                      #     schema.object_type "StoreLocation" do |t|
         
     | 
| 
      
 190 
     | 
    
         
            +
                      #       t.field "products", "[Product!]!" do |f|
         
     | 
| 
      
 191 
     | 
    
         
            +
                      #         f.mapping type: "nested"
         
     | 
| 
      
 192 
     | 
    
         
            +
                      #         f.apollo_provides fields: "name"
         
     | 
| 
      
 193 
     | 
    
         
            +
                      #       end
         
     | 
| 
      
 194 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 195 
     | 
    
         
            +
                      #   end
         
     | 
| 
       80 
196 
     | 
    
         
             
                      def apollo_provides(fields:)
         
     | 
| 
       81 
197 
     | 
    
         
             
                        directive "provides", fields: fields
         
     | 
| 
       82 
198 
     | 
    
         
             
                      end
         
     | 
| 
       83 
199 
     | 
    
         
             
                    end
         
     | 
| 
       84 
200 
     | 
    
         | 
| 
      
 201 
     | 
    
         
            +
                    # Supports Apollo's [`@requires` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#requires).
         
     | 
| 
       85 
202 
     | 
    
         
             
                    module Requires
         
     | 
| 
       86 
     | 
    
         
            -
                      #  
     | 
| 
       87 
     | 
    
         
            -
                      #  
     | 
| 
      
 203 
     | 
    
         
            +
                      # Adds the [`@requires` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#requires)
         
     | 
| 
      
 204 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 205 
     | 
    
         
            +
                      #
         
     | 
| 
      
 206 
     | 
    
         
            +
                      # @param fields [String] A GraphQL selection set (provided as a string) of object fields and subfields that the subgraph can
         
     | 
| 
      
 207 
     | 
    
         
            +
                      #   resolve only at this query path.
         
     | 
| 
      
 208 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 209 
     | 
    
         
            +
                      #
         
     | 
| 
      
 210 
     | 
    
         
            +
                      # @example Add `@requires` to a field
         
     | 
| 
      
 211 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 212 
     | 
    
         
            +
                      #     schema.object_type "Product" do |t|
         
     | 
| 
      
 213 
     | 
    
         
            +
                      #       t.field "size", "Int"
         
     | 
| 
      
 214 
     | 
    
         
            +
                      #       t.field "weight", "Int"
         
     | 
| 
      
 215 
     | 
    
         
            +
                      #       t.field "shippingEstimate", "String" do |f|
         
     | 
| 
      
 216 
     | 
    
         
            +
                      #         f.apollo_requires fields: "size weight"
         
     | 
| 
      
 217 
     | 
    
         
            +
                      #       end
         
     | 
| 
      
 218 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 219 
     | 
    
         
            +
                      #   end
         
     | 
| 
       88 
220 
     | 
    
         
             
                      def apollo_requires(fields:)
         
     | 
| 
       89 
221 
     | 
    
         
             
                        directive "requires", fields: fields
         
     | 
| 
       90 
222 
     | 
    
         
             
                      end
         
     | 
| 
       91 
223 
     | 
    
         
             
                    end
         
     | 
| 
       92 
224 
     | 
    
         | 
| 
      
 225 
     | 
    
         
            +
                    # Supports Apollo's [`@requiresScopes` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#requiresscopes).
         
     | 
| 
       93 
226 
     | 
    
         
             
                    module RequiresScopes
         
     | 
| 
       94 
     | 
    
         
            -
                      #  
     | 
| 
       95 
     | 
    
         
            -
                      #  
     | 
| 
      
 227 
     | 
    
         
            +
                      # Adds the [`@requiresScopes` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#requiresscopes)
         
     | 
| 
      
 228 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 229 
     | 
    
         
            +
                      #
         
     | 
| 
      
 230 
     | 
    
         
            +
                      # @param scopes [Array<String>] List of JWT scopes that must be granted to the user in order to access the underlying element data.
         
     | 
| 
      
 231 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 232 
     | 
    
         
            +
                      #
         
     | 
| 
      
 233 
     | 
    
         
            +
                      # @example Add `@requiresScopes` to a field
         
     | 
| 
      
 234 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 235 
     | 
    
         
            +
                      #     schema.object_type "Product" do |t|
         
     | 
| 
      
 236 
     | 
    
         
            +
                      #       t.field "shippingEstimate", "String" do |f|
         
     | 
| 
      
 237 
     | 
    
         
            +
                      #         f.apollo_requires_scopes scopes: "shipping"
         
     | 
| 
      
 238 
     | 
    
         
            +
                      #       end
         
     | 
| 
      
 239 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 240 
     | 
    
         
            +
                      #   end
         
     | 
| 
       96 
241 
     | 
    
         
             
                      def apollo_requires_scopes(scopes:)
         
     | 
| 
       97 
242 
     | 
    
         
             
                        directive "requiresScopes", scopes: scopes
         
     | 
| 
       98 
243 
     | 
    
         
             
                      end
         
     | 
| 
       99 
244 
     | 
    
         
             
                    end
         
     | 
| 
       100 
245 
     | 
    
         | 
| 
      
 246 
     | 
    
         
            +
                    # Supports Apollo's [`@shareable` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#shareable).
         
     | 
| 
       101 
247 
     | 
    
         
             
                    module Shareable
         
     | 
| 
       102 
     | 
    
         
            -
                      #  
     | 
| 
       103 
     | 
    
         
            -
                      #  
     | 
| 
      
 248 
     | 
    
         
            +
                      # Adds the [`@shareable` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#shareable)
         
     | 
| 
      
 249 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 250 
     | 
    
         
            +
                      #
         
     | 
| 
      
 251 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 252 
     | 
    
         
            +
                      #
         
     | 
| 
      
 253 
     | 
    
         
            +
                      # @example Add `@shareable` to a type
         
     | 
| 
      
 254 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 255 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 256 
     | 
    
         
            +
                      #       t.apollo_shareable
         
     | 
| 
      
 257 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 258 
     | 
    
         
            +
                      #   end
         
     | 
| 
       104 
259 
     | 
    
         
             
                      def apollo_shareable
         
     | 
| 
       105 
260 
     | 
    
         
             
                        directive "shareable"
         
     | 
| 
       106 
261 
     | 
    
         
             
                      end
         
     | 
| 
       107 
262 
     | 
    
         
             
                    end
         
     | 
| 
       108 
263 
     | 
    
         | 
| 
      
 264 
     | 
    
         
            +
                    # Supports Apollo's [`@tag` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#tag).
         
     | 
| 
       109 
265 
     | 
    
         
             
                    module Tag
         
     | 
| 
       110 
     | 
    
         
            -
                      #  
     | 
| 
       111 
     | 
    
         
            -
                      #  
     | 
| 
      
 266 
     | 
    
         
            +
                      # Adds the [`@tag` directive](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#tag)
         
     | 
| 
      
 267 
     | 
    
         
            +
                      # to the schema element.
         
     | 
| 
      
 268 
     | 
    
         
            +
                      #
         
     | 
| 
      
 269 
     | 
    
         
            +
                      # @return [void]
         
     | 
| 
      
 270 
     | 
    
         
            +
                      #
         
     | 
| 
      
 271 
     | 
    
         
            +
                      # @example Add `@tag` to a type
         
     | 
| 
      
 272 
     | 
    
         
            +
                      #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 273 
     | 
    
         
            +
                      #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 274 
     | 
    
         
            +
                      #       t.apollo_tag name: "public"
         
     | 
| 
      
 275 
     | 
    
         
            +
                      #     end
         
     | 
| 
      
 276 
     | 
    
         
            +
                      #   end
         
     | 
| 
      
 277 
     | 
    
         
            +
                      #
         
     | 
| 
      
 278 
     | 
    
         
            +
                      # @see APIExtension#tag_built_in_types_with
         
     | 
| 
      
 279 
     | 
    
         
            +
                      # @see FieldExtension#tag_with
         
     | 
| 
       112 
280 
     | 
    
         
             
                      def apollo_tag(name:)
         
     | 
| 
       113 
281 
     | 
    
         
             
                        directive "tag", name: name
         
     | 
| 
       114 
282 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -11,6 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::Argument} to offer Apollo argument directives.
         
     | 
| 
       14 
15 
     | 
    
         
             
                  module ArgumentExtension
         
     | 
| 
       15 
16 
     | 
    
         
             
                    include ApolloDirectives::Inaccessible
         
     | 
| 
       16 
17 
     | 
    
         
             
                    include ApolloDirectives::Tag
         
     | 
| 
         @@ -16,6 +16,8 @@ module ElasticGraph 
     | 
|
| 
       16 
16 
     | 
    
         
             
                  #   usually cause it to be treated as indexed!).
         
     | 
| 
       17 
17 
     | 
    
         
             
                  # - A merged set of `graphql_fields_by_name` cannot be safely computed. That method raises errors if a field with the same name
         
     | 
| 
       18 
18 
     | 
    
         
             
                  #   has conflicting definitions on different subtypes, but we must allow that on `_Entity` subtypes.
         
     | 
| 
      
 19 
     | 
    
         
            +
                  #
         
     | 
| 
      
 20 
     | 
    
         
            +
                  # @private
         
     | 
| 
       19 
21 
     | 
    
         
             
                  module EntityTypeExtension
         
     | 
| 
       20 
22 
     | 
    
         
             
                    def graphql_fields_by_name
         
     | 
| 
       21 
23 
     | 
    
         
             
                      {}
         
     | 
| 
         @@ -11,6 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::EnumType} to offer Apollo enum type directives.
         
     | 
| 
       14 
15 
     | 
    
         
             
                  module EnumTypeExtension
         
     | 
| 
       15 
16 
     | 
    
         
             
                    include ApolloDirectives::Authenticated
         
     | 
| 
       16 
17 
     | 
    
         
             
                    include ApolloDirectives::Inaccessible
         
     | 
| 
         @@ -11,6 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::EnumValue} to offer Apollo enum value directives.
         
     | 
| 
       14 
15 
     | 
    
         
             
                  module EnumValueExtension
         
     | 
| 
       15 
16 
     | 
    
         
             
                    include ApolloDirectives::Inaccessible
         
     | 
| 
       16 
17 
     | 
    
         
             
                    include ApolloDirectives::Tag
         
     | 
| 
         @@ -21,6 +21,8 @@ module ElasticGraph 
     | 
|
| 
       21 
21 
     | 
    
         
             
              module Apollo
         
     | 
| 
       22 
22 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
       23 
23 
     | 
    
         
             
                  # Extension module applied to `ElasticGraph::SchemaDefinition::Factory` to add Apollo tagging support.
         
     | 
| 
      
 24 
     | 
    
         
            +
                  #
         
     | 
| 
      
 25 
     | 
    
         
            +
                  # @private
         
     | 
| 
       24 
26 
     | 
    
         
             
                  module FactoryExtension
         
     | 
| 
       25 
27 
     | 
    
         
             
                    # Steep has a hard type with the arg splats here.
         
     | 
| 
       26 
28 
     | 
    
         
             
                    __skip__ = def new_field(**kwargs)
         
     | 
| 
         @@ -11,7 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
       14 
     | 
    
         
            -
                  #  
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::Field} to offer Apollo field directives.
         
     | 
| 
       15 
15 
     | 
    
         
             
                  module FieldExtension
         
     | 
| 
       16 
16 
     | 
    
         
             
                    include ApolloDirectives::Authenticated
         
     | 
| 
       17 
17 
     | 
    
         
             
                    include ApolloDirectives::External
         
     | 
| 
         @@ -24,13 +24,26 @@ module ElasticGraph 
     | 
|
| 
       24 
24 
     | 
    
         
             
                    include ApolloDirectives::Shareable
         
     | 
| 
       25 
25 
     | 
    
         
             
                    include ApolloDirectives::Tag
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
                    # Extension method designed to support Apollo's contract variant tagging 
     | 
| 
      
 27 
     | 
    
         
            +
                    # Extension method designed to support Apollo's [contract variant tagging](https://www.apollographql.com/docs/studio/contracts/).
         
     | 
| 
       28 
28 
     | 
    
         
             
                    #
         
     | 
| 
       29 
     | 
    
         
            -
                    #  
     | 
| 
      
 29 
     | 
    
         
            +
                    # Calling this method on a field will cause the field and every schema element derived from the field (e.g. the filter field,
         
     | 
| 
      
 30 
     | 
    
         
            +
                    # he aggregation field, etc), to be tagged with the given `tag_name`, ensuring that all capabilities related to the field are
         
     | 
| 
      
 31 
     | 
    
         
            +
                    # available in the contract variant.
         
     | 
| 
       30 
32 
     | 
    
         
             
                    #
         
     | 
| 
       31 
     | 
    
         
            -
                    #  
     | 
| 
       32 
     | 
    
         
            -
                    #  
     | 
| 
       33 
     | 
    
         
            -
                    # 
     | 
| 
      
 33 
     | 
    
         
            +
                    # @param tag_name [String] tag to add to schema elements generated for this field
         
     | 
| 
      
 34 
     | 
    
         
            +
                    # @return [void]
         
     | 
| 
      
 35 
     | 
    
         
            +
                    #
         
     | 
| 
      
 36 
     | 
    
         
            +
                    # @example Tag a field (and its derived elements) with "public"
         
     | 
| 
      
 37 
     | 
    
         
            +
                    #   ElasticGraph.define_schema do |schema|
         
     | 
| 
      
 38 
     | 
    
         
            +
                    #     schema.object_type "Campaign" do |t|
         
     | 
| 
      
 39 
     | 
    
         
            +
                    #       t.field "name", "String" do |f|
         
     | 
| 
      
 40 
     | 
    
         
            +
                    #         f.tag_with "public"
         
     | 
| 
      
 41 
     | 
    
         
            +
                    #       end
         
     | 
| 
      
 42 
     | 
    
         
            +
                    #     end
         
     | 
| 
      
 43 
     | 
    
         
            +
                    #   end
         
     | 
| 
      
 44 
     | 
    
         
            +
                    #
         
     | 
| 
      
 45 
     | 
    
         
            +
                    # @see ApolloDirectives::Tag
         
     | 
| 
      
 46 
     | 
    
         
            +
                    # @see APIExtension#tag_built_in_types_with
         
     | 
| 
       34 
47 
     | 
    
         
             
                    def tag_with(tag_name)
         
     | 
| 
       35 
48 
     | 
    
         
             
                      on_each_generated_schema_element do |element|
         
     | 
| 
       36 
49 
     | 
    
         
             
                        needs_tagging =
         
     | 
| 
         @@ -50,6 +63,10 @@ module ElasticGraph 
     | 
|
| 
       50 
63 
     | 
    
         
             
                    end
         
     | 
| 
       51 
64 
     | 
    
         | 
| 
       52 
65 
     | 
    
         
             
                    # Helper method that indicates if the given schema element has a specific tag.
         
     | 
| 
      
 66 
     | 
    
         
            +
                    #
         
     | 
| 
      
 67 
     | 
    
         
            +
                    # @param element [Object] element to check
         
     | 
| 
      
 68 
     | 
    
         
            +
                    # @param tag_name [String] tag to check
         
     | 
| 
      
 69 
     | 
    
         
            +
                    # @return [Boolean]
         
     | 
| 
       53 
70 
     | 
    
         
             
                    def self.tagged_with?(element, tag_name)
         
     | 
| 
       54 
71 
     | 
    
         
             
                      element.directives.any? { |dir| dir.name == "tag" && dir.arguments == {name: tag_name} }
         
     | 
| 
       55 
72 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -11,6 +11,8 @@ module ElasticGraph 
     | 
|
| 
       11 
11 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
       12 
12 
     | 
    
         
             
                  # Module designed to be extended onto an `ElasticGraph::SchemaDefinition::GraphQLSDLEnumerator`
         
     | 
| 
       13 
13 
     | 
    
         
             
                  # instance to customize the schema artifacts to support Apollo.
         
     | 
| 
      
 14 
     | 
    
         
            +
                  #
         
     | 
| 
      
 15 
     | 
    
         
            +
                  # @private
         
     | 
| 
       14 
16 
     | 
    
         
             
                  module GraphQLSDLEnumeratorExtension
         
     | 
| 
       15 
17 
     | 
    
         
             
                    def root_query_type
         
     | 
| 
       16 
18 
     | 
    
         
             
                      super.tap do |type_or_nil|
         
     | 
| 
         @@ -11,6 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::InputType} to offer Apollo input type directives.
         
     | 
| 
       14 
15 
     | 
    
         
             
                  module InputTypeExtension
         
     | 
| 
       15 
16 
     | 
    
         
             
                    include ApolloDirectives::Inaccessible
         
     | 
| 
       16 
17 
     | 
    
         
             
                    include ApolloDirectives::Tag
         
     | 
| 
         @@ -11,6 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::InterfaceType} to offer Apollo interface type directives.
         
     | 
| 
       14 
15 
     | 
    
         
             
                  module InterfaceTypeExtension
         
     | 
| 
       15 
16 
     | 
    
         
             
                    include ApolloDirectives::Authenticated
         
     | 
| 
       16 
17 
     | 
    
         
             
                    include ApolloDirectives::Extends
         
     | 
| 
         @@ -11,6 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::ObjectType} to offer Apollo object type directives.
         
     | 
| 
       14 
15 
     | 
    
         
             
                  module ObjectTypeExtension
         
     | 
| 
       15 
16 
     | 
    
         
             
                    include ApolloDirectives::Authenticated
         
     | 
| 
       16 
17 
     | 
    
         
             
                    include ApolloDirectives::Extends
         
     | 
| 
         @@ -11,6 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::ScalarType} to offer Apollo scalar type directives.
         
     | 
| 
       14 
15 
     | 
    
         
             
                  module ScalarTypeExtension
         
     | 
| 
       15 
16 
     | 
    
         
             
                    include ApolloDirectives::Authenticated
         
     | 
| 
       16 
17 
     | 
    
         
             
                    include ApolloDirectives::Inaccessible
         
     | 
| 
         @@ -10,6 +10,8 @@ module ElasticGraph 
     | 
|
| 
       10 
10 
     | 
    
         
             
              module Apollo
         
     | 
| 
       11 
11 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
       12 
12 
     | 
    
         
             
                  # Extension module applied to `ElasticGraph::SchemaDefinition::State` to support extra Apollo state.
         
     | 
| 
      
 13 
     | 
    
         
            +
                  #
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # @private
         
     | 
| 
       13 
15 
     | 
    
         
             
                  module StateExtension
         
     | 
| 
       14 
16 
     | 
    
         
             
                    # @dynamic apollo_directive_definitions, apollo_directive_definitions=
         
     | 
| 
       15 
17 
     | 
    
         
             
                    attr_accessor :apollo_directive_definitions
         
     | 
| 
         @@ -11,6 +11,7 @@ require "elastic_graph/apollo/schema_definition/apollo_directives" 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module ElasticGraph
         
     | 
| 
       12 
12 
     | 
    
         
             
              module Apollo
         
     | 
| 
       13 
13 
     | 
    
         
             
                module SchemaDefinition
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # Extends {ElasticGraph::SchemaDefinition::SchemaElements::UnionType} to offer Apollo union type directives.
         
     | 
| 
       14 
15 
     | 
    
         
             
                  module UnionTypeExtension
         
     | 
| 
       15 
16 
     | 
    
         
             
                    include ApolloDirectives::Inaccessible
         
     | 
| 
       16 
17 
     | 
    
         
             
                    include ApolloDirectives::Tag
         
     | 
| 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            script_dir=$(dirname $0)
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            # Use the current max Elasticsearch version we test against.
         
     | 
| 
       4 
     | 
    
         
            -
            export VERSION=$(ruby -ryaml -e "puts YAML.load_file('$script_dir/../../config/ 
     | 
| 
      
 4 
     | 
    
         
            +
            export VERSION=$(ruby -ryaml -e "puts YAML.load_file('$script_dir/../../config/tested_datastore_versions.yaml').fetch('elasticsearch').max_by { |v| Gem::Version.new(v) }")
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            # Use the same Ruby version in the docker container as what we are currently using.
         
     | 
| 
       7 
7 
     | 
    
         
             
            export RUBY_VERSION=$(ruby -e "puts RUBY_VERSION")
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,16 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: elasticgraph-apollo
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.18.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.18.0.5
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Myron Marston
         
     | 
| 
      
 8 
     | 
    
         
            +
            - Ben VandenBos
         
     | 
| 
      
 9 
     | 
    
         
            +
            - Square Engineering
         
     | 
| 
       8 
10 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
11 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
12 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024-09- 
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2024-09-20 00:00:00.000000000 Z
         
     | 
| 
       12 
14 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
16 
     | 
    
         
             
              name: rubocop-factory_bot
         
     | 
| 
         @@ -266,28 +268,28 @@ dependencies: 
     | 
|
| 
       266 
268 
     | 
    
         
             
                requirements:
         
     | 
| 
       267 
269 
     | 
    
         
             
                - - '='
         
     | 
| 
       268 
270 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       269 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 271 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       270 
272 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       271 
273 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       272 
274 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       273 
275 
     | 
    
         
             
                requirements:
         
     | 
| 
       274 
276 
     | 
    
         
             
                - - '='
         
     | 
| 
       275 
277 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       276 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 278 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       277 
279 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       278 
280 
     | 
    
         
             
              name: elasticgraph-support
         
     | 
| 
       279 
281 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       280 
282 
     | 
    
         
             
                requirements:
         
     | 
| 
       281 
283 
     | 
    
         
             
                - - '='
         
     | 
| 
       282 
284 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       283 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 285 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       284 
286 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       285 
287 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       286 
288 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       287 
289 
     | 
    
         
             
                requirements:
         
     | 
| 
       288 
290 
     | 
    
         
             
                - - '='
         
     | 
| 
       289 
291 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       290 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 292 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       291 
293 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       292 
294 
     | 
    
         
             
              name: graphql
         
     | 
| 
       293 
295 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -322,70 +324,70 @@ dependencies: 
     | 
|
| 
       322 
324 
     | 
    
         
             
                requirements:
         
     | 
| 
       323 
325 
     | 
    
         
             
                - - '='
         
     | 
| 
       324 
326 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       325 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 327 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       326 
328 
     | 
    
         
             
              type: :development
         
     | 
| 
       327 
329 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       328 
330 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       329 
331 
     | 
    
         
             
                requirements:
         
     | 
| 
       330 
332 
     | 
    
         
             
                - - '='
         
     | 
| 
       331 
333 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       332 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 334 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       333 
335 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       334 
336 
     | 
    
         
             
              name: elasticgraph-admin
         
     | 
| 
       335 
337 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       336 
338 
     | 
    
         
             
                requirements:
         
     | 
| 
       337 
339 
     | 
    
         
             
                - - '='
         
     | 
| 
       338 
340 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       339 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 341 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       340 
342 
     | 
    
         
             
              type: :development
         
     | 
| 
       341 
343 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       342 
344 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       343 
345 
     | 
    
         
             
                requirements:
         
     | 
| 
       344 
346 
     | 
    
         
             
                - - '='
         
     | 
| 
       345 
347 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       346 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 348 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       347 
349 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       348 
350 
     | 
    
         
             
              name: elasticgraph-elasticsearch
         
     | 
| 
       349 
351 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       350 
352 
     | 
    
         
             
                requirements:
         
     | 
| 
       351 
353 
     | 
    
         
             
                - - '='
         
     | 
| 
       352 
354 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       353 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 355 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       354 
356 
     | 
    
         
             
              type: :development
         
     | 
| 
       355 
357 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       356 
358 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       357 
359 
     | 
    
         
             
                requirements:
         
     | 
| 
       358 
360 
     | 
    
         
             
                - - '='
         
     | 
| 
       359 
361 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       360 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 362 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       361 
363 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       362 
364 
     | 
    
         
             
              name: elasticgraph-opensearch
         
     | 
| 
       363 
365 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       364 
366 
     | 
    
         
             
                requirements:
         
     | 
| 
       365 
367 
     | 
    
         
             
                - - '='
         
     | 
| 
       366 
368 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       367 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 369 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       368 
370 
     | 
    
         
             
              type: :development
         
     | 
| 
       369 
371 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       370 
372 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       371 
373 
     | 
    
         
             
                requirements:
         
     | 
| 
       372 
374 
     | 
    
         
             
                - - '='
         
     | 
| 
       373 
375 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       374 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 376 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       375 
377 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       376 
378 
     | 
    
         
             
              name: elasticgraph-indexer
         
     | 
| 
       377 
379 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       378 
380 
     | 
    
         
             
                requirements:
         
     | 
| 
       379 
381 
     | 
    
         
             
                - - '='
         
     | 
| 
       380 
382 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       381 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 383 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       382 
384 
     | 
    
         
             
              type: :development
         
     | 
| 
       383 
385 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       384 
386 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       385 
387 
     | 
    
         
             
                requirements:
         
     | 
| 
       386 
388 
     | 
    
         
             
                - - '='
         
     | 
| 
       387 
389 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       388 
     | 
    
         
            -
                    version: 0.18.0. 
     | 
| 
      
 390 
     | 
    
         
            +
                    version: 0.18.0.5
         
     | 
| 
       389 
391 
     | 
    
         
             
            description: 
         
     | 
| 
       390 
392 
     | 
    
         
             
            email:
         
     | 
| 
       391 
393 
     | 
    
         
             
            - myron@squareup.com
         
     |