deep-foundation / hasura

The Unlicense
11 stars 4 forks source link

Add Custom ApolloClient Type to client.tsx #12

Closed deep-foundation-sweepai[bot] closed 1 year ago

deep-foundation-sweepai[bot] commented 1 year ago

Description

This PR introduces a custom ApolloClient type that extends the ApolloClient from the '@apollo/client' package and includes additional properties: 'path', 'ssl', and 'jwt_token'. This custom type is then used in the 'client.tsx' file instead of the original ApolloClient.

Summary of Changes

These changes ensure that the ApolloClient used in the application includes the additional properties and functionalities required by the user.

Fixes #8.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/custom-apollo-client-type

🎉 Latest improvements to Sweep:


💡 To get Sweep to edit this pull request, you can:

deep-foundation-sweepai[bot] commented 1 year ago

GitHub actions yielded the following error.

The command that failed is npm run package:build.

Here are the relevant error lines from the logs:

##[error]client.tsx(46,18): error TS2430: Interface 'IApolloClient<T>' incorrectly extends interface 'ApolloClient<any> & { path: string; ssl: boolean; jwt_token: string; }'.
Type 'IApolloClient<T>' is not assignable to type '{ path: string; ssl: boolean; jwt_token: string; }'.
Property 'path' is optional in type 'IApolloClient<T>' but required in type '{ path: string; ssl: boolean; jwt_token: string; }'.
##[error]client.tsx(139,3): error TS2322: Type 'IApolloClient<any>' is not assignable to type 'ApolloClient'.
Type 'IApolloClient<any>' is not assignable to type '{ path: string; ssl: boolean; jwt_token: string; }'.
Property 'path' is optional in type 'IApolloClient<any>' but required in type '{ path: string; ssl: boolean; jwt_token: string; }'.
##[error]Process completed with exit code 2.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

deep-foundation-sweepai[bot] commented 1 year ago

GitHub actions yielded the following error.

##[group]Run npm run build
npm ERR! Missing script: "build"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run
npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2023-09-12T12_02_06_892Z-debug-0.log
##[error]Process completed with exit code 1.

The command that failed is npm run build.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

FreePhoenix888 commented 1 year ago

Sweepai: Interface 'IApolloClient' incorrectly extends interface 'ApolloClient & { path: string; ssl: boolean; jwt_token: string; } is throwed because you do not pass types parameter

FreePhoenix888 commented 1 year ago

Sweepai: pass type parameter to BaseApolloClient

FreePhoenix888 commented 1 year ago

Sweeep: pass the type parameter to BaseApolloClient

FreePhoenix888 commented 1 year ago

Sweeep: pass the type parameter to BaseApolloClient

FreePhoenix888 commented 1 year ago

Sweeep: pass the type parameter to BaseApolloClient

deep-foundation-sweepai[bot] commented 1 year ago

GitHub actions yielded the following error.

The command that failed is npm run build. Here are the relevant lines from the logs:

npm ERR! Missing script: "build"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2023-09-20T10_44_04_543Z-debug-0.log

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

deep-foundation-sweepai[bot] commented 1 year ago

🚀 Wrote Changes

The command that failed is npm run build. Here are the relevant lines from the logs:

npm ERR! Missing script: "build"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2023-09-20T10_44_04_543Z-debug-0.log

Hi @deep-foundation-sweepai[bot],

I decided to make the following changes:

File Path Proposed Changes
package.json Modify package.json with contents:
• Add a "build" script to the "scripts" section of the package.json file. The exact command that the "build" script should run depends on the specific build process for this project. For example, if the project uses TypeScript, the "build" script might be "tsc".
deep-foundation-sweepai[bot] commented 1 year ago

GitHub actions yielded the following error.

The command that failed is npm run build. Here are the relevant lines from the logs:

npm ERR! Missing script: "build"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2023-09-20T10_45_46_097Z-debug-0.log

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

deep-foundation-sweepai[bot] commented 1 year ago

GitHub actions yielded the following error.

The command that failed is npm run build. Here are the relevant lines from the logs:

##[error]client.tsx(46,18): error TS2430: Interface 'IApolloClient<T>' incorrectly extends interface 'ApolloClient<any> & { path: string; ssl: boolean; jwt_token: string; }'.
Type 'IApolloClient<T>' is not assignable to type '{ path: string; ssl: boolean; jwt_token: string; }'.
Property 'path' is optional in type 'IApolloClient<T>' but required in type '{ path: string; ssl: boolean; jwt_token: string; }'.
##[error]client.tsx(139,3): error TS2322: Type 'IApolloClient<any>' is not assignable to type 'ApolloClient'.
Type 'IApolloClient<any>' is not assignable to type '{ path: string; ssl: boolean; jwt_token: string; }'.
Property 'path' is optional in type 'IApolloClient<any>' but required in type '{ path: string; ssl: boolean; jwt_token: string; }'.
##[error]Process completed with exit code 2.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.