Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test(x: $x)
}
`;
const variables1 = { x: 'Hello World' };
const variables2 = { x: 'Hello World' };
const request1: GraphQLRequest = {
query: document,
variables: variables1,
operationName: getOperationName(document),
};
const request2: GraphQLRequest = {
query: document,
variables: variables2,
operationName: getOperationName(document),
};
let called = 0;
const deduper = ApolloLink.from([
new DedupLink(),
new ApolloLink(() => {
return new Observable(observer => {
called += 1;
setTimeout(observer.complete.bind(observer));
});
}),
]);
execute(deduper, request1).subscribe({});
execute(deduper, request2).subscribe({});
expect(called).toBe(1);