summaryrefslogtreecommitdiff
path: root/includes/external/school/node_modules/graphql/utilities/introspectionFromSchema.mjs
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
committerMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
commit3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch)
tree75be5fba4368472fb11c8015aee026b2b9a71888 /includes/external/school/node_modules/graphql/utilities/introspectionFromSchema.mjs
parent8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff)
downloadpluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'includes/external/school/node_modules/graphql/utilities/introspectionFromSchema.mjs')
-rw-r--r--includes/external/school/node_modules/graphql/utilities/introspectionFromSchema.mjs36
1 files changed, 36 insertions, 0 deletions
diff --git a/includes/external/school/node_modules/graphql/utilities/introspectionFromSchema.mjs b/includes/external/school/node_modules/graphql/utilities/introspectionFromSchema.mjs
new file mode 100644
index 0000000..ad387eb
--- /dev/null
+++ b/includes/external/school/node_modules/graphql/utilities/introspectionFromSchema.mjs
@@ -0,0 +1,36 @@
+function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
+
+function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
+
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
+import invariant from "../jsutils/invariant.mjs";
+import { parse } from "../language/parser.mjs";
+import { executeSync } from "../execution/execute.mjs";
+import { getIntrospectionQuery } from "./getIntrospectionQuery.mjs";
+/**
+ * Build an IntrospectionQuery from a GraphQLSchema
+ *
+ * IntrospectionQuery is useful for utilities that care about type and field
+ * relationships, but do not need to traverse through those relationships.
+ *
+ * This is the inverse of buildClientSchema. The primary use case is outside
+ * of the server context, for instance when doing schema comparisons.
+ */
+
+export function introspectionFromSchema(schema, options) {
+ var optionsWithDefaults = _objectSpread({
+ specifiedByUrl: true,
+ directiveIsRepeatable: true,
+ schemaDescription: true,
+ inputValueDeprecation: true
+ }, options);
+
+ var document = parse(getIntrospectionQuery(optionsWithDefaults));
+ var result = executeSync({
+ schema: schema,
+ document: document
+ });
+ !result.errors && result.data || invariant(0);
+ return result.data;
+}