mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 02:45:08 +00:00
update
This commit is contained in:
parent
6e4090c165
commit
0ab7114b2d
@ -43,29 +43,24 @@ const query: { [key: string]: string } = {
|
||||
...asyncProfile,
|
||||
};
|
||||
class Graphql {
|
||||
private queryData = "";
|
||||
public query(queryData: string) {
|
||||
queryData = "";
|
||||
query(queryData: string) {
|
||||
this.queryData = queryData;
|
||||
return this;
|
||||
}
|
||||
public params(variables: unknown) {
|
||||
return httpQuery({
|
||||
async params(variables: unknown) {
|
||||
const response = await httpQuery({
|
||||
method: "post",
|
||||
headers: {},
|
||||
json: {
|
||||
query: query[this.queryData],
|
||||
variables,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.errors) {
|
||||
response.errors = response.errors.map((e: { message: string }) => e.message).join(" ");
|
||||
}
|
||||
return response;
|
||||
})
|
||||
.catch((err: Error) => {
|
||||
throw err;
|
||||
});
|
||||
});
|
||||
if (response.errors) {
|
||||
response.errors = response.errors.map((e: { message: string }) => e.message).join(" ");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user