Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (parent[e] === undefined)
throw `Error: ${e} is not into the parent object!`;
newParent[e] = parent[e];
}
return newParent;
},
},
[typeWrapper]: {
[targetQuery]: (parent, args, context, info) => {
return targetType.resolve(parent, parent, context, info);
},
},
};
const extendedSchema = extendSchema(baseSchema, extension);
const newSchema = addResolversToSchema(extendedSchema, resolvers);
return newSchema;
}
return payload;
},
},
},
[subscriptionType]: {
updateType: (payload, args, context, info) => {
return payload.type;
},
payload: (payload, args, context, info) => {
return payload.apiObj;
},
},
};
const extendedSchema = extendSchema(baseSchema, extension);
const newSchema = addResolversToSchema(extendedSchema, resolvers);
newSchema._subscriptionType = newSchema._typeMap.Subscription;
return newSchema;
}