diff --git a/package.json b/package.json index 06919618..2513069b 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "eslintConfig": { "extends": "@bluzzi", "ignorePatterns": [ - "src/utils/request/graphql" + "src/utils/request/graphql/code-gen" ] }, "engines": { diff --git a/src/utils/request/graphql/graphql.ts b/src/utils/request/graphql/graphql.ts index eaa4462f..e3e22810 100644 --- a/src/utils/request/graphql/graphql.ts +++ b/src/utils/request/graphql/graphql.ts @@ -1,7 +1,8 @@ import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; import { print } from "graphql"; import { logger } from "#/utils/logger"; -import { Result, error, ok } from "rustic-error"; +import type { Result } from "rustic-error"; +import { error, ok } from "rustic-error"; import { env } from "#/configs/env"; export const gqlRequest = async(document: TypedDocumentNode, variables?: V): Promise> => { @@ -24,5 +25,5 @@ export const gqlRequest = async(document: TypedDocumentNode, variabl return error(Error("GraphQL request failed")); } - return ok((await response.json()).data) + return ok((await response.json() as { data: D }).data); }; \ No newline at end of file diff --git a/src/utils/request/graphql/index.ts b/src/utils/request/graphql/index.ts index d3c7cdfb..b60f2cff 100644 --- a/src/utils/request/graphql/index.ts +++ b/src/utils/request/graphql/index.ts @@ -1,6 +1,6 @@ -export * from "./graphql" +export * from "./graphql"; // Code gen: -export * from "./code-gen/gql" -export * from "./code-gen/graphql" -export * from "./code-gen/fragment-masking" \ No newline at end of file +export * from "./code-gen/gql"; +export * from "./code-gen/graphql"; +export * from "./code-gen/fragment-masking"; \ No newline at end of file