-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch @graphiql/react to list object types
- Loading branch information
Showing
3 changed files
with
111 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
diff --git a/dist/index.es.js b/dist/index.es.js | ||
index 16265a7d42b108f3d1581da746bd876c8251bb59..3963e015534beceff58291df7e40b7e8247c5ecd 100644 | ||
--- a/dist/index.es.js | ||
+++ b/dist/index.es.js | ||
@@ -135,13 +135,11 @@ globalThis && globalThis.__asyncValues || function(o2) { | ||
}); | ||
}; | ||
} | ||
function settle(resolve, reject, d2, v2) { | ||
Promise.resolve(v2).then(function(v3) { | ||
resolve({ value: v3, done: d2 }); | ||
}, reject); | ||
} | ||
}; | ||
globalThis && globalThis.__asyncGenerator || function(thisArg, _arguments, generator) { | ||
if (!Symbol.asyncIterator) | ||
@@ -158,7 +156,6 @@ globalThis && globalThis.__asyncGenerator || function(thisArg, _arguments, gener | ||
}); | ||
}; | ||
} | ||
function resume(n2, v2) { | ||
try { | ||
step(g2[n2](v2)); | ||
@@ -166,24 +163,19 @@ globalThis && globalThis.__asyncGenerator || function(thisArg, _arguments, gener | ||
settle(q2[0][3], e2); | ||
} | ||
} | ||
function step(r2) { | ||
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q2[0][2], r2); | ||
} | ||
function fulfill(value3) { | ||
resume("next", value3); | ||
} | ||
function reject(value3) { | ||
resume("throw", value3); | ||
} | ||
function settle(f2, v2) { | ||
if (f2(v2), q2.shift(), q2.length) | ||
resume(q2[0][0], q2[0][1]); | ||
} | ||
}; | ||
function stringify(obj) { | ||
return JSON.stringify(obj, null, 2); | ||
@@ -8669,7 +8661,6 @@ function useDropdownItem(_ref4) { | ||
function listener() { | ||
mouseEventStarted.current = false; | ||
} | ||
}, []); | ||
return { | ||
data: { | ||
@@ -19643,6 +19634,9 @@ function SchemaDocumentation(props2) { | ||
const queryType = props2.schema.getQueryType(); | ||
const mutationType = (_b = (_a = props2.schema).getMutationType) == null ? void 0 : _b.call(_a); | ||
const subscriptionType = (_d = (_c = props2.schema).getSubscriptionType) == null ? void 0 : _d.call(_c); | ||
+ | ||
+ const typeMap = props2.schema.getTypeMap && props2.schema.getTypeMap(); | ||
+ | ||
return /* @__PURE__ */ jsxs(Fragment, { | ||
children: [/* @__PURE__ */ jsx(MarkdownContent, { | ||
type: "description", | ||
@@ -19671,6 +19665,29 @@ function SchemaDocumentation(props2) { | ||
type: subscriptionType | ||
})] | ||
})] | ||
+ }), !typeMap ? null : jsxs(ExplorerSection, { | ||
+ title: "Possible Types", | ||
+ children: [ | ||
+ Object.values(typeMap).map(typeValue => { | ||
+ const renderedKinds = [ | ||
+ "Interface", | ||
+ "Object", | ||
+ ].map(s => `GraphQL${s}Type`) | ||
+ | ||
+ const ctorName = typeValue.constructor.name | ||
+ const typeName = typeValue.name; | ||
+ | ||
+ const ignoredTypes = ['Query', 'Subscription']; | ||
+ | ||
+ if (renderedKinds.includes(ctorName) && !ignoredTypes.includes(typeName) && typeName[0] !== '_') { | ||
+ return jsxs("div", { | ||
+ children: [jsx(TypeLink, { type: typeValue })], | ||
+ }) | ||
+ } | ||
+ | ||
+ return null; | ||
+ }) | ||
+ ] | ||
})] | ||
}); | ||
} | ||
@@ -19811,7 +19828,6 @@ function fillInChunks(_ref4) { | ||
}); | ||
} | ||
} | ||
} | ||
__name(fillInChunks, "fillInChunks"); | ||
function defaultSanitize(string) { |
Oops, something went wrong.