mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 01:28:35 +02:00
Tweak
This commit is contained in:
@@ -67,17 +67,16 @@ export const GraphQLDocsExplorer = memo(function GraphQLDocsExplorer({
|
|||||||
if (showField === null) {
|
if (showField === null) {
|
||||||
setActiveItem(null);
|
setActiveItem(null);
|
||||||
} else {
|
} else {
|
||||||
|
const isRootParentType =
|
||||||
|
showField.parentType === 'Query' ||
|
||||||
|
showField.parentType === 'Mutation' ||
|
||||||
|
showField.parentType === 'Subscription';
|
||||||
walkTypeGraph(schema, null, (t, from) => {
|
walkTypeGraph(schema, null, (t, from) => {
|
||||||
const isRootParentType =
|
|
||||||
showField.parentType === 'Query' ||
|
|
||||||
showField.parentType === 'Mutation' ||
|
|
||||||
showField.parentType === 'Subscription';
|
|
||||||
if (
|
if (
|
||||||
showField.field === t.name &&
|
showField.field === t.name &&
|
||||||
// For input fields, CodeMirror seems to set parentType to the root type of the field they belong to.
|
// For input fields, CodeMirror seems to set parentType to the root type of the field they belong to.
|
||||||
(isRootParentType || from?.name === showField.parentType)
|
(isRootParentType || from?.name === showField.parentType)
|
||||||
) {
|
) {
|
||||||
console.log('SET FIELD', t, from);
|
|
||||||
setActiveItem(toExplorerItem(t, toExplorerItem(from, null)));
|
setActiveItem(toExplorerItem(t, toExplorerItem(from, null)));
|
||||||
return false;
|
return false;
|
||||||
} else if (showField.type === t.name && from?.name === showField.parentType) {
|
} else if (showField.type === t.name && from?.name === showField.parentType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user