mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
https://github.com/hasura/graphql-engine/pull/5612
This commit is contained in:
parent
8bca587881
commit
2717c38352
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { RemoteRelationshipServer } from '../utils';
|
||||
import { RemoteRelationshipServer, parseRemoteRelationship } from '../utils';
|
||||
import styles from '../SchemaExplorer.scss';
|
||||
|
||||
type Props = {
|
||||
@ -10,6 +10,11 @@ const Collapsed: React.FC<Props> = ({ relationship }) => {
|
||||
if (!relationship) {
|
||||
return null;
|
||||
}
|
||||
const parseRelationship = parseRemoteRelationship(relationship);
|
||||
const relationMap = () => {
|
||||
const fields = parseRelationship.remoteFields.map(field => field.name);
|
||||
return ['', ...fields].join(' . ');
|
||||
};
|
||||
return (
|
||||
<div className={styles.display_flex}>
|
||||
<div>
|
||||
@ -19,7 +24,7 @@ const Collapsed: React.FC<Props> = ({ relationship }) => {
|
||||
<i>
|
||||
{`- ${relationship.table_name} → ${
|
||||
relationship.definition.remote_schema
|
||||
} . ${Object.keys(relationship.definition.remote_field)}`}
|
||||
} ${relationMap()}`}
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user