Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const link = split(({query}) => {
const { kind, operation } = getMainDefinition(query);
return kind === 'OperationDefinition' && operation == 'subscription';
}, wsLink, authLink.concat(httpLink));
({ query }) => {
const { kind, operation } = getMainDefinition(
query
) as OperationDefinitionNode;
return kind === 'OperationDefinition' && operation === 'subscription';
},
wsLink,
({ query }) => {
const { kind, operation } = getMainDefinition(query);
return kind === 'OperationDefinition' && operation === 'subscription';
},
wsLink,
({ query }) => {
const { kind, operation } = getMainDefinition(query);
return kind === 'OperationDefinition' && operation === 'subscription';
},
wsLink,
({ query }) => {
const { kind, operation } = getMainDefinition(query);
return kind === 'OperationDefinition' && operation === 'subscription';
},
wsLink,
({ query }) => {
const { kind, operation }: any = getMainDefinition(query);
return kind === "OperationDefinition" && operation === "subscription";
},
wsLink,
const updateBaseWithDelta = (
logger,
baseQuery: BuildBaseQuerySyncOptions,
otherQuery: BuildQuerySyncOptions,
cache: DataProxy,
data: T,
cacheUpdates: (item: T) => QueryWithVariables[] = () => [] as QueryWithVariables[],
typename: string,
idField: string = 'id',
) => {
const updateLogger = logger.extend('update');
const opDefinition = getMainDefinition(otherQuery.query);
const { name: { value: opName }, alias: opAliasNode } = opDefinition.selectionSet.selections[0] as FieldNode;
const { value: opAlias = null } = opAliasNode || {};
const { kind, operation: graphqlOperation } = opDefinition as OperationDefinitionNode;
const isSubscription = kind === 'OperationDefinition' && graphqlOperation === 'subscription';
const [deltaOperationName] = isSubscription ? Object.keys(data) : [opAlias || opName];
const { [deltaOperationName]: records }: { [key: string]: any } = data;
const deltaRecords = [].concat(records) as T[];
if (!baseQuery || !baseQuery.query) {
updateLogger('No baseQuery provided');
} else {
const { query, variables } = baseQuery;
const operationName = getOperationFieldName(query);
({ query }) => {
const { kind, operation } = getMainDefinition(query);
return kind === 'OperationDefinition' && operation === 'subscription';
},
wsLink,
({ query }) => {
const { kind, operation } = getMainDefinition(query)
return kind === 'OperationDefinition' &&
operation === 'subscription'
},
wsLink,
({ query }) => {
const { kind, operation } = getMainDefinition(query)
return kind === 'OperationDefinition' && operation === 'subscription'
},
ws,