Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get: host => ({ query = host.query, variables = host.variables } = {}) => {
if (!hasAllVariables({ query, variables })) return;
host.observableQuery = host.watchQuery(host, { query });
const error = onError(host);
const next = onNext(host);
return host.observableQuery.subscribe({ error, next });
},
};
get: host => ({
fetchPolicy = host.fetchPolicy,
query = host.subscription,
variables = host.variables,
} = {}) => {
if (!hasAllVariables({ query, variables })) return;
const observable = host.client.subscribe({ fetchPolicy, query, variables });
const error = host.nextError(host);
const next = host.nextData(host);
host.observable = observable;
return observable.subscribe({ error, next });
},
};