"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isMutationOperation = isMutationOperation;
exports.isQueryOperation = isQueryOperation;
exports.isSubscriptionOperation = isSubscriptionOperation;
const internal_1 = require("@apollo/client/utilities/internal");
function isOperation(document, operation) {
    return (0, internal_1.getOperationDefinition)(document)?.operation === operation;
}
/**
 * Determine if a document is a mutation document.
 *
 * @param document - The GraphQL document to check
 *
 * @since 3.8.0
 */
function isMutationOperation(document) {
    return isOperation(document, "mutation");
}
/**
 * Determine if a document is a query document.
 *
 * @param document - The GraphQL document to check
 *
 * @since 3.8.0
 */
function isQueryOperation(document) {
    return isOperation(document, "query");
}
/**
 * Determine if a document is a subscription document.
 *
 * @param document - The GraphQL document to check
 *
 * @since 3.8.0
 */
function isSubscriptionOperation(document) {
    return isOperation(document, "subscription");
}
//# sourceMappingURL=operations.cjs.map
