-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
…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.
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…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.
No description provided.