summaryrefslogtreecommitdiff
path: root/alarm/node_modules/graphql/utilities/introspectionFromSchema.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
committerMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
commit2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (patch)
tree17848d95522dab25d3cdeb9c4a6450e2a234861f /alarm/node_modules/graphql/utilities/introspectionFromSchema.js
parent108525534c28013cfe1897c30e4565f9893f3766 (diff)
downloadpluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.gz
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.bz2
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.zip
Update
Diffstat (limited to 'alarm/node_modules/graphql/utilities/introspectionFromSchema.js')
-rw-r--r--alarm/node_modules/graphql/utilities/introspectionFromSchema.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/alarm/node_modules/graphql/utilities/introspectionFromSchema.js b/alarm/node_modules/graphql/utilities/introspectionFromSchema.js
new file mode 100644
index 0000000..3a1780e
--- /dev/null
+++ b/alarm/node_modules/graphql/utilities/introspectionFromSchema.js
@@ -0,0 +1,48 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.introspectionFromSchema = introspectionFromSchema;
+
+var _invariant = _interopRequireDefault(require("../jsutils/invariant.js"));
+
+var _parser = require("../language/parser.js");
+
+var _execute = require("../execution/execute.js");
+
+var _getIntrospectionQuery = require("./getIntrospectionQuery.js");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+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; }
+
+/**
+ * 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.
+ */
+function introspectionFromSchema(schema, options) {
+ var optionsWithDefaults = _objectSpread({
+ specifiedByUrl: true,
+ directiveIsRepeatable: true,
+ schemaDescription: true,
+ inputValueDeprecation: true
+ }, options);
+
+ var document = (0, _parser.parse)((0, _getIntrospectionQuery.getIntrospectionQuery)(optionsWithDefaults));
+ var result = (0, _execute.executeSync)({
+ schema: schema,
+ document: document
+ });
+ !result.errors && result.data || (0, _invariant.default)(0);
+ return result.data;
+}