twenty/packages/twenty-server
Weiko 02618b3e6a Fix graphql query createMany resolver with nested relations (#7061)
Looks like insert() does not return foreign keys. We could eventually
call findMany after but it seems that's what save() is doing so I'm
replacing insert with save.
```typescript
/**
 * Flag to determine whether the entity that is being persisted
 * should be reloaded during the persistence operation.
 *
 * It will work only on databases which does not support RETURNING / OUTPUT statement.
 * Enabled by default.
 */
reload?: boolean;
```

Note: save() also does an upsert by default with no way to configure
that so if we want to keep that behaviour we will need to add a check
before
```typescript
if (args.upsert) {
    const existingRecords = await repository.findBy({
      id: Any(args.data.map((record) => record.id)),
    });
    ...
```

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-09-18 18:45:52 +02:00
..
@types
patches Improve demo seed (#7125) 2024-09-18 17:35:08 +02:00
scripts
src Fix graphql query createMany resolver with nested relations (#7061) 2024-09-18 18:45:52 +02:00
test Optimize metadata queries (#7013) 2024-09-13 19:42:22 +02:00
.env.example
.env.test
.eslintrc.cjs
.gitignore
.prettierignore
.prettierrc
.swcrc
jest.config.ts
nest-cli.json
package.json Improve demo seed (#7125) 2024-09-18 17:35:08 +02:00
project.json Optimize sync, reset, seed commands to flush cache and to use less memory (#7034) 2024-09-15 12:47:45 +02:00
tsconfig.build.json
tsconfig.json