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