[MM-54879] Goodbye, GraphQL -- Regards Webapp (#24850)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cd4d220a21
Коммит
760dfe41f9
@@ -41,15 +41,6 @@ describe('Client4', () => {
|
||||
expect(client.serverVersion).toEqual('5.3.0.5.3.0.abc123');
|
||||
});
|
||||
});
|
||||
|
||||
describe('fetchWithGraphQL', () => {
|
||||
test('Should have correct graphql url', async () => {
|
||||
const client = new Client4();
|
||||
client.setUrl('http://mattermost.example.com');
|
||||
|
||||
expect(client.getGraphQLUrl()).toEqual('http://mattermost.example.com/api/v5/graphql');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('ClientError', () => {
|
||||
|
||||
@@ -159,8 +159,6 @@ const PER_PAGE_DEFAULT = 60;
|
||||
export const DEFAULT_LIMIT_BEFORE = 30;
|
||||
export const DEFAULT_LIMIT_AFTER = 30;
|
||||
|
||||
const GRAPHQL_ENDPOINT = '/api/v5/graphql';
|
||||
|
||||
export default class Client4 {
|
||||
logToConsole = false;
|
||||
serverVersion = '';
|
||||
@@ -194,10 +192,6 @@ export default class Client4 {
|
||||
return this.getUrl() + baseUrl;
|
||||
}
|
||||
|
||||
getGraphQLUrl() {
|
||||
return `${this.url}${GRAPHQL_ENDPOINT}`;
|
||||
}
|
||||
|
||||
setUrl(url: string) {
|
||||
this.url = url;
|
||||
}
|
||||
@@ -4049,15 +4043,6 @@ export default class Client4 {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param query string query of graphQL, pass the json stringified version of the query
|
||||
* eg. const query = JSON.stringify({query: `{license, config}`, operationName: 'queryForLicenseAndConfig'});
|
||||
* client4.fetchWithGraphQL(query);
|
||||
*/
|
||||
fetchWithGraphQL = async <DataResponse>(query: string) => {
|
||||
return this.doFetch<DataResponse>(this.getGraphQLUrl(), {method: 'post', body: query});
|
||||
}
|
||||
|
||||
getCallsChannelState = (channelId: string) => {
|
||||
return this.doFetch<{enabled: boolean; id: string}>(
|
||||
`${this.url}/plugins/${'com.mattermost.calls'}/${channelId}`,
|
||||
|
||||
Ссылка в новой задаче
Block a user