Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
const context: TargetContext = {
types: [],
interfaces: [],
inputFields: [],
filterFields: [],
queries: [],
mutations: [],
subscriptions: [],
relations
}
const objectTypes = filterObjectTypes(inputContext);
const interfaceTypes = filterInterfaceTypes(inputContext);
context.types = objectTypes.map((t: InputModelTypeContext) => {
return {
"name": t.name,
"interfaces": t.interfaces.map((i: InputInterfaceType) => i.type),
"fields": [...t.fields.filter((f: InputModelFieldContext, ) => !f.isType).map(maybeNullField), ...new Set(relations.filter((r: RelationInfo) => r.name === t.name).map((r: RelationInfo) => r.relation))]
}
});
context.interfaces = interfaceTypes.map((t: InputModelTypeContext) => {
return {
"name": t.name,
"fields": [...t.fields.filter((f: InputModelFieldContext, ) => !f.isType).map(maybeNullField), ...new Set(relations.filter((r: RelationInfo) => r.name === t.name).map((r: RelationInfo) => r.relation))]
}
});