Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Observable(observer => {
graphql(
getResolver(operationType),
queryWithTypename,
rootValue,
context,
operation.variables
)
.then(data => {
observer.next({ data });
observer.complete();
})
.catch(err => {
if (err.name === 'AbortError') {
return;
}
if (err.result && err.result.errors) {
observer.next(err.result);
export const resolve = (
query: DocumentNode,
rootValue?: any,
contextValue?: any,
variableValues?: VariableMap
): Promise => {
return graphql(
getResolver(contextValue.operationType),
query,
rootValue,
contextValue,
variableValues
);
}
return new Observable(observer => {
graphql(
graphqlResolver,
queryWithTypename,
{},
{document: queryWithTypename, connectors},
operation.variables
)
.then(data => {
observer.next({ data });
observer.complete();
})
.catch(err => {
if (err.name === 'AbortError') {
return;
}
if (err.result && err.result.errors) {
observer.next(err.result);
new Observable(observer => {
graphql(
resolver,
queryWithTypename,
data,
requestContext,
variables,
resolverOptions,
)
.then(data => {
setContext({
restResponses: (context.restResponses || []).concat(
requestContext.responses,
),
});
observer.next({ data, errors });
observer.complete();
})
return async (query, variables, context, rootValue) => {
let errors = []
variables = createVariables(variables)
context = {
errors,
variables,
...context
}
let data = await graphql(resolver, query, rootValue, context, variables)
return { errors, data }
}
}
new Observable(subscriber => {
graphql(
resolver,
typeNamedQuery,
data,
this.resolverMap,
operation.variables
)
.then(resolvedData => {
subscriber.next({ data: resolvedData, ...rest })
subscriber.complete()
})
.catch(err => {
if (err.name === 'AbortError') return
if (err.result && err.result.errors) {
subscriber.next(err.result)
}
subscriber.error(err)
const callback = (snapshot: firebaseDatabase.DataSnapshot) => {
const root: ResolverRoot = {rootSnapshot: snapshot};
graphql(
queryResolver,
queryWithTypename,
root,
context,
operation.variables
)
.then(data => {
observer.next({ data });
})
.catch(err => {
if (err.name === 'AbortError') {
return;
}
if (err.result && err.result.errors) {
observer.next(err.result);
}