In this PR 1. Add integration tests for /metadata (master issue: https://github.com/twentyhq/twenty/issues/8719) 2. Fix relation deletion: index on "from" object was not deleted, impeding creation of a new relation between the same two objects A and B after relation between A and B was deleted
29 lines
737 B
TypeScript
29 lines
737 B
TypeScript
import gql from 'graphql-tag';
|
|
|
|
import { UpdateObjectPayload } from 'src/engine/metadata-modules/object-metadata/dtos/update-object.input';
|
|
|
|
type UpdateOneObjectFactoryParams = {
|
|
gqlFields: string;
|
|
input: {
|
|
idToUpdate: string;
|
|
updatePayload: UpdateObjectPayload;
|
|
};
|
|
};
|
|
|
|
export const updateOneObjectMetadataItemFactory = ({
|
|
gqlFields,
|
|
input,
|
|
}: UpdateOneObjectFactoryParams) => ({
|
|
query: gql`
|
|
mutation UpdateOneObjectMetadataItem($idToUpdate: UUID!, $updatePayload: UpdateObjectPayload!) {
|
|
updateOneObject(input: {id: $idToUpdate, update: $updatePayload}) {
|
|
${gqlFields}
|
|
}
|
|
}
|
|
`,
|
|
variables: {
|
|
idToUpdate: input.idToUpdate,
|
|
updatePayload: input.updatePayload,
|
|
},
|
|
});
|