Files
twenty/packages/twenty-server/test/integration/graphql/utils/perform-create-many-operation.utils.ts
T
GuillimandGitHub 5daef28328 Morph INPUT integration test (#16464)
- Adding a new target to the test setup suite
- We add the MORPH_RELATION to the list of types we wanna test in the
current test suites

Important:
I noticed the REST API was not working well with Morph relations. I
created [an
issue](https://github.com/twentyhq/core-team-issues/issues/2002) to work
on that. Within that timeframe, I `xdescribed` the related tests

Fixes https://github.com/twentyhq/core-team-issues/issues/1327
2025-12-11 10:10:30 +01:00

26 lines
801 B
TypeScript

import { createManyOperationFactory } from 'test/integration/graphql/utils/create-many-operation-factory.util';
import { makeGraphqlAPIRequest } from 'test/integration/graphql/utils/make-graphql-api-request.util';
import { capitalize } from 'twenty-shared/utils';
import { v4 } from 'uuid';
export const performCreateManyOperation = async (
objectMetadataSingularName: string,
objectMetadataPluralName: string,
gqlFields: string,
data: object[],
) => {
const response = await makeGraphqlAPIRequest(
createManyOperationFactory({
objectMetadataSingularName,
objectMetadataPluralName,
gqlFields,
data: data.map((item) => ({
id: v4(),
...item,
})),
}),
);
return response.body.data[`create${capitalize(objectMetadataPluralName)}`];
};