UNPKG

@zendesk/laika

Version:

Test, mock, intercept and modify Apollo Client's operations — in both browser and unit tests!

8 lines 577 B
const checkOperationType = (definitions, type) => definitions.some((element) => element.kind === 'OperationDefinition' && element.operation === type); export const hasSubscriptionOperation = ( /** @type {Operation} */ { query }) => checkOperationType(query.definitions, 'subscription'); export const hasMutationOperation = ( /** @type {Operation} */ { query }) => checkOperationType(query.definitions, 'mutation'); export const hasQueryOperation = ( /** @type {Operation} */ { query }) => checkOperationType(query.definitions, 'query'); //# sourceMappingURL=hasOperation.js.map