Skip to content

Commit

Permalink
Uses core FieldType instead of custom type
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrhodes committed Jul 22, 2019
1 parent b6bec14 commit 90d6431
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
14 changes: 4 additions & 10 deletions x-pack/legacy/plugins/infra/public/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// Types
// ====================================================

import { FieldType } from 'ui/index_patterns';

export interface Query {
/** Get an infrastructure data source by id.The resolution order for the source configuration attributes is as followswith the first defined value winning:1. The attributes of the saved object with the given 'id'.2. The attributes defined in the static Kibana configuration key'xpack.infra.sources.default'.3. The hard-coded default values.As a consequence, querying a source that doesn't exist doesn't error out,but returns the configured or hardcoded defaults. */
source: InfraSource;
Expand Down Expand Up @@ -122,16 +124,8 @@ export interface InfraSourceStatus {
indexFields: InfraIndexField[];
}
/** A descriptor of a field in an index */
export interface InfraIndexField {
/** The name of the field */
name: string;
/** The type of the field's values as recognized by Kibana */
type: string;
/** Whether the field's values can be efficiently searched for */
searchable: boolean;
/** Whether the field's values can be aggregated */
aggregatable: boolean;
}
export interface InfraIndexField extends FieldType {}

/** One metadata entry for a node. */
export interface InfraNodeMetadata {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const SnapshotToolbar = injectI18n(({ intl }) => (
groupBy={groupBy}
nodeType={nodeType}
onChange={changeGroupBy}
fields={derivedIndexPattern.fields as any}
fields={derivedIndexPattern.fields}
onChangeCustomOptions={changeCustomOptions}
customOptions={customOptions}
/>
Expand Down
13 changes: 3 additions & 10 deletions x-pack/legacy/plugins/infra/server/graphql/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* tslint:disable */
import { InfraContext } from '../lib/infra_types';
import { GraphQLResolveInfo } from 'graphql';
import { FieldType } from 'ui/index_patterns';

export type Resolver<Result, Parent = any, Context = any, Args = never> = (
parent: Parent,
Expand Down Expand Up @@ -150,16 +151,8 @@ export interface InfraSourceStatus {
indexFields: InfraIndexField[];
}
/** A descriptor of a field in an index */
export interface InfraIndexField {
/** The name of the field */
name: string;
/** The type of the field's values as recognized by Kibana */
type: string;
/** Whether the field's values can be efficiently searched for */
searchable: boolean;
/** Whether the field's values can be aggregated */
aggregatable: boolean;
}
export interface InfraIndexField extends FieldType {}

/** One metadata entry for a node. */
export interface InfraNodeMetadata {
id: string;
Expand Down

0 comments on commit 90d6431

Please sign in to comment.