UNPKG

@accounts/graphql-client

Version:

GraphQL client transport for accounts

14 lines 774 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.replaceUserFieldsFragment = void 0; var tslib_1 = require("tslib"); /** * Utility function used to modify the current query Document. * We remove the existing the user fragment and add the one provided by the user. * Graphql-codegen add the fragment as the end of the definition array. */ var replaceUserFieldsFragment = function (document, userFieldsFragment) { return tslib_1.__assign(tslib_1.__assign({}, document), { definitions: tslib_1.__spreadArray(tslib_1.__spreadArray([], document.definitions.slice(0, -1), true), userFieldsFragment.definitions, true) }); }; exports.replaceUserFieldsFragment = replaceUserFieldsFragment; //# sourceMappingURL=replace-user-fragment.js.map