openreplay icon indicating copy to clipboard operation
openreplay copied to clipboard

refactor(tracker-graphql): use correct @apollo/client types

Open andreialecu opened this issue 1 year ago • 6 comments

Fixes #2504

Summary by CodeRabbit

  • New Features

    • Introduced support for the Apollo Client, enhancing integration capabilities.
  • Improvements

    • Updated the createTrackerLink function for better type safety and clarity, aligning with Apollo Client standards.
  • Chores

    • Added @apollo/client as a peer and development dependency for improved compatibility.

andreialecu avatar Aug 24 '24 09:08 andreialecu

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
7 out of 8 committers have signed the CLA.

:white_check_mark: nick-delirium
:white_check_mark: tahayk
:white_check_mark: estradino
:white_check_mark: shekarsiri
:white_check_mark: PiR1
:white_check_mark: andreialecu
:white_check_mark: zavorotynskiy
:x: atefBB
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Aug 24 '24 09:08 CLAassistant

Walkthrough

This update introduces changes to the package.json and apolloMiddleware.ts files in the tracker/tracker-graphql directory. It adds the @apollo/client package as a peer and development dependency, updates the createTrackerLink function's type signature, and improves type consistency by utilizing types directly from @apollo/client. These modifications aim to enhance compatibility and maintainability within the codebase.

Changes

File Path Change Summary
tracker/tracker-graphql/package.json Added @apollo/client as a peer dependency (>=3.0.0) and a dev dependency (^3.9.5); introduced peerDependenciesMeta to mark it as optional.
tracker/tracker-graphql/src/apolloMiddleware.ts Updated createTrackerLink function's return type to RequestHandler and removed local type definitions for Operation and NextLink, importing them from @apollo/client.

Assessment against linked issues

