diff --git a/webui2/codegen.ts b/webui2/codegen.ts index ae11238110b44eb5677dbd7b9577c320fcc428f1..1863dc0fe2b795958577d34710d79decf80627e4 100644 --- a/webui2/codegen.ts +++ b/webui2/codegen.ts @@ -10,6 +10,7 @@ const config: CodegenConfig = { withHooks: true, withComponent: false, withHOC: false, + apolloReactHooksImportFrom: "@apollo/client/react", scalars: { Time: "string", Hash: "string", diff --git a/webui2/package.json b/webui2/package.json index 3edeb7ce98917354848efe8c79daea6cea8ff714..1bf81ee7463ef1caabcd32724e4e43ab063f304f 100644 --- a/webui2/package.json +++ b/webui2/package.json @@ -15,7 +15,7 @@ "check": "oxlint && oxfmt --check" }, "dependencies": { - "@apollo/client": "^3.13.0", + "@apollo/client": "^4.1.6", "@radix-ui/react-avatar": "^1.1.3", "@radix-ui/react-popover": "^1.1.6", "@radix-ui/react-separator": "^1.1.1", @@ -38,6 +38,7 @@ "rehype-slug": "^6.0.0", "remark-emoji": "^5.0.2", "remark-gfm": "^4.0.0", + "rxjs": "^7.8.2", "tailwind-merge": "^3.5.0", "tailwindcss-animate": "^1.0.7" }, diff --git a/webui2/pnpm-lock.yaml b/webui2/pnpm-lock.yaml index 44abe53a1a6021474248606dee61e8205c83895b..fc0966510e1b231ff68c9bf1d1fde84b88c00d30 100644 --- a/webui2/pnpm-lock.yaml +++ b/webui2/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@apollo/client': - specifier: ^3.13.0 - version: 3.14.1(@types/react@19.2.14)(graphql-ws@6.0.8(graphql@16.13.2)(ws@8.20.0))(graphql@16.13.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + specifier: ^4.1.6 + version: 4.1.6(graphql-ws@6.0.8(graphql@16.13.2)(ws@8.20.0))(graphql@16.13.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rxjs@7.8.2) '@radix-ui/react-avatar': specifier: ^1.1.3 version: 1.1.11(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) @@ -77,6 +77,9 @@ importers: remark-gfm: specifier: ^4.0.0 version: 4.0.1 + rxjs: + specifier: ^7.8.2 + version: 7.8.2 tailwind-merge: specifier: ^3.5.0 version: 3.5.0 @@ -139,13 +142,14 @@ packages: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - '@apollo/client@3.14.1': - resolution: {integrity: sha512-SgGX6E23JsZhUdG2anxiyHvEvvN6CUaI4ZfMsndZFeuHPXL3H0IsaiNAhLITSISbeyeYd+CBd9oERXQDdjXWZw==} + '@apollo/client@4.1.6': + resolution: {integrity: sha512-ak8uzqmKeX3u9BziGf83RRyODAJKFkPG72hTNvEj4WjMWFmuKW2gGN1i3OfajKT6yuGjvo+n23ES2zqWDKFCZg==} peerDependencies: - graphql: ^15.0.0 || ^16.0.0 + graphql: ^16.0.0 graphql-ws: ^5.5.5 || ^6.0.3 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc + react: ^17.0.0 || ^18.0.0 || >=19.0.0-rc + react-dom: ^17.0.0 || ^18.0.0 || >=19.0.0-rc + rxjs: ^7.3.0 subscriptions-transport-ws: ^0.9.0 || ^0.11.0 peerDependenciesMeta: graphql-ws: @@ -1957,9 +1961,6 @@ packages: resolution: {integrity: sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==} engines: {node: '>=12.0.0'} - hoist-non-react-statics@3.3.2: - resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} - html-url-attributes@3.0.1: resolution: {integrity: sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==} @@ -2583,9 +2584,6 @@ packages: resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} engines: {node: ^10 || ^12 || >=14} - prop-types@15.8.1: - resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} - property-information@7.1.0: resolution: {integrity: sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==} @@ -2597,9 +2595,6 @@ packages: peerDependencies: react: ^19.2.4 - react-is@16.13.1: - resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} - react-markdown@10.1.0: resolution: {integrity: sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==} peerDependencies: @@ -2657,17 +2652,6 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} - rehackt@0.1.0: - resolution: {integrity: sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==} - peerDependencies: - '@types/react': '*' - react: '*' - peerDependenciesMeta: - '@types/react': - optional: true - react: - optional: true - rehype-autolink-headings@7.1.0: resolution: {integrity: sha512-rItO/pSdvnvsP4QRB1pmPiNHUskikqtPojZKJPPPAVx9Hj8i8TwMBhofrrAYRhYOOBZH9tgmG5lPqDLuIWPWmw==} @@ -2744,6 +2728,9 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -2845,10 +2832,6 @@ packages: swap-case@2.0.2: resolution: {integrity: sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw==} - symbol-observable@4.0.0: - resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} - engines: {node: '>=0.10'} - sync-fetch@0.6.0: resolution: {integrity: sha512-IELLEvzHuCfc1uTsshPK58ViSdNqXxlml1U+fmwJIKLYKOr/rAtBrorE2RYm5IHaMpDNlmC0fr1LAvdXvyheEQ==} engines: {node: '>=18'} @@ -2901,10 +2884,6 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-invariant@0.10.3: - resolution: {integrity: sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==} - engines: {node: '>=8'} - ts-log@2.2.7: resolution: {integrity: sha512-320x5Ggei84AxzlXp91QkIGSw5wgaLT6GeAH0KsqDmRZdVWW2OiSeVvElVoatk3f7nicwXlElXsoFkARiGE2yg==} @@ -3110,12 +3089,6 @@ packages: resolution: {integrity: sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==} engines: {node: '>=18'} - zen-observable-ts@1.2.5: - resolution: {integrity: sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==} - - zen-observable@0.8.15: - resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} - zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -3123,7 +3096,7 @@ snapshots: '@alloc/quick-lru@5.2.0': {} - '@apollo/client@3.14.1(@types/react@19.2.14)(graphql-ws@6.0.8(graphql@16.13.2)(ws@8.20.0))(graphql@16.13.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': + '@apollo/client@4.1.6(graphql-ws@6.0.8(graphql@16.13.2)(ws@8.20.0))(graphql@16.13.2)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(rxjs@7.8.2)': dependencies: '@graphql-typed-document-node/core': 3.2.0(graphql@16.13.2) '@wry/caches': 1.0.1 @@ -3131,20 +3104,13 @@ snapshots: '@wry/trie': 0.5.0 graphql: 16.13.2 graphql-tag: 2.12.6(graphql@16.13.2) - hoist-non-react-statics: 3.3.2 optimism: 0.18.1 - prop-types: 15.8.1 - rehackt: 0.1.0(@types/react@19.2.14)(react@19.2.4) - symbol-observable: 4.0.0 - ts-invariant: 0.10.3 + rxjs: 7.8.2 tslib: 2.8.1 - zen-observable-ts: 1.2.5 optionalDependencies: graphql-ws: 6.0.8(graphql@16.13.2)(ws@8.20.0) react: 19.2.4 react-dom: 19.2.4(react@19.2.4) - transitivePeerDependencies: - - '@types/react' '@ardatan/relay-compiler@13.0.0(graphql@16.13.2)': dependencies: @@ -3656,14 +3622,14 @@ snapshots: '@graphql-tools/optimize@2.0.0(graphql@16.13.2)': dependencies: graphql: 16.13.2 - tslib: 2.6.3 + tslib: 2.8.1 '@graphql-tools/relay-operation-optimizer@7.1.1(graphql@16.13.2)': dependencies: '@ardatan/relay-compiler': 13.0.0(graphql@16.13.2) '@graphql-tools/utils': 11.0.0(graphql@16.13.2) graphql: 16.13.2 - tslib: 2.6.3 + tslib: 2.8.1 '@graphql-tools/schema@10.0.31(graphql@16.13.2)': dependencies: @@ -4921,10 +4887,6 @@ snapshots: highlight.js@11.11.1: {} - hoist-non-react-statics@3.3.2: - dependencies: - react-is: 16.13.1 - html-url-attributes@3.0.1: {} html-void-elements@3.0.0: {} @@ -5733,12 +5695,6 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - prop-types@15.8.1: - dependencies: - loose-envify: 1.4.0 - object-assign: 4.1.1 - react-is: 16.13.1 - property-information@7.1.0: {} queue-microtask@1.2.3: {} @@ -5748,8 +5704,6 @@ snapshots: react: 19.2.4 scheduler: 0.27.0 - react-is@16.13.1: {} - react-markdown@10.1.0(@types/react@19.2.14)(react@19.2.4): dependencies: '@types/hast': 3.0.4 @@ -5813,11 +5767,6 @@ snapshots: dependencies: picomatch: 2.3.2 - rehackt@0.1.0(@types/react@19.2.14)(react@19.2.4): - optionalDependencies: - '@types/react': 19.2.14 - react: 19.2.4 - rehype-autolink-headings@7.1.0: dependencies: '@types/hast': 3.0.4 @@ -5952,6 +5901,10 @@ snapshots: dependencies: queue-microtask: 1.2.3 + rxjs@7.8.2: + dependencies: + tslib: 2.8.1 + safer-buffer@2.1.2: {} scheduler@0.27.0: {} @@ -6059,8 +6012,6 @@ snapshots: dependencies: tslib: 2.8.1 - symbol-observable@4.0.0: {} - sync-fetch@0.6.0: dependencies: node-fetch: 3.3.2 @@ -6132,10 +6083,6 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-invariant@0.10.3: - dependencies: - tslib: 2.8.1 - ts-log@2.2.7: {} tslib@2.6.3: {} @@ -6303,10 +6250,4 @@ snapshots: yoctocolors-cjs@2.1.3: {} - zen-observable-ts@1.2.5: - dependencies: - zen-observable: 0.8.15 - - zen-observable@0.8.15: {} - zwitch@2.0.4: {} diff --git a/webui2/src/__generated__/graphql.ts b/webui2/src/__generated__/graphql.ts index ea4662f9d761bf217e34c9308f5456b9502edbe3..36bf3beb2efc99cb8c5f8df26bdfb2baf07521d3 100644 --- a/webui2/src/__generated__/graphql.ts +++ b/webui2/src/__generated__/graphql.ts @@ -1,5 +1,6 @@ import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +import * as ApolloReactHooks from '@apollo/client/react'; export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; @@ -1321,20 +1322,20 @@ export const AllIdentitiesDocument = gql` * }, * }); */ -export function useAllIdentitiesQuery(baseOptions?: Apollo.QueryHookOptions) { +export function useAllIdentitiesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(AllIdentitiesDocument, options); + return ApolloReactHooks.useQuery(AllIdentitiesDocument, options); } -export function useAllIdentitiesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useAllIdentitiesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(AllIdentitiesDocument, options); + return ApolloReactHooks.useLazyQuery(AllIdentitiesDocument, options); } // @ts-ignore -export function useAllIdentitiesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useAllIdentitiesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useAllIdentitiesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(AllIdentitiesDocument, options); +export function useAllIdentitiesSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useAllIdentitiesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useAllIdentitiesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions) { + const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useSuspenseQuery(AllIdentitiesDocument, options); } export type AllIdentitiesQueryHookResult = ReturnType; export type AllIdentitiesLazyQueryHookResult = ReturnType; @@ -1464,20 +1465,20 @@ export const BugDetailDocument = gql` * }, * }); */ -export function useBugDetailQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: BugDetailQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { +export function useBugDetailQuery(baseOptions: ApolloReactHooks.QueryHookOptions & ({ variables: BugDetailQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(BugDetailDocument, options); + return ApolloReactHooks.useQuery(BugDetailDocument, options); } -export function useBugDetailLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useBugDetailLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(BugDetailDocument, options); + return ApolloReactHooks.useLazyQuery(BugDetailDocument, options); } // @ts-ignore -export function useBugDetailSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useBugDetailSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useBugDetailSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(BugDetailDocument, options); +export function useBugDetailSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useBugDetailSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useBugDetailSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions) { + const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useSuspenseQuery(BugDetailDocument, options); } export type BugDetailQueryHookResult = ReturnType; export type BugDetailLazyQueryHookResult = ReturnType; @@ -1548,20 +1549,20 @@ export const BugListDocument = gql` * }, * }); */ -export function useBugListQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: BugListQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { +export function useBugListQuery(baseOptions: ApolloReactHooks.QueryHookOptions & ({ variables: BugListQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(BugListDocument, options); + return ApolloReactHooks.useQuery(BugListDocument, options); } -export function useBugListLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useBugListLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(BugListDocument, options); + return ApolloReactHooks.useLazyQuery(BugListDocument, options); } // @ts-ignore -export function useBugListSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useBugListSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useBugListSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(BugListDocument, options); +export function useBugListSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useBugListSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useBugListSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions) { + const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useSuspenseQuery(BugListDocument, options); } export type BugListQueryHookResult = ReturnType; export type BugListLazyQueryHookResult = ReturnType; @@ -1596,9 +1597,9 @@ export type BugCreateMutationFn = Apollo.MutationFunction) { +export function useBugCreateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugCreateDocument, options); + return ApolloReactHooks.useMutation(BugCreateDocument, options); } export type BugCreateMutationHookResult = ReturnType; export type BugCreateMutationResult = Apollo.MutationResult; @@ -1631,9 +1632,9 @@ export type BugAddCommentMutationFn = Apollo.MutationFunction) { +export function useBugAddCommentMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugAddCommentDocument, options); + return ApolloReactHooks.useMutation(BugAddCommentDocument, options); } export type BugAddCommentMutationHookResult = ReturnType; export type BugAddCommentMutationResult = Apollo.MutationResult; @@ -1666,9 +1667,9 @@ export type BugAddCommentAndCloseMutationFn = Apollo.MutationFunction) { +export function useBugAddCommentAndCloseMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugAddCommentAndCloseDocument, options); + return ApolloReactHooks.useMutation(BugAddCommentAndCloseDocument, options); } export type BugAddCommentAndCloseMutationHookResult = ReturnType; export type BugAddCommentAndCloseMutationResult = Apollo.MutationResult; @@ -1701,9 +1702,9 @@ export type BugAddCommentAndReopenMutationFn = Apollo.MutationFunction) { +export function useBugAddCommentAndReopenMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugAddCommentAndReopenDocument, options); + return ApolloReactHooks.useMutation(BugAddCommentAndReopenDocument, options); } export type BugAddCommentAndReopenMutationHookResult = ReturnType; export type BugAddCommentAndReopenMutationResult = Apollo.MutationResult; @@ -1736,9 +1737,9 @@ export type BugEditCommentMutationFn = Apollo.MutationFunction) { +export function useBugEditCommentMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugEditCommentDocument, options); + return ApolloReactHooks.useMutation(BugEditCommentDocument, options); } export type BugEditCommentMutationHookResult = ReturnType; export type BugEditCommentMutationResult = Apollo.MutationResult; @@ -1779,9 +1780,9 @@ export type BugChangeLabelsMutationFn = Apollo.MutationFunction) { +export function useBugChangeLabelsMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugChangeLabelsDocument, options); + return ApolloReactHooks.useMutation(BugChangeLabelsDocument, options); } export type BugChangeLabelsMutationHookResult = ReturnType; export type BugChangeLabelsMutationResult = Apollo.MutationResult; @@ -1815,9 +1816,9 @@ export type BugStatusOpenMutationFn = Apollo.MutationFunction) { +export function useBugStatusOpenMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugStatusOpenDocument, options); + return ApolloReactHooks.useMutation(BugStatusOpenDocument, options); } export type BugStatusOpenMutationHookResult = ReturnType; export type BugStatusOpenMutationResult = Apollo.MutationResult; @@ -1851,9 +1852,9 @@ export type BugStatusCloseMutationFn = Apollo.MutationFunction) { +export function useBugStatusCloseMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugStatusCloseDocument, options); + return ApolloReactHooks.useMutation(BugStatusCloseDocument, options); } export type BugStatusCloseMutationHookResult = ReturnType; export type BugStatusCloseMutationResult = Apollo.MutationResult; @@ -1887,9 +1888,9 @@ export type BugSetTitleMutationFn = Apollo.MutationFunction) { +export function useBugSetTitleMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(BugSetTitleDocument, options); + return ApolloReactHooks.useMutation(BugSetTitleDocument, options); } export type BugSetTitleMutationHookResult = ReturnType; export type BugSetTitleMutationResult = Apollo.MutationResult; @@ -1920,20 +1921,20 @@ export const RepositoriesDocument = gql` * }, * }); */ -export function useRepositoriesQuery(baseOptions?: Apollo.QueryHookOptions) { +export function useRepositoriesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(RepositoriesDocument, options); + return ApolloReactHooks.useQuery(RepositoriesDocument, options); } -export function useRepositoriesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useRepositoriesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(RepositoriesDocument, options); + return ApolloReactHooks.useLazyQuery(RepositoriesDocument, options); } // @ts-ignore -export function useRepositoriesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useRepositoriesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useRepositoriesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(RepositoriesDocument, options); +export function useRepositoriesSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useRepositoriesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useRepositoriesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions) { + const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useSuspenseQuery(RepositoriesDocument, options); } export type RepositoriesQueryHookResult = ReturnType; export type RepositoriesLazyQueryHookResult = ReturnType; @@ -1963,20 +1964,20 @@ export const ServerConfigDocument = gql` * }, * }); */ -export function useServerConfigQuery(baseOptions?: Apollo.QueryHookOptions) { +export function useServerConfigQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(ServerConfigDocument, options); + return ApolloReactHooks.useQuery(ServerConfigDocument, options); } -export function useServerConfigLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useServerConfigLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(ServerConfigDocument, options); + return ApolloReactHooks.useLazyQuery(ServerConfigDocument, options); } // @ts-ignore -export function useServerConfigSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useServerConfigSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useServerConfigSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(ServerConfigDocument, options); +export function useServerConfigSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useServerConfigSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useServerConfigSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions) { + const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useSuspenseQuery(ServerConfigDocument, options); } export type ServerConfigQueryHookResult = ReturnType; export type ServerConfigLazyQueryHookResult = ReturnType; @@ -2051,20 +2052,20 @@ export const UserProfileDocument = gql` * }, * }); */ -export function useUserProfileQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: UserProfileQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { +export function useUserProfileQuery(baseOptions: ApolloReactHooks.QueryHookOptions & ({ variables: UserProfileQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(UserProfileDocument, options); + return ApolloReactHooks.useQuery(UserProfileDocument, options); } -export function useUserProfileLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useUserProfileLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(UserProfileDocument, options); + return ApolloReactHooks.useLazyQuery(UserProfileDocument, options); } // @ts-ignore -export function useUserProfileSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useUserProfileSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useUserProfileSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(UserProfileDocument, options); +export function useUserProfileSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useUserProfileSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useUserProfileSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions) { + const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useSuspenseQuery(UserProfileDocument, options); } export type UserProfileQueryHookResult = ReturnType; export type UserProfileLazyQueryHookResult = ReturnType; @@ -2103,20 +2104,20 @@ export const ValidLabelsDocument = gql` * }, * }); */ -export function useValidLabelsQuery(baseOptions?: Apollo.QueryHookOptions) { +export function useValidLabelsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(ValidLabelsDocument, options); + return ApolloReactHooks.useQuery(ValidLabelsDocument, options); } -export function useValidLabelsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useValidLabelsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(ValidLabelsDocument, options); + return ApolloReactHooks.useLazyQuery(ValidLabelsDocument, options); } // @ts-ignore -export function useValidLabelsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useValidLabelsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions): Apollo.UseSuspenseQueryResult; -export function useValidLabelsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(ValidLabelsDocument, options); +export function useValidLabelsSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useValidLabelsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions): ApolloReactHooks.UseSuspenseQueryResult; +export function useValidLabelsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions) { + const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useSuspenseQuery(ValidLabelsDocument, options); } export type ValidLabelsQueryHookResult = ReturnType; export type ValidLabelsLazyQueryHookResult = ReturnType; diff --git a/webui2/src/components/code/CommitList.tsx b/webui2/src/components/code/CommitList.tsx index b54f1ad12c5284b23e9366a6f4fae4c79c8ba6fd..7efd09f650602e1c4247a2b45e8dff47a134cb7e 100644 --- a/webui2/src/components/code/CommitList.tsx +++ b/webui2/src/components/code/CommitList.tsx @@ -1,7 +1,8 @@ // Paginated commit history grouped by calendar date. Each row links to the // commit detail page. Used in CodePage's "History" view. -import { gql, useQuery } from "@apollo/client"; +import { gql } from "@apollo/client"; +import { useQuery } from "@apollo/client/react"; import { formatDistanceToNow } from "date-fns"; import { GitCommit } from "lucide-react"; import { useState } from "react"; diff --git a/webui2/src/components/code/FileDiffView.tsx b/webui2/src/components/code/FileDiffView.tsx index 129af9d61c3a1c657c6d863ab72dc0c0a9139331..73a99fea09f145d5c471713a8c98ae6ca9a6ddfa 100644 --- a/webui2/src/components/code/FileDiffView.tsx +++ b/webui2/src/components/code/FileDiffView.tsx @@ -1,7 +1,8 @@ // Collapsible diff view for a single file in a commit. // Diff is fetched lazily on first expand via GraphQL. -import { gql, useLazyQuery } from "@apollo/client"; +import { gql } from "@apollo/client"; +import { useLazyQuery } from "@apollo/client/react"; import { ChevronRight, FilePlus, FileMinus, FileEdit } from "lucide-react"; import { useState } from "react"; diff --git a/webui2/src/lib/apollo.ts b/webui2/src/lib/apollo.ts index 991ead2ec2ad65981110ef4f88c25a4db157d61b..3b0744fa63e98fad5fed4b86f275b26288cf08ef 100644 --- a/webui2/src/lib/apollo.ts +++ b/webui2/src/lib/apollo.ts @@ -1,6 +1,6 @@ -import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client"; +import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client"; -const httpLink = createHttpLink({ +const httpLink = new HttpLink({ uri: "/graphql", // include credentials so future httpOnly auth cookies are sent automatically credentials: "include", @@ -8,6 +8,7 @@ const httpLink = createHttpLink({ export const client = new ApolloClient({ link: httpLink, + cache: new InMemoryCache({ typePolicies: { // Repository has no id field — treat as a singleton per cache diff --git a/webui2/src/lib/auth.tsx b/webui2/src/lib/auth.tsx index e06bfb0319cd34b84b5a2a4864ee25fa80580768..00537de1bc09ebff5e7fad6941327d25f4f804d0 100644 --- a/webui2/src/lib/auth.tsx +++ b/webui2/src/lib/auth.tsx @@ -14,7 +14,8 @@ // All three modes expose the same AuthContextValue shape, so the rest of the // component tree doesn't need to know which mode is active. -import { gql, useQuery } from "@apollo/client"; +import { gql } from "@apollo/client"; +import { useQuery } from "@apollo/client/react"; import { createContext, useContext, useEffect, useState, type ReactNode } from "react"; import { useServerConfigQuery } from "@/__generated__/graphql"; diff --git a/webui2/src/main.tsx b/webui2/src/main.tsx index 93848a6ad607af567399d1c3b376188a861c5fa6..3f957d3ed57832592384910294115492617f05ac 100644 --- a/webui2/src/main.tsx +++ b/webui2/src/main.tsx @@ -1,4 +1,4 @@ -import { ApolloProvider } from "@apollo/client"; +import { ApolloProvider } from "@apollo/client/react"; import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; diff --git a/webui2/src/pages/CodePage.tsx b/webui2/src/pages/CodePage.tsx index 4c4284810b33d8a319880245fbd706f6bc20b388..7adbdd035f487e0701a0d9fb3f0bf8befe0bdf71 100644 --- a/webui2/src/pages/CodePage.tsx +++ b/webui2/src/pages/CodePage.tsx @@ -1,7 +1,8 @@ // Code browser page. Switches between tree view, file viewer, and commit // history via ?type= search param. Ref is selected via ?ref=. -import { gql, useQuery } from "@apollo/client"; +import { gql } from "@apollo/client"; +import { useQuery } from "@apollo/client/react"; import { AlertCircle, GitCommit } from "lucide-react"; import { useEffect } from "react"; import { useSearchParams } from "react-router"; diff --git a/webui2/src/pages/CommitPage.tsx b/webui2/src/pages/CommitPage.tsx index 9d2729e48721edcdac36820233e536d56cd228eb..9a210af6eb7b21543048919df9808b1136f364a4 100644 --- a/webui2/src/pages/CommitPage.tsx +++ b/webui2/src/pages/CommitPage.tsx @@ -1,7 +1,8 @@ // Commit detail page (/:repo/commit/:hash). Shows commit metadata, full // message, parent links, and changed files with lazy diffs. -import { gql, useQuery } from "@apollo/client"; +import { gql } from "@apollo/client"; +import { useQuery } from "@apollo/client/react"; import { format } from "date-fns"; import { ArrowLeft, GitCommit } from "lucide-react"; import { Link, useParams, useNavigate } from "react-router";