refactor(tracker-graphql): use correct @apollo/client types
Fixes #2504
Summary by CodeRabbit
-
New Features
- Introduced support for the Apollo Client, enhancing integration capabilities.
-
Improvements
- Updated the
createTrackerLinkfunction for better type safety and clarity, aligning with Apollo Client standards.
- Updated the
-
Chores
- Added
@apollo/clientas a peer and development dependency for improved compatibility.
- Added
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.
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?
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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto 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.yamlfile 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.
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected]), npm/[email protected]), npm/[email protected]), npm/[email protected])
🚨 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 | Note | Source | CI |
|---|---|---|---|---|
| Install scripts | npm/[email protected] |
| 🚫 |
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
@SocketSecurity ignore npm/[email protected]
As a note:
There was a dependency on @apollo/client that was previously unused and seemed a leftover.
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?
closed for inactivity