Objective Addressed Explanation
@apollo/client should be an optional peer dependency (#[2504])
Use the type from @apollo/client instead of local types (#[2504])

Poem

🐇 In the code, a change took flight,
With Apollo's might, it feels just right.
Types align, dependencies play,
Our tracker hops on a brighter way!
So here we cheer, with joy we sing,
For cleaner code and the joy it brings! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Aug 24 '24 09:08 coderabbitai[bot]

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@azure/[email protected] filesystem Transitive: environment, network +31 14.8 MB azure-sdk
npm/@babel/[email protected] environment, filesystem, unsafe Transitive: shell +44 11.3 MB nicolo-ribaudo
npm/@babel/[email protected] Transitive: environment, filesystem, shell, unsafe +147 18.3 MB existentialism, hzoo, jlhwung, ...1 more
npm/@eslint/[email protected] filesystem, unsafe 0 652 kB eslintbot
npm/@humanwhocodes/[email protected] None 0 61.5 kB nzakas
npm/@nodelib/[email protected] filesystem 0 22.2 kB mrmlnc
npm/@nodelib/[email protected] None 0 26.4 kB mrmlnc
npm/@openreplay/[email protected] network +2 4.05 MB deliriumvt
npm/@rollup/[email protected] Transitive: environment +30 6.7 MB shellscape
npm/@rollup/[email protected] filesystem Transitive: environment +13 1.3 MB shellscape
npm/@rollup/[email protected] filesystem Transitive: environment, unsafe +15 2.72 MB shellscape
npm/@types/[email protected] None 0 6.61 kB types
npm/@types/[email protected] None 0 12.5 kB types
npm/@types/[email protected] None 0 3.56 MB types
npm/@typescript-eslint/[email protected] Transitive: environment, filesystem +27 6.62 MB jameshenry
npm/@typescript-eslint/[email protected] Transitive: environment, filesystem +17 1.8 MB jameshenry
npm/[email protected] None 0 24.4 kB rreverser
npm/[email protected] None 0 467 kB marijn
npm/[email protected] eval 0 929 kB esp
npm/[email protected] None 0 17 kB sindresorhus
npm/[email protected] environment, filesystem, network, shell Transitive: eval +35 100 MB aws-sdk-bot
npm/[email protected] None 0 11.1 kB juliangruber
npm/[email protected] environment, filesystem, shell 0 21.2 kB satazor
npm/[email protected] environment 0 42.4 kB qix
npm/[email protected] None 0 106 kB eslint
npm/[email protected] None 0 19.9 kB lydell
npm/[email protected] None 0 18.2 kB lydell
npm/[email protected] None 0 58.3 kB jounqin
npm/[email protected] None 0 146 kB eslintbot
npm/[email protected] None 0 358 kB mysticatea
npm/[email protected] filesystem Transitive: environment, eval, unsafe +24 7.43 MB eslintbot
npm/[email protected] filesystem 0 2.85 MB eslintbot
npm/[email protected] None 0 76.4 kB eslintbot
npm/[email protected] None 0 986 kB michaelficarra
npm/[email protected] None 0 13.5 kB michaelficarra
npm/[email protected] environment, filesystem, network Transitive: eval, unsafe +63 2.21 MB wesleytodd
npm/[email protected] None 0 39.9 kB dgreensp
npm/[email protected] None 0 38.2 kB matteo.collina
npm/[email protected] filesystem 0 25.6 kB royriojas
npm/[email protected] None 0 11.8 kB sindresorhus
npm/[email protected] filesystem 0 30 kB royriojas
npm/[email protected] None 0 27.2 kB webreflection
npm/[email protected] None 0 7.72 kB phated
npm/[email protected] None 0 6.29 kB ahmadnassri
npm/[email protected] filesystem 0 55.1 kB isaacs
npm/[email protected] None 0 46.3 kB sindresorhus
npm/[email protected] None 0 237 kB orling
npm/[email protected] None 0 48.9 kB kael
npm/[email protected] None 0 4.87 kB sindresorhus
npm/[email protected] None 0 3.76 kB isaacs
npm/[email protected] None 0 13.6 kB phated
npm/[email protected] Transitive: environment, eval, filesystem, network, shell, unsafe +45 6.85 MB simenb
npm/[email protected] Transitive: environment, eval, filesystem, network, shell, unsafe +125 5.32 MB simenb
npm/[email protected] None 0 1.09 MB yaozilong
npm/[email protected] None 0 405 kB vitaly
npm/[email protected] None 0 24.9 kB gkz
npm/[email protected] Transitive: environment, filesystem, shell +29 1.42 MB okonet
npm/[email protected] filesystem 0 7.02 kB sindresorhus
npm/[email protected] None 0 34.9 kB isaacs
npm/[email protected] None 0 4.05 kB isaacs
npm/[email protected] None 0 50.2 kB gkz
npm/[email protected] None 0 7.75 kB sindresorhus
npm/[email protected] None 0 7.24 kB sindresorhus
npm/[email protected] None 0 3.92 kB sindresorhus
npm/[email protected] Transitive: environment, filesystem, network +33 12.5 MB jonasgloning
npm/[email protected] network Transitive: environment +3 3.37 MB jonasgloning
npm/[email protected] None 0 9.58 kB bpscott
npm/[email protected] environment, filesystem, unsafe 0 11.6 MB prettier-bot
npm/[email protected] environment, filesystem, unsafe 0 11.2 MB prettier-bot
npm/[email protected] None 0 32.4 kB mathias
npm/[email protected] filesystem 0 17.3 kB isaacs
npm/[email protected] environment, filesystem, unsafe +1 6.88 MB lukastaegert
npm/[email protected] None 0 6.56 kB feross
npm/[email protected] None 0 2.56 kB kevva
npm/[email protected] filesystem, network 0 226 kB eemeli
npm/[email protected] None 0 4.03 kB sindresorhus
npm/[email protected] None 0 21.2 kB gkz
npm/[email protected] None 0 470 kB garycourt
npm/[email protected] environment 0 9.97 kB isaacs
npm/[email protected] filesystem, network Transitive: environment +29 1.87 MB dabh
npm/[email protected] None 0 10.6 kB jonschlinkert

🚮 Removed packages: npm/[email protected]), npm/[email protected]), npm/[email protected]), npm/[email protected])

View full report↗︎

socket-security[bot] avatar Aug 24 '24 09:08 socket-security[bot]

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Install scripts npm/[email protected]
  • Install script: postinstall
  • Source: node scripts/warn-maintenance-mode.js
🚫

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

socket-security[bot] avatar Aug 24 '24 09:08 socket-security[bot]

As a note:

There was a dependency on @apollo/client that was previously unused and seemed a leftover.

andreialecu avatar Aug 24 '24 09:08 andreialecu

last graphql stuff should be in dev, but looks like there's too many conflicts. Can you perhaps simply create new PR and cherry pick your commits unless you want to rebase?

nick-delirium avatar Aug 26 '24 08:08 nick-delirium

closed for inactivity

nick-delirium avatar Nov 14 '24 13:11 nick-delirium