diff --git a/packages/graphiql-react/src/explorer/components/schema-documentation.tsx b/packages/graphiql-react/src/explorer/components/schema-documentation.tsx index 481dc87cf67..f7c4da5ebdc 100644 --- a/packages/graphiql-react/src/explorer/components/schema-documentation.tsx +++ b/packages/graphiql-react/src/explorer/components/schema-documentation.tsx @@ -17,6 +17,12 @@ export function SchemaDocumentation(props: SchemaDocumentationProps) { const queryType = props.schema.getQueryType(); const mutationType = props.schema.getMutationType?.(); const subscriptionType = props.schema.getSubscriptionType?.(); + const typeMap = props.schema.getTypeMap(); + const ignoreTypesInAllSchema = [ + queryType?.name, + mutationType?.name, + subscriptionType?.name, + ]; return ( <> @@ -49,6 +55,23 @@ export function SchemaDocumentation(props: SchemaDocumentationProps) { )} + + {typeMap && ( + + {Object.values(typeMap).map(type => { + if (ignoreTypesInAllSchema.includes(type.name)) { + return null; + } + + return ( + + + + ); + })} + + )} + > ); } diff --git a/packages/graphiql-react/src/explorer/components/section.tsx b/packages/graphiql-react/src/explorer/components/section.tsx index 4071889a2a1..4204d528f6f 100644 --- a/packages/graphiql-react/src/explorer/components/section.tsx +++ b/packages/graphiql-react/src/explorer/components/section.tsx @@ -33,7 +33,8 @@ type ExplorerSectionProps = { | 'Possible Types' | 'Enum Values' | 'Deprecated Enum Values' - | 'Directives'; + | 'Directives' + | 'All Schema Types'; }; export function ExplorerSection(props: ExplorerSectionProps) { @@ -64,4 +65,5 @@ const TYPE_TO_ICON: Record = { 'Possible Types': TypeIcon, 'Root Types': RootTypeIcon, Type: TypeIcon, + 'All Schema Types': TypeIcon, };