Class: ElasticGraph::SchemaDefinition::SchemaElements::TypeNamer

Inherits:
Object
  • Object
show all
Defined in:
elasticgraph-schema_definition/lib/elastic_graph/schema_definition/schema_elements/type_namer.rb

Overview

Abstraction for generating derived GraphQL type names based on a collection of formats. A default set of formats is included, and overrides can be provided to customize the format we use for naming derived types.

Constant Summary collapse

DEFAULT_FORMATS =

The default formats used for derived GraphQL type names. These formats can be customized by providing derived_type_name_formats to RakeTasks or Local::RakeTasks.

Returns:

  • (Hash<Symbol, String>)
{
  AggregatedValues: "%{base}AggregatedValues",
  Aggregation: "%{base}Aggregation",
  Connection: "%{base}Connection",
  Edge: "%{base}Edge",
  FieldsListFilterInput: "%{base}FieldsListFilterInput",
  FilterInput: "%{base}FilterInput",
  GroupedBy: "%{base}GroupedBy",
  InputEnum: "%{base}Input",
  ListElementFilterInput: "%{base}ListElementFilterInput",
  ListFilterInput: "%{base}ListFilterInput",
  SortOrder: "%{base}SortOrder",
  SubAggregation: "%{parent_types}%{base}SubAggregation",
  SubAggregations: "%{parent_agg_type}%{field_path}SubAggregations"
}.freeze