Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulling feat/news-list-cache into develop #924

Merged
merged 18 commits into from
Nov 22, 2024
Merged

Conversation

github-actions[bot]
Copy link
Contributor

No description provided.

…on operation type

The authLink file is added to the project, which sets the X-GraphQL-Method header in the request headers based on whether the operation is a mutation or a query. This enhancement improves the handling of GraphQL requests by providing additional context information in the headers.
…use new custom hooks for better code organization and readability

The Apollo client initialization in the AppProviders component has been refactored to use the new custom hooks useApolloClientCache and useGraphqlClient from the @dictybase/data-access package. This change improves code organization and readability by separating concerns and making the component more maintainable.
…ency

The @dictybase/data-access package is added as a dependency to the dicty-frontpage application to provide access to data-related functionalities.
…authentication purposes

The authLink is added to the ApolloClient link chain to ensure that all GraphQL requests pass through the authentication middleware. This enhances security and ensures that only authorized users can access the GraphQL endpoints.
The changes introduce support for schema versioning in the Apollo client cache. This allows for the restoration of the cache based on the schema version. If the current version matches the latest version, the cache is restored. Otherwise, the outdated persisted cache is purged, and the application marks itself as having updated to the latest version. This ensures data consistency and integrity when working with different schema versions.
…ientCache function

The default value for the storage parameter in the useApolloClientCache function is now set to storageType.LOCAL. This change ensures that the function will not throw an error if the storage parameter is not provided when the function is called.
The commit adds unit tests for the isMutation function in the authLink module. This ensures that the function behaves as expected for both mutation and query scenarios, improving the reliability and maintainability of the codebase.
…ns object outside of useApolloClientCache call

The cacheOptions object is now defined outside of the useApolloClientCache call, which improves readability and maintainability of the code. This change optimizes the cache initialization process in the App component.
…iles

The test file useCreateApolloClient.test.tsx and implementation file useCreateApolloClient.tsx were removed as they were no longer needed in the project. This cleanup helps maintain a clean codebase and reduces unnecessary clutter.
The "@dictybase/data-access" package has been added as a dependency in the genome-page application to provide access to data-related functionalities. This addition enhances the application's capabilities by enabling it to interact with data sources efficiently.
…new data-access package for improved modularity and maintainability

The Apollo client initialization in the AppProviders component has been refactored to use the useApolloClientCache and useGraphqlClient hooks from the @dictybase/data-access package. This change improves modularity and maintainability by separating concerns related to caching and GraphQL client setup.
…e components

Refactor the loading and error handling logic in the genome-page components
to improve consistency and maintainability. The changes involve removing
redundant code and consolidating the handling of loading states and errors
across different page components for a more streamlined and organized codebase.
… cache management

The changes were made to improve cache management in the application by adding the storageType and key properties to the cacheOptions object. This allows for more control and customization of caching behavior, enhancing the overall performance and user experience.
Copy link

coderabbitai bot commented Nov 22, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

…in next.config.js

The @dictybase/data-access module is added as a transpiled module in the next.config.js file to ensure that it is properly transpiled by Next.js. This allows the module to be used seamlessly within the publication app without any transpilation issues.
…new data-access package for better code organization and maintainability

The Apollo client initialization in the AppProviders component has been refactored to use the new data-access package from "@dictybase/data-access". This change improves code organization by centralizing GraphQL client setup and cache configuration, making it easier to maintain and update in the future.
…etter handling of usePublicationQuery result

The code now uses the ts-pattern library to perform pattern matching on the result of the usePublicationQuery hook. This change improves the readability and maintainability of the code by providing a more structured way to handle different states (loading, error, data) returned by the query.
The test files and hook files for creating Apollo clients were removed as they were no longer needed in the project. This cleanup helps maintain a cleaner codebase and reduces unnecessary clutter in the repository.
…or better readability

The useGraphqlClient function call has been reformatted to improve readability by placing each argument on a new line. This makes the code easier to understand and maintain.
@ktun95 ktun95 linked an issue Nov 22, 2024 that may be closed by this pull request
@ktun95 ktun95 merged commit 91c5d53 into develop Nov 22, 2024
7 checks passed
@ktun95 ktun95 deleted the feat/news-list-cache branch November 22, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

News List Caching
1 participant