File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,23 @@ export default function TypeList(props: TypeListProps) {
2020
2121 let types : Array < GraphQLNamedType > ;
2222 if ( typeGraph . rootType == null ) {
23+ const { pageRanks } = typeGraph . schema . extensions ;
2324 types = Array . from ( typeGraph . entities . values ( ) )
2425 . map ( ( entity ) => entity . type )
2526 . filter ( ( type ) => isMatch ( type . name , filter ) ) ;
27+ types . sort ( ( a , b ) => {
28+ const rankA = pageRanks . get ( a . name ) ?? 0 ;
29+ const rankB = pageRanks . get ( b . name ) ?? 0 ;
30+ return rankA - rankB ;
31+ } ) ;
2632 } else {
2733 types = Array . from ( typeGraph . nodes . values ( ) ) . filter ( ( type ) =>
2834 isMatch ( type . name , filter ) ,
2935 ) ;
30- }
3136
32- // sort alphabetically but root is always be first
33- types . sort ( ( a , b ) => ( isRoot ( b ) ? 1 : a . name . localeCompare ( b . name ) ) ) ;
37+ // sort alphabetically but root is always be first
38+ types . sort ( ( a , b ) => ( isRoot ( b ) ? 1 : a . name . localeCompare ( b . name ) ) ) ;
39+ }
3440
3541 return (
3642 < div className = "doc-explorer-type-list" >
Original file line number Diff line number Diff line change @@ -136,6 +136,8 @@ export function getDot(typeGraph: TypeGraph): Graph {
136136 ranksep : 2.0 ,
137137 layout :
138138 typeGraph . rootType == null && graphDensity > 0.4 ? 'circo' : 'dot' ,
139+ // @ts -expect-error FIXME in dotviz
140+ root : schema . getQueryType ( ) ?. name ?? undefined ,
139141 } ,
140142 nodeAttributes : {
141143 fontsize : '16' ,
You can’t perform that action at this time.
0 commit comments