(schema: DbSchema, entity: string)
| 5 | import { SyncRequestContext } from "./context"; |
| 6 | |
| 7 | function getIdKeyForEntity(schema: DbSchema, entity: string) { |
| 8 | const entitySchema = schema.entities.find((e) => e.name === entity); |
| 9 | |
| 10 | if (!entitySchema) { |
| 11 | throw new Error(`Unknown entity ${entity}`); |
| 12 | } |
| 13 | |
| 14 | return entitySchema.idField; |
| 15 | } |
| 16 | |
| 17 | export async function performMutation( |
| 18 | context: SyncRequestContext, |