Add integration tests for /metadata + fix relation deletion (#8706)
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
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
import { ASTNode, print } from 'graphql';
|
||||
import request from 'supertest';
|
||||
|
||||
type GraphqlOperation = {
|
||||
query: ASTNode;
|
||||
variables?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export const makeMetadataAPIRequest = (graphqlOperation: GraphqlOperation) => {
|
||||
const client = request(`http://localhost:${APP_PORT}`);
|
||||
|
||||
return client
|
||||
.post('/metadata')
|
||||
.set('Authorization', `Bearer ${ACCESS_TOKEN}`)
|
||||
.send({
|
||||
query: print(graphqlOperation.query),
|
||||
variables: graphqlOperation.variables || {},
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user