import { getOperationDefinition } from "@apollo/client/utilities/internal";
function isOperation(document, operation) {
    return getOperationDefinition(document)?.operation === operation;
}
/**
 * Determine if a document is a mutation document.
 *
 * @param document - The GraphQL document to check
 *
 * @since 3.8.0
 */
export 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
 */
export 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
 */
export function isSubscriptionOperation(document) {
    return isOperation(document, "subscription");
}
//# sourceMappingURL=operations.js.map
