use public class function (#4859)

This commit is contained in:
Jack Kavanagh 2022-06-13 16:53:02 +02:00 committed by GitHub
parent 5158abb108
commit dcdc429b9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,14 +7,16 @@ interface Props {
type: GraphQLEnumType;
}
export const GraphQLExplorerEnum: FC<Props> = ({ type: { description, getValues } }) => {
export const GraphQLExplorerEnum: FC<Props> = ({ type }) => {
const values = type.getValues();
return (
<div className="graphql-explorer__type">
<MarkdownPreview markdown={description || '*no description*'} />
<MarkdownPreview markdown={type.description || '*no description*'} />
<h2 className="graphql-explorer__subheading">Values</h2>
<ul className="graphql-explorer__defs">
{getValues().map(value => (
{values.map(value => (
<li key={value.name}>
<span className="selectable bold">{value.name}</span>
<div className="graphql-explorer__defs__description">