mirror of
https://github.com/twentyhq/twenty
synced 2026-04-21 13:37:22 +00:00
In this PR - closing https://github.com/twentyhq/core-team-issues/issues/313 - adding permission gates on workspace settings and security settings - adding integration tests for each of the protected setting and security
19 lines
515 B
TypeScript
19 lines
515 B
TypeScript
import { ASTNode, print } from 'graphql';
|
|
import request from 'supertest';
|
|
|
|
type GraphqlOperation = {
|
|
query: ASTNode;
|
|
variables?: Record<string, unknown>;
|
|
};
|
|
|
|
export const makeGraphqlAPIRequest = (graphqlOperation: GraphqlOperation) => {
|
|
const client = request(`http://localhost:${APP_PORT}`);
|
|
|
|
return client
|
|
.post('/graphql')
|
|
.set('Authorization', `Bearer ${ADMIN_ACCESS_TOKEN}`)
|
|
.send({
|
|
query: print(graphqlOperation.query),
|
|
variables: graphqlOperation.variables || {},
|
|
});
|
|
};
|