diff --git a/package.json b/package.json index 1d1042e05..d1dad6059 100644 --- a/package.json +++ b/package.json @@ -112,8 +112,8 @@ "@types/express": "^4.17.21", "@types/json-bigint": "^1.0.4", "@types/node": "^20.14.9", - "@typescript-eslint/eslint-plugin": "^7.14.1", - "@typescript-eslint/parser": "^7.14.1", + "@typescript-eslint/eslint-plugin": "^7.15.0", + "@typescript-eslint/parser": "^7.15.0", "apollo-server-express": "^3.13.0", "body-parser": "^1.20.2", "doctoc": "^2.2.1", @@ -123,7 +123,7 @@ "eslint-plugin-deprecation": "^3.0.0", "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-tsdoc": "^0.3.0", "eslint-typescript": "^1.1.0", "express": "^4.19.2", @@ -132,14 +132,14 @@ "graphql-scalars": "^1.23.0", "graphql-tag": "^2.12.6", "graphql-upload-minimal": "^1.6.1", - "graphql-yoga": "^5.5.0", + "graphql-yoga": "^5.6.0", "jsdom": "^24.1.0", "json-bigint": "^1.0.0", "publint": "^0.2.8", - "tsx": "^4.16.0", - "type-fest": "^4.20.1", - "typescript": "^5.5.2", - "typescript-eslint": "^7.14.1", + "tsx": "^4.16.2", + "type-fest": "^4.21.0", + "typescript": "^5.5.3", + "typescript-eslint": "^7.15.0", "vitest": "^1.6.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a925055c1..42a921f19 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,11 +58,11 @@ importers: specifier: ^20.14.9 version: 20.14.9 '@typescript-eslint/eslint-plugin': - specifier: ^7.14.1 - version: 7.14.1(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0)(typescript@5.5.2) + specifier: ^7.15.0 + version: 7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0)(typescript@5.5.3) '@typescript-eslint/parser': - specifier: ^7.14.1 - version: 7.14.1(eslint@9.6.0)(typescript@5.5.2) + specifier: ^7.15.0 + version: 7.15.0(eslint@9.6.0)(typescript@5.5.3) apollo-server-express: specifier: ^3.13.0 version: 3.13.0(express@4.19.2)(graphql@16.9.0) @@ -80,10 +80,10 @@ importers: version: 9.6.0 eslint-config-prisma: specifier: ^0.6.0 - version: 0.6.0(@typescript-eslint/eslint-plugin@7.14.1(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0)(typescript@5.5.2))(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint-plugin-deprecation@3.0.0(eslint@9.6.0)(typescript@5.5.2))(eslint-plugin-only-warn@1.1.0)(eslint-plugin-prefer-arrow@1.2.3(eslint@9.6.0))(eslint-plugin-tsdoc@0.3.0)(eslint@9.6.0)(typescript@5.5.2) + version: 0.6.0(@typescript-eslint/eslint-plugin@7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0)(typescript@5.5.3))(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint-plugin-deprecation@3.0.0(eslint@9.6.0)(typescript@5.5.3))(eslint-plugin-only-warn@1.1.0)(eslint-plugin-prefer-arrow@1.2.3(eslint@9.6.0))(eslint-plugin-tsdoc@0.3.0)(eslint@9.6.0)(typescript@5.5.3) eslint-plugin-deprecation: specifier: ^3.0.0 - version: 3.0.0(eslint@9.6.0)(typescript@5.5.2) + version: 3.0.0(eslint@9.6.0)(typescript@5.5.3) eslint-plugin-only-warn: specifier: ^1.1.0 version: 1.1.0 @@ -91,8 +91,8 @@ importers: specifier: ^1.2.3 version: 1.2.3(eslint@9.6.0) eslint-plugin-simple-import-sort: - specifier: ^12.1.0 - version: 12.1.0(eslint@9.6.0) + specifier: ^12.1.1 + version: 12.1.1(eslint@9.6.0) eslint-plugin-tsdoc: specifier: ^0.3.0 version: 0.3.0 @@ -118,7 +118,7 @@ importers: specifier: ^1.6.1 version: 1.6.1(graphql@16.9.0) graphql-yoga: - specifier: ^5.5.0 + specifier: ^5.6.0 version: 5.6.0(graphql@16.9.0) jsdom: specifier: ^24.1.0 @@ -130,17 +130,17 @@ importers: specifier: ^0.2.8 version: 0.2.8 tsx: - specifier: ^4.16.0 + specifier: ^4.16.2 version: 4.16.2 type-fest: - specifier: ^4.20.1 - version: 4.20.1 + specifier: ^4.21.0 + version: 4.21.0 typescript: - specifier: ^5.5.2 - version: 5.5.2 + specifier: ^5.5.3 + version: 5.5.3 typescript-eslint: - specifier: ^7.14.1 - version: 7.14.1(eslint@9.6.0)(typescript@5.5.2) + specifier: ^7.15.0 + version: 7.15.0(eslint@9.6.0)(typescript@5.5.3) vitest: specifier: ^1.6.0 version: 1.6.0(@types/node@20.14.9)(happy-dom@14.12.3)(jsdom@24.1.0) @@ -215,6 +215,7 @@ packages: '@arethetypeswrong/cli@0.16.0': resolution: {integrity: sha512-Vn3ihwlhueIvyJ6V3PKS8zwll9TId5Radvl3GS58ITimafJNoYRribKCoymYFiFS3jH6TspM30KhhiMvnMGvNQ==} engines: {node: '>=18'} + deprecated: Version 0.16.0 breaks --pack functionality hasBin: true '@arethetypeswrong/core@0.15.1': @@ -907,8 +908,8 @@ packages: typescript: optional: true - '@typescript-eslint/eslint-plugin@7.14.1': - resolution: {integrity: sha512-aAJd6bIf2vvQRjUG3ZkNXkmBpN+J7Wd0mfQiiVCJMu9Z5GcZZdcc0j8XwN/BM97Fl7e3SkTXODSk4VehUv7CGw==} + '@typescript-eslint/eslint-plugin@7.15.0': + resolution: {integrity: sha512-uiNHpyjZtFrLwLDpHnzaDlP3Tt6sGMqTCiqmxaN4n4RP0EfYZDODJyddiFDF44Hjwxr5xAcaYxVKm9QKQFJFLA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -934,8 +935,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@7.14.1': - resolution: {integrity: sha512-8lKUOebNLcR0D7RvlcloOacTOWzOqemWEWkKSVpMZVF/XVcwjPR+3MD08QzbW9TCGJ+DwIc6zUSGZ9vd8cO1IA==} + '@typescript-eslint/parser@7.15.0': + resolution: {integrity: sha512-k9fYuQNnypLFcqORNClRykkGOMOj+pV6V91R4GO/l1FDGwpqmSwoOQrOHo3cGaH63e+D3ZiCAOsuS/D2c99j/A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -948,12 +949,12 @@ packages: resolution: {integrity: sha512-5RFjdA/ain/MDUHYXdF173btOKncIrLuBmA9s6FJhzDrRAyVSA+70BHg0/MW6TE+UiKVyRtX91XpVS0gVNwVDQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/scope-manager@7.14.1': - resolution: {integrity: sha512-gPrFSsoYcsffYXTOZ+hT7fyJr95rdVe4kGVX1ps/dJ+DfmlnjFN/GcMxXcVkeHDKqsq6uAcVaQaIi3cFffmAbA==} + '@typescript-eslint/scope-manager@7.15.0': + resolution: {integrity: sha512-Q/1yrF/XbxOTvttNVPihxh1b9fxamjEoz2Os/Pe38OHwxC24CyCqXxGTOdpb4lt6HYtqw9HetA/Rf6gDGaMPlw==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/type-utils@7.14.1': - resolution: {integrity: sha512-/MzmgNd3nnbDbOi3LfasXWWe292+iuo+umJ0bCCMCPc1jLO/z2BQmWUUUXvXLbrQey/JgzdF/OV+I5bzEGwJkQ==} + '@typescript-eslint/type-utils@7.15.0': + resolution: {integrity: sha512-SkgriaeV6PDvpA6253PDVep0qCqgbO1IOBiycjnXsszNTVQe5flN5wR5jiczoEoDEnAqYFSFFc9al9BSGVltkg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -966,8 +967,8 @@ packages: resolution: {integrity: sha512-dU/pKBUpehdEqYuvkojmlv0FtHuZnLXFBn16zsDmlFF3LXkOpkAQ2vrKc3BidIIve9EMH2zfTlxqw9XM0fFN5w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/types@7.14.1': - resolution: {integrity: sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg==} + '@typescript-eslint/types@7.15.0': + resolution: {integrity: sha512-aV1+B1+ySXbQH0pLK0rx66I3IkiZNidYobyfn0WFsdGhSXw+P3YOqeTq5GED458SfB24tg+ux3S+9g118hjlTw==} engines: {node: ^18.18.0 || >=20.0.0} '@typescript-eslint/typescript-estree@5.0.0': @@ -979,8 +980,8 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@7.14.1': - resolution: {integrity: sha512-k5d0VuxViE2ulIO6FbxxSZaxqDVUyMbXcidC8rHvii0I56XZPv8cq+EhMns+d/EVIL41sMXqRbK3D10Oza1bbA==} + '@typescript-eslint/typescript-estree@7.15.0': + resolution: {integrity: sha512-gjyB/rHAopL/XxfmYThQbXbzRMGhZzGw6KpcMbfe8Q3nNQKStpxnUKeXb0KiN/fFDR42Z43szs6rY7eHk0zdGQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -988,8 +989,8 @@ packages: typescript: optional: true - '@typescript-eslint/utils@7.14.1': - resolution: {integrity: sha512-CMmVVELns3nak3cpJhZosDkm63n+DwBlDX8g0k4QUa9BMnF+lH2lr3d130M1Zt1xxmB3LLk3NV7KQCq86ZBBhQ==} + '@typescript-eslint/utils@7.15.0': + resolution: {integrity: sha512-hfDMDqaqOqsUVGiEPSMLR/AjTSCsmJwjpKkYQRo1FNbmW4tBwBspYDwO9eh7sKSTwMQgBw9/T4DHudPaqshRWA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -998,8 +999,8 @@ packages: resolution: {integrity: sha512-yRyd2++o/IrJdyHuYMxyFyBhU762MRHQ/bAGQeTnN3pGikfh+nEmM61XTqaDH1XDp53afZ+waXrk0ZvenoZ6xw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/visitor-keys@7.14.1': - resolution: {integrity: sha512-Crb+F75U1JAEtBeQGxSKwI60hZmmzaqA3z9sYsVm8X7W5cwLEm5bRe0/uXS6+MR/y8CVpKSR/ontIAIEPFcEkA==} + '@typescript-eslint/visitor-keys@7.15.0': + resolution: {integrity: sha512-Hqgy/ETgpt2L5xueA/zHHIl4fJI2O4XUE9l4+OIfbJIRSnTJb/QscncdqqZzofQegIJugRIF57OJea1khw2SDw==} engines: {node: ^18.18.0 || >=20.0.0} '@vitest/expect@1.6.0': @@ -1046,8 +1047,8 @@ packages: resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} engines: {node: '>=0.4.0'} - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} + acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} engines: {node: '>=0.4.0'} hasBin: true @@ -1686,8 +1687,8 @@ packages: resolution: {integrity: sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==} engines: {node: '>=6'} - eslint-plugin-simple-import-sort@12.1.0: - resolution: {integrity: sha512-Y2fqAfC11TcG/WP3TrI1Gi3p3nc8XJyEOJYHyEPEGI/UAgNx6akxxlX74p7SbAQdLcgASKhj8M0GKvH3vq/+ig==} + eslint-plugin-simple-import-sort@12.1.1: + resolution: {integrity: sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==} peerDependencies: eslint: '>=5.0.0' @@ -2259,8 +2260,8 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - isomorphic-git@1.26.3: - resolution: {integrity: sha512-NVicJz3RvUhllSSZnCVtTOqWhxlMln5OD3mh00334wCYhiMDuMiYsNJqs3sCHL7oXiv1tP93jMaQTdN7DkPCOg==} + isomorphic-git@1.26.5: + resolution: {integrity: sha512-ULVEp0RdDpVy3aYgjhODfrC9Q/rdJBcBkeJEdC02AlLp9gDY449qzUnPHJJ8v7MFCbD2lAnIwr6CgQI+p3/5Aw==} engines: {node: '>=12'} hasBin: true @@ -2749,8 +2750,8 @@ packages: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} - pkg-types@1.1.1: - resolution: {integrity: sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==} + pkg-types@1.1.3: + resolution: {integrity: sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA==} pkg-up@2.0.0: resolution: {integrity: sha512-fjAPuiws93rm7mPUu21RdBnkeZNrbfCFCwfAhPWY+rR3zG0ubpe5cEReHOw5fIbfmsxEV/g2kSxGTATY3Bpnwg==} @@ -2760,8 +2761,8 @@ packages: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} - postcss@8.4.38: - resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} + postcss@8.4.39: + resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -3204,8 +3205,8 @@ packages: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} - type-fest@4.20.1: - resolution: {integrity: sha512-R6wDsVsoS9xYOpy8vgeBlqpdOyzJ12HNfQhC/aAKWM3YoCV9TtunJzh/QpkMgeDhkoynDcw5f1y+qF9yc/HHyg==} + type-fest@4.21.0: + resolution: {integrity: sha512-ADn2w7hVPcK6w1I0uWnM//y1rLXZhzB9mr0a3OirzclKF1Wp6VzevUmzz/NRAWunOT6E8HrnpGY7xOfc6K57fA==} engines: {node: '>=16'} type-is@1.6.18: @@ -3232,8 +3233,8 @@ packages: resolution: {integrity: sha512-8WbVAQAUlENo1q3c3zZYuy5k9VzBQvp8AX9WOtbvyWlLM1v5JaSRmjubLjzHF4JFtptjH/5c/i95yaElvcjC0A==} engines: {node: '>= 0.4'} - typescript-eslint@7.14.1: - resolution: {integrity: sha512-Eo1X+Y0JgGPspcANKjeR6nIqXl4VL5ldXLc15k4m9upq+eY5fhU2IueiEZL6jmHrKH8aCfbIvM/v3IrX5Hg99w==} + typescript-eslint@7.15.0: + resolution: {integrity: sha512-Ta40FhMXBCwHura4X4fncaCVkVcnJ9jnOq5+Lp4lN8F4DzHZtOwZdRvVBiNUGznUDHPwdGnrnwxmUOU2fFQqFA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -3252,8 +3253,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} + typescript@5.5.3: + resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} engines: {node: '>=14.17'} hasBin: true @@ -3362,8 +3363,8 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite@5.3.2: - resolution: {integrity: sha512-6lA7OBHBlXUxiJxbO5aAY2fsHHzDr1q7DvXYnyZycRs2Dz+dXBWuhpWHvmljTRTpQC2uvGmUFFkSHF2vGo90MA==} + vite@5.3.3: + resolution: {integrity: sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -3485,8 +3486,8 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - ws@8.17.1: - resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} + ws@8.18.0: + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -3516,8 +3517,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.1.0: - resolution: {integrity: sha512-cMojmlnwkAgIXqga+2sXshlgrrcI0QEPJ5n58pEvtuFo4PaekfomlCudArDD7hj8Hkswjl0/x4eu4q+Xa0WFgQ==} + yocto-queue@1.1.1: + resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} zod@3.23.8: @@ -3916,7 +3917,7 @@ snapshots: string-length: 6.0.0 strip-ansi: 7.1.0 ts-toolbelt: 9.6.0 - type-fest: 4.20.1 + type-fest: 4.21.0 zod: 3.23.8 '@molt/types@0.2.0': @@ -4356,21 +4357,21 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@7.14.1(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0)(typescript@5.5.2)': + '@typescript-eslint/eslint-plugin@7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0)(typescript@5.5.3)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.14.1(eslint@9.6.0)(typescript@5.5.2) - '@typescript-eslint/scope-manager': 7.14.1 - '@typescript-eslint/type-utils': 7.14.1(eslint@9.6.0)(typescript@5.5.2) - '@typescript-eslint/utils': 7.14.1(eslint@9.6.0)(typescript@5.5.2) - '@typescript-eslint/visitor-keys': 7.14.1 + '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/scope-manager': 7.15.0 + '@typescript-eslint/type-utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 7.15.0 eslint: 9.6.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.5.2) + ts-api-utils: 1.3.0(typescript@5.5.3) optionalDependencies: - typescript: 5.5.2 + typescript: 5.5.3 transitivePeerDependencies: - supports-color @@ -4399,16 +4400,16 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2)': + '@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3)': dependencies: - '@typescript-eslint/scope-manager': 7.14.1 - '@typescript-eslint/types': 7.14.1 - '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.5.2) - '@typescript-eslint/visitor-keys': 7.14.1 + '@typescript-eslint/scope-manager': 7.15.0 + '@typescript-eslint/types': 7.15.0 + '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 7.15.0 debug: 4.3.5 eslint: 9.6.0 optionalDependencies: - typescript: 5.5.2 + typescript: 5.5.3 transitivePeerDependencies: - supports-color @@ -4417,26 +4418,26 @@ snapshots: '@typescript-eslint/types': 5.0.0 '@typescript-eslint/visitor-keys': 5.0.0 - '@typescript-eslint/scope-manager@7.14.1': + '@typescript-eslint/scope-manager@7.15.0': dependencies: - '@typescript-eslint/types': 7.14.1 - '@typescript-eslint/visitor-keys': 7.14.1 + '@typescript-eslint/types': 7.15.0 + '@typescript-eslint/visitor-keys': 7.15.0 - '@typescript-eslint/type-utils@7.14.1(eslint@9.6.0)(typescript@5.5.2)': + '@typescript-eslint/type-utils@7.15.0(eslint@9.6.0)(typescript@5.5.3)': dependencies: - '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.5.2) - '@typescript-eslint/utils': 7.14.1(eslint@9.6.0)(typescript@5.5.2) + '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.5.3) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) debug: 4.3.5 eslint: 9.6.0 - ts-api-utils: 1.3.0(typescript@5.5.2) + ts-api-utils: 1.3.0(typescript@5.5.3) optionalDependencies: - typescript: 5.5.2 + typescript: 5.5.3 transitivePeerDependencies: - supports-color '@typescript-eslint/types@5.0.0': {} - '@typescript-eslint/types@7.14.1': {} + '@typescript-eslint/types@7.15.0': {} '@typescript-eslint/typescript-estree@5.0.0(typescript@4.4.3)': dependencies: @@ -4452,27 +4453,27 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.14.1(typescript@5.5.2)': + '@typescript-eslint/typescript-estree@7.15.0(typescript@5.5.3)': dependencies: - '@typescript-eslint/types': 7.14.1 - '@typescript-eslint/visitor-keys': 7.14.1 + '@typescript-eslint/types': 7.15.0 + '@typescript-eslint/visitor-keys': 7.15.0 debug: 4.3.5 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.5.2) + ts-api-utils: 1.3.0(typescript@5.5.3) optionalDependencies: - typescript: 5.5.2 + typescript: 5.5.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.14.1(eslint@9.6.0)(typescript@5.5.2)': + '@typescript-eslint/utils@7.15.0(eslint@9.6.0)(typescript@5.5.3)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0) - '@typescript-eslint/scope-manager': 7.14.1 - '@typescript-eslint/types': 7.14.1 - '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.5.2) + '@typescript-eslint/scope-manager': 7.15.0 + '@typescript-eslint/types': 7.15.0 + '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.5.3) eslint: 9.6.0 transitivePeerDependencies: - supports-color @@ -4483,9 +4484,9 @@ snapshots: '@typescript-eslint/types': 5.0.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.14.1': + '@typescript-eslint/visitor-keys@7.15.0': dependencies: - '@typescript-eslint/types': 7.14.1 + '@typescript-eslint/types': 7.15.0 eslint-visitor-keys: 3.4.3 '@vitest/expect@1.6.0': @@ -4542,15 +4543,15 @@ snapshots: mime-types: 2.1.35 negotiator: 0.6.3 - acorn-jsx@5.3.2(acorn@8.12.0): + acorn-jsx@5.3.2(acorn@8.12.1): dependencies: - acorn: 8.12.0 + acorn: 8.12.1 acorn-walk@8.3.3: dependencies: - acorn: 8.12.0 + acorn: 8.12.1 - acorn@8.12.0: {} + acorn@8.12.1: {} agent-base@7.1.1: dependencies: @@ -5048,7 +5049,7 @@ snapshots: common-tags: 1.8.2 debug: 4.3.5 fs-jetpack: 3.2.0 - isomorphic-git: 1.26.3 + isomorphic-git: 1.26.5 parse-git-config: 3.0.0 parse-github-url: 1.0.3 request: 2.88.2 @@ -5198,21 +5199,21 @@ snapshots: dependencies: eslint: 9.6.0 - eslint-config-prisma@0.6.0(@typescript-eslint/eslint-plugin@7.14.1(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0)(typescript@5.5.2))(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint-plugin-deprecation@3.0.0(eslint@9.6.0)(typescript@5.5.2))(eslint-plugin-only-warn@1.1.0)(eslint-plugin-prefer-arrow@1.2.3(eslint@9.6.0))(eslint-plugin-tsdoc@0.3.0)(eslint@9.6.0)(typescript@5.5.2): + eslint-config-prisma@0.6.0(@typescript-eslint/eslint-plugin@7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0)(typescript@5.5.3))(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint-plugin-deprecation@3.0.0(eslint@9.6.0)(typescript@5.5.3))(eslint-plugin-only-warn@1.1.0)(eslint-plugin-prefer-arrow@1.2.3(eslint@9.6.0))(eslint-plugin-tsdoc@0.3.0)(eslint@9.6.0)(typescript@5.5.3): dependencies: '@eslint/js': 9.6.0 '@types/eslint-config-prettier': 6.11.3 '@types/eslint__js': 8.42.3 - '@typescript-eslint/eslint-plugin': 7.14.1(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0)(typescript@5.5.2) - '@typescript-eslint/parser': 7.14.1(eslint@9.6.0)(typescript@5.5.2) - '@typescript-eslint/utils': 7.14.1(eslint@9.6.0)(typescript@5.5.2) + '@typescript-eslint/eslint-plugin': 7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) eslint: 9.6.0 eslint-config-prettier: 9.1.0(eslint@9.6.0) - eslint-plugin-deprecation: 3.0.0(eslint@9.6.0)(typescript@5.5.2) + eslint-plugin-deprecation: 3.0.0(eslint@9.6.0)(typescript@5.5.3) eslint-plugin-only-warn: 1.1.0 eslint-plugin-prefer-arrow: 1.2.3(eslint@9.6.0) eslint-plugin-tsdoc: 0.3.0 - typescript-eslint: 7.14.1(eslint@9.6.0)(typescript@5.5.2) + typescript-eslint: 7.15.0(eslint@9.6.0)(typescript@5.5.3) transitivePeerDependencies: - supports-color - typescript @@ -5220,7 +5221,7 @@ snapshots: eslint-config-standard@13.0.1(eslint-plugin-import@2.23.3(@typescript-eslint/parser@5.0.0(eslint@9.6.0)(typescript@4.4.3))(eslint-import-resolver-typescript@2.5.0)(eslint@9.6.0))(eslint-plugin-node@11.1.0(eslint@9.6.0))(eslint-plugin-promise@4.2.1)(eslint-plugin-standard@4.0.0(eslint@9.6.0))(eslint@9.6.0): dependencies: eslint: 9.6.0 - eslint-plugin-import: 2.23.3(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0) + eslint-plugin-import: 2.23.3(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0) eslint-plugin-node: 11.1.0(eslint@9.6.0) eslint-plugin-promise: 4.2.1 eslint-plugin-standard: 4.0.0(eslint@9.6.0) @@ -5237,7 +5238,7 @@ snapshots: dependencies: debug: 4.3.5 eslint: 9.6.0 - eslint-plugin-import: 2.23.3(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0) + eslint-plugin-import: 2.23.3(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0) glob: 7.2.3 is-glob: 4.0.3 resolve: 1.22.8 @@ -5245,23 +5246,23 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint@9.6.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint@9.6.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.14.1(eslint@9.6.0)(typescript@5.5.2) + '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.5.3) eslint: 9.6.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-deprecation@3.0.0(eslint@9.6.0)(typescript@5.5.2): + eslint-plugin-deprecation@3.0.0(eslint@9.6.0)(typescript@5.5.3): dependencies: - '@typescript-eslint/utils': 7.14.1(eslint@9.6.0)(typescript@5.5.2) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) eslint: 9.6.0 - ts-api-utils: 1.3.0(typescript@5.5.2) + ts-api-utils: 1.3.0(typescript@5.5.3) tslib: 2.6.3 - typescript: 5.5.2 + typescript: 5.5.3 transitivePeerDependencies: - supports-color @@ -5271,7 +5272,7 @@ snapshots: eslint-utils: 2.1.0 regexpp: 3.2.0 - eslint-plugin-import@2.23.3(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0): + eslint-plugin-import@2.23.3(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0): dependencies: array-includes: 3.1.8 array.prototype.flat: 1.3.2 @@ -5279,7 +5280,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.6.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint@9.6.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint@9.6.0) find-up: 2.1.0 has: 1.0.4 is-core-module: 2.14.0 @@ -5290,7 +5291,7 @@ snapshots: resolve: 1.22.8 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.14.1(eslint@9.6.0)(typescript@5.5.2) + '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.5.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -5341,7 +5342,7 @@ snapshots: eslint-plugin-promise@4.2.1: {} - eslint-plugin-simple-import-sort@12.1.0(eslint@9.6.0): + eslint-plugin-simple-import-sort@12.1.1(eslint@9.6.0): dependencies: eslint: 9.6.0 @@ -5372,7 +5373,7 @@ snapshots: eslint-config-prettier: 6.0.0(eslint@9.6.0) eslint-config-standard: 13.0.1(eslint-plugin-import@2.23.3(@typescript-eslint/parser@5.0.0(eslint@9.6.0)(typescript@4.4.3))(eslint-import-resolver-typescript@2.5.0)(eslint@9.6.0))(eslint-plugin-node@11.1.0(eslint@9.6.0))(eslint-plugin-promise@4.2.1)(eslint-plugin-standard@4.0.0(eslint@9.6.0))(eslint@9.6.0) eslint-import-resolver-typescript: 2.5.0(eslint-plugin-import@2.23.3)(eslint@9.6.0) - eslint-plugin-import: 2.23.3(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0) + eslint-plugin-import: 2.23.3(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0) eslint-plugin-jsdoc: 33.1.1(eslint@9.6.0) eslint-plugin-mocha: 8.1.0(eslint@9.6.0) eslint-plugin-node: 11.1.0(eslint@9.6.0) @@ -5443,8 +5444,8 @@ snapshots: espree@10.1.0: dependencies: - acorn: 8.12.0 - acorn-jsx: 5.3.2(acorn@8.12.0) + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) eslint-visitor-keys: 4.0.0 esprima@4.0.1: {} @@ -5982,7 +5983,7 @@ snapshots: isexe@2.0.0: {} - isomorphic-git@1.26.3: + isomorphic-git@1.26.5: dependencies: async-lock: 1.4.1 clean-git-ref: 2.0.1 @@ -6031,7 +6032,7 @@ snapshots: whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 14.0.0 - ws: 8.17.1 + ws: 8.18.0 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil @@ -6090,7 +6091,7 @@ snapshots: local-pkg@0.5.0: dependencies: mlly: 1.7.1 - pkg-types: 1.1.1 + pkg-types: 1.1.3 locate-path@2.0.0: dependencies: @@ -6321,9 +6322,9 @@ snapshots: mlly@1.7.1: dependencies: - acorn: 8.12.0 + acorn: 8.12.1 pathe: 1.1.2 - pkg-types: 1.1.1 + pkg-types: 1.1.3 ufo: 1.5.3 mri@1.2.0: {} @@ -6431,7 +6432,7 @@ snapshots: p-limit@5.0.0: dependencies: - yocto-queue: 1.1.0 + yocto-queue: 1.1.1 p-locate@2.0.0: dependencies: @@ -6510,7 +6511,7 @@ snapshots: pify@4.0.1: {} - pkg-types@1.1.1: + pkg-types@1.1.3: dependencies: confbox: 0.1.7 mlly: 1.7.1 @@ -6522,7 +6523,7 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss@8.4.38: + postcss@8.4.39: dependencies: nanoid: 3.3.7 picocolors: 1.0.1 @@ -6978,9 +6979,9 @@ snapshots: trough@1.0.5: {} - ts-api-utils@1.3.0(typescript@5.5.2): + ts-api-utils@1.3.0(typescript@5.5.3): dependencies: - typescript: 5.5.2 + typescript: 5.5.3 ts-expose-internals-conditionally@1.0.0-empty.0: {} @@ -7021,7 +7022,7 @@ snapshots: type-detect@4.0.8: {} - type-fest@4.20.1: {} + type-fest@4.21.0: {} type-is@1.6.18: dependencies: @@ -7069,14 +7070,14 @@ snapshots: typed-array-buffer: 1.0.2 typed-array-byte-offset: 1.0.2 - typescript-eslint@7.14.1(eslint@9.6.0)(typescript@5.5.2): + typescript-eslint@7.15.0(eslint@9.6.0)(typescript@5.5.3): dependencies: - '@typescript-eslint/eslint-plugin': 7.14.1(@typescript-eslint/parser@7.14.1(eslint@9.6.0)(typescript@5.5.2))(eslint@9.6.0)(typescript@5.5.2) - '@typescript-eslint/parser': 7.14.1(eslint@9.6.0)(typescript@5.5.2) - '@typescript-eslint/utils': 7.14.1(eslint@9.6.0)(typescript@5.5.2) + '@typescript-eslint/eslint-plugin': 7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.5.3) eslint: 9.6.0 optionalDependencies: - typescript: 5.5.2 + typescript: 5.5.3 transitivePeerDependencies: - supports-color @@ -7084,7 +7085,7 @@ snapshots: typescript@5.3.3: {} - typescript@5.5.2: {} + typescript@5.5.3: {} ufo@1.5.3: {} @@ -7188,7 +7189,7 @@ snapshots: debug: 4.3.5 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.3.2(@types/node@20.14.9) + vite: 5.3.3(@types/node@20.14.9) transitivePeerDependencies: - '@types/node' - less @@ -7199,10 +7200,10 @@ snapshots: - supports-color - terser - vite@5.3.2(@types/node@20.14.9): + vite@5.3.3(@types/node@20.14.9): dependencies: esbuild: 0.21.5 - postcss: 8.4.38 + postcss: 8.4.39 rollup: 4.18.0 optionalDependencies: '@types/node': 20.14.9 @@ -7227,7 +7228,7 @@ snapshots: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.3.2(@types/node@20.14.9) + vite: 5.3.3(@types/node@20.14.9) vite-node: 1.6.0(@types/node@20.14.9) why-is-node-running: 2.2.2 optionalDependencies: @@ -7316,7 +7317,7 @@ snapshots: wrappy@1.0.2: {} - ws@8.17.1: {} + ws@8.18.0: {} xml-name-validator@5.0.0: {} @@ -7331,7 +7332,7 @@ snapshots: yocto-queue@0.1.0: {} - yocto-queue@1.1.0: {} + yocto-queue@1.1.1: {} zod@3.23.8: {} diff --git a/src/layers/3_SelectionSet/encode.ts b/src/layers/3_SelectionSet/encode.ts index ae514573b..f29da32c7 100644 --- a/src/layers/3_SelectionSet/encode.ts +++ b/src/layers/3_SelectionSet/encode.ts @@ -200,7 +200,7 @@ export const resolveObjectLikeFieldValue = ( * Inject __typename field for result fields that are missing it. */ // dprint-ignore - if (rootTypeName && context.config.returnMode === `successData` && context.schemaIndex.error.rootResultFields[rootTypeName][fieldName.actual]) { + if (rootTypeName && context.config.returnMode === `dataSuccess` && context.schemaIndex.error.rootResultFields[rootTypeName][fieldName.actual]) { (ss as Record)[`__typename`] = true } return `${toGraphQLFieldName(fieldName)} ${resolveFieldValue(context, schemaField, ss)}` diff --git a/src/layers/5_client/Config.ts b/src/layers/5_client/Config.ts index bf0e00889..1891a4cb3 100644 --- a/src/layers/5_client/Config.ts +++ b/src/layers/5_client/Config.ts @@ -8,7 +8,7 @@ import type { SelectionSet } from '../3_SelectionSet/__.js' export type ReturnModeType = | ReturnModeTypeGraphQL | ReturnModeTypeGraphQLSuccess - | ReturnModeTypeSuccessData + | ReturnModeTypeDataSuccess | ReturnModeTypeData | ReturnModeTypeDataAndErrors @@ -26,8 +26,7 @@ export type ReturnModeTypeData = 'data' export type ReturnModeTypeDataAndErrors = 'dataAndErrors' -// todo rename to dataSuccess -export type ReturnModeTypeSuccessData = 'successData' +export type ReturnModeTypeDataSuccess = 'dataSuccess' export type OptionsInput = { returnMode: ReturnModeType | undefined @@ -50,14 +49,14 @@ export type ApplyInputDefaults = { export type ReturnModeRootType<$Config extends Config, $Index extends Schema.Index, $Data extends object> = $Config['returnMode'] extends 'graphql' ? ExecutionResult<$Data> : $Config['returnMode'] extends 'data' ? $Data : - $Config['returnMode'] extends 'successData' ? { [$Key in keyof $Data]: ExcludeSchemaErrors<$Index, $Data[$Key]> } : + $Config['returnMode'] extends 'dataSuccess' ? { [$Key in keyof $Data]: ExcludeSchemaErrors<$Index, $Data[$Key]> } : $Data | GraphQLExecutionResultError // dprint-ignore export type ReturnModeRootField<$Config extends Config, $Index extends Schema.Index, $Data, $DataRaw = undefined> = $Config['returnMode'] extends 'graphql' ? ExecutionResult<$DataRaw extends undefined ? $Data : $DataRaw> : $Config['returnMode'] extends 'data' ? $Data : - $Config['returnMode'] extends 'successData' ? ExcludeSchemaErrors<$Index, $Data> : + $Config['returnMode'] extends 'dataSuccess' ? ExcludeSchemaErrors<$Index, $Data> : $Data | GraphQLExecutionResultError export type ExcludeSchemaErrors<$Index extends Schema.Index, $Data> = Exclude< @@ -66,12 +65,12 @@ export type ExcludeSchemaErrors<$Index extends Schema.Index, $Data> = Exclude< > export type OrThrowifyConfig<$Config extends Config> = $Config['returnMode'] extends 'graphql' ? $Config - : SetProperty<$Config, 'returnMode', 'successData'> + : SetProperty<$Config, 'returnMode', 'dataSuccess'> /** * We inject __typename select when: * 1. using schema errors - * 2. using return mode successData + * 2. using return mode dataSuccess */ type TypenameSelection = { __typename: true } @@ -82,7 +81,7 @@ export type CreateSelectionTypename<$Config extends Config, $Index extends Schem // dprint-ignore export type IsNeedSelectionTypename<$Config extends Config, $Index extends Schema.Index> = - $Config['returnMode'] extends 'successData' ? GlobalRegistry.HasSchemaErrorsViaName<$Index['name']> extends true ? true : + $Config['returnMode'] extends 'dataSuccess' ? GlobalRegistry.HasSchemaErrorsViaName<$Index['name']> extends true ? true : false : false diff --git a/src/layers/5_client/client.extend.test.ts b/src/layers/5_client/client.extend.test.ts index 0b10d8e43..edccd2213 100644 --- a/src/layers/5_client/client.extend.test.ts +++ b/src/layers/5_client/client.extend.test.ts @@ -10,18 +10,13 @@ const headers = { 'x-foo': 'bar' } // todo each extension added should copy, not mutate the client -describe(`entrypoint request`, () => { - test(`can add header to request`, async ({ fetch }) => { +describe(`entrypoint pack`, () => { + test(`can add header`, async ({ fetch }) => { fetch.mockImplementationOnce(async (input: Request) => { expect(input.headers.get('x-foo')).toEqual(headers['x-foo']) return createResponse({ data: { id: db.id } }) }) const client2 = client.use(async ({ pack }) => { - // todo should be raw input types but rather resolved - // todo should be URL instance? - // todo these input type tests should be moved down to Anyware - // expectTypeOf(exchange).toEqualTypeOf() - // expect(exchange.input).toEqual({ url: 'https://foo', document: `query { id \n }` }) return await pack({ input: { ...pack.input, headers } }) }) expect(await client2.query.id()).toEqual(db.id) diff --git a/src/layers/5_client/client.input.test-d.ts b/src/layers/5_client/client.input.test-d.ts index eb3de2380..5a121b65d 100644 --- a/src/layers/5_client/client.input.test-d.ts +++ b/src/layers/5_client/client.input.test-d.ts @@ -7,11 +7,11 @@ test(`works`, () => { Graffle.create({ schema, returnMode: `graphql` }) Graffle.create({ schema, returnMode: `data` }) Graffle.create({ schema, returnMode: `dataAndErrors` }) - Graffle.create({ schema, returnMode: `successData` }) + Graffle.create({ schema, returnMode: `dataSuccess` }) QueryOnly.create({ schema, returnMode: `graphql` }) QueryOnly.create({ schema, returnMode: `data` }) QueryOnly.create({ schema, returnMode: `dataAndErrors` }) // @ts-expect-error bad returnMode - QueryOnly.create({ schema, name: `QueryOnly`, returnMode: `successData` }) + QueryOnly.create({ schema, name: `QueryOnly`, returnMode: `dataSuccess` }) }) diff --git a/src/layers/5_client/client.returnMode.test-d.ts b/src/layers/5_client/client.returnMode.test-d.ts index 71d935b0a..0df3e9d80 100644 --- a/src/layers/5_client/client.returnMode.test-d.ts +++ b/src/layers/5_client/client.returnMode.test-d.ts @@ -51,8 +51,8 @@ describe('data', () => { }) // dprint-ignore -describe('successData', () => { - const graffle = Graffle.create({ schema, returnMode: 'successData' }) +describe('dataSuccess', () => { + const graffle = Graffle.create({ schema, returnMode: 'dataSuccess' }) test(`document.run`, async () => { expectTypeOf(graffle.document({ x: { query: { id: true } } }).run()).resolves.toEqualTypeOf<{ id: string | null }>() }) diff --git a/src/layers/5_client/client.returnMode.test.ts b/src/layers/5_client/client.returnMode.test.ts index 125afa739..b9218a482 100644 --- a/src/layers/5_client/client.returnMode.test.ts +++ b/src/layers/5_client/client.returnMode.test.ts @@ -82,8 +82,8 @@ describe('dataAndErrors', () => { }) // dprint-ignore -describe('successData', () => { - const graffle = Graffle.create({ schema, returnMode: 'successData' }) +describe('dataSuccess', () => { + const graffle = Graffle.create({ schema, returnMode: 'dataSuccess' }) test(`document.run`, async () => { expect(graffle.document({ x: { query: { id: true } } }).run()).resolves.toEqual({ id: db.id }) }) diff --git a/src/layers/5_client/client.ts b/src/layers/5_client/client.ts index 64aff7b45..023df54f5 100644 --- a/src/layers/5_client/client.ts +++ b/src/layers/5_client/client.ts @@ -18,7 +18,7 @@ import type { Config, ReturnModeType, ReturnModeTypeBase, - ReturnModeTypeSuccessData, + ReturnModeTypeDataSuccess, } from './Config.js' import type { DocumentFn } from './document.js' import type { GetRootTypeMethods } from './RootTypeMethods.js' @@ -89,7 +89,7 @@ export type InputRaw = { export type InputPrefilled<$Schema extends GlobalRegistry.SchemaList> = $Schema extends any ? { returnMode?: | ReturnModeTypeBase - | (GlobalRegistry.HasSchemaErrors<$Schema> extends true ? ReturnModeTypeSuccessData : never) + | (GlobalRegistry.HasSchemaErrors<$Schema> extends true ? ReturnModeTypeDataSuccess : never) } & InputRaw : never @@ -217,7 +217,7 @@ export const createInternal = ( const isSelectedTypeScalarOrTypeName = selectedNamedType.kind === `Scalar` || selectedNamedType.kind === `typename` // todo fix type here, its valid const isFieldHasArgs = Boolean(context.schemaIndex.Root[rootTypeName]?.fields[rootTypeFieldName]?.args) // We should only need to add __typename for result type fields, but the return handler doesn't yet know how to look beyond a plain object type so we have to add all those cases here. - const needsTypenameAdded = context.config.returnMode === `successData` + const needsTypenameAdded = context.config.returnMode === `dataSuccess` && (selectedNamedType.kind === `Object` || selectedNamedType.kind === `Interface` || selectedNamedType.kind === `Union`) const rootTypeFieldSelectionSet = isSelectedTypeScalarOrTypeName @@ -231,7 +231,7 @@ export const createInternal = ( } as GraphQLObjectSelection) if (result instanceof Error) return result return context.config.returnMode === `data` || context.config.returnMode === `dataAndErrors` - || context.config.returnMode === `successData` + || context.config.returnMode === `dataSuccess` // @ts-expect-error ? result[rootTypeFieldName] : result @@ -382,7 +382,7 @@ const handleReturn = ( switch (context.config.returnMode) { case `graphqlSuccess`: case `dataAndErrors`: - case `successData`: + case `dataSuccess`: case `data`: { if (result instanceof Error || (result.errors && result.errors.length > 0)) { const error = result instanceof Error ? result : (new Errors.ContextualAggregateError( @@ -391,14 +391,14 @@ const handleReturn = ( result.errors!, )) if ( - context.config.returnMode === `data` || context.config.returnMode === `successData` + context.config.returnMode === `data` || context.config.returnMode === `dataSuccess` || context.config.returnMode === `graphqlSuccess` ) throw error return error } if (isTypedContext(context)) { - if (context.config.returnMode === `successData`) { + if (context.config.returnMode === `dataSuccess`) { if (!isPlainObject(result.data)) throw new Error(`Expected data to be an object.`) const schemaErrors = Object.entries(result.data).map(([rootFieldName, rootFieldValue]) => { // todo this check would be nice but it doesn't account for aliases right now. To achieve this we would @@ -444,10 +444,10 @@ const handleReturn = ( } const applyOrThrowToContext = <$Context extends Context>(context: $Context): $Context => { - if (context.config.returnMode === `successData` || context.config.returnMode === `graphqlSuccess`) { + if (context.config.returnMode === `dataSuccess` || context.config.returnMode === `graphqlSuccess`) { return context } - const newMode = context.config.returnMode === `graphql` ? `graphqlSuccess` : `successData` + const newMode = context.config.returnMode === `graphql` ? `graphqlSuccess` : `dataSuccess` return updateContextConfig(context, { returnMode: newMode }) }