Module: ElasticGraph::Apollo::SchemaDefinition::ApolloDirectives::Policy

Included in:
EnumTypeExtension, FieldExtension, InterfaceTypeExtension, ObjectTypeExtension, ScalarTypeExtension
Defined in:
elasticgraph-apollo/lib/elastic_graph/apollo/schema_definition/apollo_directives.rb

Overview

Supports Apollo’s @policy directive.

Instance Method Summary collapse

Instance Method Details

#apollo_policy(policies:) ⇒ void

This method returns an undefined value.

Adds the @policy directive to the schema element.

Examples:

Add @policy to a type

ElasticGraph.define_schema do |schema|
  schema.object_type "Campaign" do |t|
    t.apollo_policy policies: ["Policy1", "Policy2"]
  end
end

Parameters:

  • policies (Array<String>)

    List of authorization policies.



169
170
171
# File 'elasticgraph-apollo/lib/elastic_graph/apollo/schema_definition/apollo_directives.rb', line 169

def apollo_policy(policies:)
  directive "policy", policies: policies
end