Skip to content

Commit 18c4e58

Browse files
committed
work review
1 parent 2487dac commit 18c4e58

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

x-pack/plugins/secops/public/containers/who_am_i/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
import { get } from 'lodash';
78
import React from 'react';
89
import { Query } from 'react-apollo';
10+
911
import { WhoAmIQuery } from '../../../common/graphql/types';
1012

11-
import { whoAmIQuery } from './who_am_I.gql_query';
13+
import { whoAmIQuery } from './who_am_i.gql_query';
1214

13-
interface WHoAmIArgs {
15+
interface WhoAmIArgs {
1416
appName: string;
1517
}
1618

1719
interface WHoAmIProps {
18-
children: (args: WHoAmIArgs) => React.ReactNode;
20+
children: (args: WhoAmIArgs) => React.ReactNode;
1921
sourceId: string;
2022
}
2123

@@ -28,8 +30,7 @@ export const WhoAmI = ({ children, sourceId }: WHoAmIProps) => (
2830
>
2931
{({ data }) =>
3032
children({
31-
appName:
32-
data && data.source && data.source.whoAmI ? data.source.whoAmI.appName : 'Who am I ?',
33+
appName: get(data, 'source.whoAmI.appName') || 'Who am I ?',
3334
})
3435
}
3536
</Query>

x-pack/plugins/secops/server/graphql/who_am_i/schema.gql.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const whoAmISchema = gql`
1313
}
1414
1515
extend type Source {
16+
"Just a simple example to get the app name"
1617
whoAmI: SayMyName
1718
}
1819
`;

0 commit comments

Comments
 (0)