Data Types: `Data Type Data Type`
data-type.DataType
A DataType is used to define the structure of data with version support and can be converted to the following formats:
- Elasticsearch Mappings
- GraphQL Schemas
- xLucene
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new DataType(config
, typeName?
, description?
): DataType
Parameters
Name | Type |
---|---|
config | Partial <DataTypeConfig > |
typeName? | string |
description? | string |
Returns
Defined in
data-types/src/data-type.ts:93
Properties
description
• Optional
Readonly
description: string
Defined in
data-types/src/data-type.ts:27
fields
• Readonly
fields: ReadonlyDataTypeFields
Defined in
data-types/src/data-type.ts:28
groupedFields
• Readonly
groupedFields: GroupedFields
An object of base fields with their child fields
Defined in
data-types/src/data-type.ts:31
name
• Readonly
name: string
Defined in
data-types/src/data-type.ts:26
version
• Readonly
version: number
Defined in
data-types/src/data-type.ts:29
Methods
toESMapping
▸ toESMapping(«destructured»?
): ESMapping
Convert the DataType to an elasticsearch mapping.
Parameters
Name | Type |
---|---|
«destructured» | Partial <ESMappingOptions > |
Returns
ESMapping
Defined in
data-types/src/data-type.ts:112
toGraphQL
▸ toGraphQL(args?
, removeScalars?
): string
Parameters
Name | Type | Default value |
---|---|---|
args? | GraphQLOptions | undefined |
removeScalars | boolean | false |
Returns
string
Defined in
data-types/src/data-type.ts:185
toGraphQLTypes
▸ toGraphQLTypes(args?
): GraphQLTypesResult
Parameters
Name | Type |
---|---|
args | GraphQLOptions |
Returns
Defined in
data-types/src/data-type.ts:193
toXlucene
▸ toXlucene(): xLuceneTypeConfig
Returns
xLuceneTypeConfig
Defined in
data-types/src/data-type.ts:267
mergeGraphQLDataTypes
▸ mergeGraphQLDataTypes(types
, options?
): string
Merge multiple data types into one GraphQL schema, useful for removing duplicates
Parameters
Name | Type |
---|---|
types | DataType [] |
options | MergeGraphQLOptions |
Returns
string