UNPKG

541 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.removeTempField = void 0;
4/**
5 * Removes "temp__" field from schema added
6 * because of "merge-graphql-schemas" library issues.
7 **/
8function removeTempField(schema) {
9 const queryTypeRef = schema.getQueryType();
10 if (!queryTypeRef) {
11 return schema;
12 }
13 const fields = queryTypeRef.getFields();
14 if (!fields) {
15 return schema;
16 }
17 delete fields['temp__'];
18 return schema;
19}
20exports.removeTempField = removeTempField;