mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 07:54:02 +00:00
update
This commit is contained in:
parent
c5c34f5b6a
commit
55ac094fc4
@ -17,6 +17,12 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
type GraphQLErrors = Array<{ message: string }>;
|
||||
type GraphQLResponse<T> = {
|
||||
data?: T;
|
||||
errors?: GraphQLErrors;
|
||||
};
|
||||
|
||||
export let globalAbortController = new AbortController();
|
||||
export function abortRequestsAndUpdate() {
|
||||
globalAbortController.abort();
|
||||
|
@ -14,14 +14,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { cancelToken } from "@/utils/cancelToken";
|
||||
import { httpQuery } from "./base";
|
||||
|
||||
async function fetchQuery(param: { queryStr: string; conditions: { [key: string]: unknown } }) {
|
||||
const response = await httpQuery({
|
||||
method: "post",
|
||||
json: { query: param.queryStr, variables: { ...param.conditions } },
|
||||
headers: { cancelToken: cancelToken() },
|
||||
headers: {},
|
||||
});
|
||||
if (response.errors) {
|
||||
response.errors = response.errors.map((e: { message: string }) => e.message).join(" ");
|
||||
|
@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { httpQuery } from "./base";
|
||||
import { cancelToken } from "@/utils/cancelToken";
|
||||
import * as app from "./query/app";
|
||||
import * as selector from "./query/selector";
|
||||
import * as dashboard from "./query/dashboard";
|
||||
@ -52,7 +51,7 @@ class Graphql {
|
||||
public params(variables: unknown) {
|
||||
return httpQuery({
|
||||
method: "post",
|
||||
headers: { cancelToken: cancelToken() },
|
||||
headers: {},
|
||||
json: {
|
||||
query: query[this.queryData],
|
||||
variables,
|
||||
|
Loading…
Reference in New Issue
Block a user