Skip to content

Commit f34aa7f

Browse files
committed
chore: update dependencies and remove unused ky package
- Upgraded graphql-request to version 7.2.0 and related @graphql-codegen packages to their latest versions. - Removed the ky package and its associated fetch implementation from the client code, simplifying the GraphQL client setup.
1 parent e7e87fd commit f34aa7f

File tree

3 files changed

+8
-32
lines changed

3 files changed

+8
-32
lines changed

bun.lock

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@
44
"": {
55
"name": "@tdanks2000/anilist-wrapper",
66
"dependencies": {
7-
"graphql-request": "^7.1.2",
8-
"ky": "^1.8.1",
7+
"graphql-request": "^7.2.0",
98
},
109
"devDependencies": {
1110
"@biomejs/biome": "^2.1.3",
12-
"@graphql-codegen/cli": "^5.0.5",
11+
"@graphql-codegen/cli": "^5.0.7",
1312
"@graphql-codegen/typescript": "^4.1.6",
14-
"@graphql-codegen/typescript-graphql-request": "^6.2.0",
15-
"@graphql-codegen/typescript-operations": "^4.6.0",
13+
"@graphql-codegen/typescript-graphql-request": "^6.3.0",
14+
"@graphql-codegen/typescript-operations": "^4.6.1",
1615
"@types/bun": "latest",
1716
"bun-plugin-dts": "^0.3.0",
18-
"graphql": "^16.10.0",
17+
"graphql": "^16.11.0",
1918
"rimraf": "^6.0.1",
2019
},
2120
"peerDependencies": {
22-
"typescript": "^5",
21+
"typescript": "^5.8.3",
2322
},
2423
},
2524
},
@@ -540,8 +539,6 @@
540539

541540
"json5": ["[email protected]", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
542541

543-
"ky": ["[email protected]", "", {}, "sha512-XybQJ3d4Ea1kI27DoelE5ZCT3bSJlibYTtQuMsyzKox3TMyayw1asgQdl54WroAm+fIA3ZCr8zXW2RpR7qWVpA=="],
544-
545542
"lines-and-columns": ["[email protected]", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="],
546543

547544
"listr2": ["[email protected]", "", { "dependencies": { "cli-truncate": "^2.1.0", "colorette": "^2.0.16", "log-update": "^4.0.0", "p-map": "^4.0.0", "rfdc": "^1.3.0", "rxjs": "^7.5.5", "through": "^2.3.8", "wrap-ansi": "^7.0.0" }, "peerDependencies": { "enquirer": ">= 2.3.0 < 3" }, "optionalPeers": ["enquirer"] }, "sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA=="],

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"typescript": "^5.8.3"
7070
},
7171
"dependencies": {
72-
"graphql-request": "^7.2.0",
73-
"ky": "^1.8.2"
72+
"graphql-request": "^7.2.0"
7473
}
7574
}

src/client/index.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
11
import { GraphQLClient } from "graphql-request";
2-
import ky from "ky";
32
import { getSdk } from "../__generated__/anilist-sdk";
43

54
const ANILIST_API_URL = "https://graphql.anilist.co";
65

7-
const kyFetchCore = async (
8-
input: string | URL | Request,
9-
init?: RequestInit,
10-
) => {
11-
const response = await ky(input.toString(), {
12-
method: init?.method,
13-
headers: init?.headers,
14-
body: init?.body,
15-
credentials: "same-origin",
16-
throwHttpErrors: false,
17-
});
18-
return response;
19-
};
20-
21-
// Fix for graphql-request error preconnect missing when using ky instead of fetch
22-
const kyFetch: typeof fetch = Object.assign(kyFetchCore, {
23-
preconnect: (input: string | URL): void => {},
24-
});
25-
266
export const createClient = (token?: string) => {
277
const headers: Record<string, string> = {
288
"Content-Type": "application/json",
@@ -31,7 +11,7 @@ export const createClient = (token?: string) => {
3111
if (token) headers.Authorization = `Bearer ${token}`;
3212

3313
const client = new GraphQLClient(ANILIST_API_URL, {
34-
fetch: kyFetch,
14+
fetch,
3515
headers,
3616
});
3717

0 commit comments

Comments
 (0)