"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useSubgraphHelper = void 0;
var react_1 = require("react");
function useSubgraphHelper(query, entity) {
    return (0, react_1.useMemo)(function () {
        var failed = !!(query.called && !query.loading && !entity);
        return __assign(__assign({}, query), { failed: failed });
    }, [query, entity]);
}
exports.useSubgraphHelper = useSubgraphHelper;
//# sourceMappingURL=useSubgraphHelper.js.map