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

feat: deepPartial (#329) #330

Merged
merged 4 commits into from
Mar 5, 2024
Merged

feat: deepPartial (#329) #330

merged 4 commits into from
Mar 5, 2024

Conversation

cgilbe27
Copy link
Contributor

@cgilbe27 cgilbe27 commented Mar 2, 2024

  • feat: deepPartial

  • fix: rem gate

Summary by CodeRabbit

  • Chores

    • Temporarily disabled SonarQube Quality Gate action to address reliability issues.
  • New Features

    • Added new type aliases for better handling of optional types in GraphQL queries.
  • Refactor

    • Updated various GraphQL queries and subscriptions to use DeepPartial instead of Partial for more specific typing and deeper partial object structures.
    • Reordered exports in the GraphQL query index to improve module organization.
  • Documentation

    • No visible changes to end-users.

* feat: deepPartial

* fix: rem gate
Copy link
Contributor

coderabbitai bot commented Mar 2, 2024

Important

Auto Review Skipped

Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

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

Walkthrough

The overarching modification across these updates focuses on enhancing type specificity and flexibility within GraphQL queries and subscriptions. This is achieved by transitioning from Partial to DeepPartial types, allowing for more detailed partial object structures. Additionally, there's a reorganization of exports and an update to argument types in some functions, aiming to improve the reliability and depth of data manipulation capabilities across various modules.

Changes

Files Change Summary
.github/workflows/test-ts-sdk.yaml Commented out the SonarQube Quality Gate action due to reliability issues.
src/gql/.../heart-monitor.ts, src/gql/.../marketing.ts, src/gql/query/..., src/gql/subscription/..., src/gql/utils/consts.ts Updated types from Partial to DeepPartial for enhanced specificity and flexibility in GraphQL structures. Adjusted argument types in certain functions for better data manipulation. Added new type aliases in consts.ts.
src/gql/query/index.ts Reordered exports for improved module organization.

"In the realm of code where the data trees grow,
🐇 A rabbit hopped in, with updates in tow.
From Partial to Deep, it made the leap,
Enhancing the queries, so detailed and deep.
🌟 With every hop and every skip,
It brought more depth to the data trip.
In the garden of GraphQL, it danced with glee,
Celebrating the changes, free as can be."
🎉🐰✨

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-tests 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 tests 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 tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

github-actions bot commented Mar 2, 2024

Lines Statements Branches Functions
Coverage: 89%
91.2% (1265/1387) 86.28% (541/627) 78.28% (310/396)

@k-yang
Copy link
Member

k-yang commented Mar 5, 2024

@coderabbitai review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3a5c0c4 and 599041f.
Files selected for processing (32)
  • .github/workflows/test-ts-sdk.yaml (1 hunks)
  • src/gql/heart-monitor/heart-monitor.ts (4 hunks)
  • src/gql/mutation/marketing.ts (2 hunks)
  • src/gql/query/communityPool.ts (2 hunks)
  • src/gql/query/delegations.ts (3 hunks)
  • src/gql/query/distributionCommissions.ts (3 hunks)
  • src/gql/query/featureFlags.ts (3 hunks)
  • src/gql/query/governance.ts (2 hunks)
  • src/gql/query/ibc.ts (2 hunks)
  • src/gql/query/index.ts (1 hunks)
  • src/gql/query/inflation.ts (2 hunks)
  • src/gql/query/markPriceCandles.ts (3 hunks)
  • src/gql/query/marketing.ts (2 hunks)
  • src/gql/query/oracle.ts (2 hunks)
  • src/gql/query/perp.ts (2 hunks)
  • src/gql/query/redelegations.ts (3 hunks)
  • src/gql/query/spotLpPositions.ts (3 hunks)
  • src/gql/query/spotPoolCreated.ts (3 hunks)
  • src/gql/query/spotPoolExited.ts (3 hunks)
  • src/gql/query/spotPoolJoined.ts (3 hunks)
  • src/gql/query/spotPoolSwap.ts (3 hunks)
  • src/gql/query/spotPools.ts (3 hunks)
  • src/gql/query/stats.ts (2 hunks)
  • src/gql/query/unbondings.ts (3 hunks)
  • src/gql/query/users.ts (3 hunks)
  • src/gql/query/validators.ts (3 hunks)
  • src/gql/query/wasm.ts (2 hunks)
  • src/gql/subscription/markPriceCandlesSubscription.ts (2 hunks)
  • src/gql/subscription/oraclePricesSubscription.ts (3 hunks)
  • src/gql/subscription/perpMarketSubscription.ts (2 hunks)
  • src/gql/subscription/perpPositionsSubscription.ts (2 hunks)
  • src/gql/utils/consts.ts (1 hunks)
Additional comments: 85
src/gql/query/featureFlags.ts (3)
  • 8-8: The addition of DeepPartial to the import statement is correct and aligns with the PR's objective to enhance type specificity by allowing deeper nesting of optional properties. This change is crucial for the subsequent modifications in the function signatures to utilize DeepPartial.
  • 17-17: The update of the fields parameter type from Partial<GQLFeatureFlags> to DeepPartial<GQLFeatureFlags> in the featureFlagsQueryString function is consistent with the PR's goal. This change allows for more granular control over the partiality of objects, enhancing the flexibility and specificity of the SDK's handling of partial objects.
  • 30-30: Similarly, the modification of the fields parameter type in the featureFlags function to use DeepPartial<GQLFeatureFlags> is appropriate and aligns with the PR's objectives. This ensures that the function can handle more complex and deeply nested optional properties without compromising type safety.
src/gql/query/index.ts (1)
  • 13-22: The reordering of exports in the index.ts file appears to be a structural change aimed at improving the organization and readability of the code. This kind of change is generally benign in terms of functionality but can enhance the maintainability of the codebase by grouping related exports together or ordering them logically. Ensure that all referenced exports are correctly updated across the codebase to reflect this new order.
src/gql/query/communityPool.ts (3)
  • 9-9: The addition of DeepPartial to the import statement is correct and necessary for the subsequent modifications in the function signatures to utilize DeepPartial instead of Partial. This change supports the PR's goal of enhancing type specificity and flexibility.
  • 19-19: Updating the fields parameter type to DeepPartial<GQLToken> in the communityPoolQueryString function is consistent with the PR's objectives. This allows for more detailed control over the partiality of objects, particularly beneficial for GraphQL queries that may require deep nesting of optional properties.
  • 33-33: The modification of the fields parameter type in the communityPool function to use DeepPartial<GQLToken> aligns with the PR's goal of improving the SDK's handling of partial objects. This ensures that the function can handle more complex and deeply nested optional properties effectively.
src/gql/query/markPriceCandles.ts (3)
  • 9-9: The inclusion of DeepPartial in the import statement is appropriate and necessary for the changes made in the function signatures to utilize DeepPartial. This supports the PR's goal of allowing deeper nesting of optional properties in GraphQL queries.
  • 19-19: The update of the fields parameter type to DeepPartial<GQLMarkPriceCandle> in the markPriceCandlesQueryString function is in line with the PR's objectives. This change enhances the flexibility and specificity of the SDK's handling of partial objects, particularly useful for complex GraphQL queries.
  • 33-33: Similarly, the modification of the fields parameter type in the markPriceCandles function to use DeepPartial<GQLMarkPriceCandle> aligns with the PR's goal. This ensures that the function can handle more complex and deeply nested optional properties effectively.
src/gql/query/users.ts (3)
  • 10-10: The addition of DeepPartial to the import statement is correct and supports the subsequent modifications in the function signatures to utilize DeepPartial. This change is in line with the PR's goal of enhancing type specificity and flexibility in handling partial objects.
  • 20-20: Updating the fields parameter type to DeepPartial<GQLUser> in the usersQueryString function is consistent with the PR's objectives. This allows for more detailed control over the partiality of objects, which is particularly beneficial for GraphQL queries that may require deep nesting of optional properties.
  • 39-39: The modification of the fields parameter type in the users function to use DeepPartial<GQLUser> aligns with the PR's goal of improving the SDK's handling of partial objects. This ensures that the function can handle more complex and deeply nested optional properties effectively.
src/gql/query/spotPools.ts (3)
  • 10-10: The inclusion of DeepPartial in the import statement is appropriate and necessary for the changes made in the function signatures to utilize DeepPartial. This supports the PR's goal of allowing deeper nesting of optional properties in GraphQL queries.
  • 20-20: The update of the fields parameter type to DeepPartial<GQLSpotPool> in the spotPoolsQueryString function is in line with the PR's objectives. This change enhances the flexibility and specificity of the SDK's handling of partial objects, particularly useful for complex GraphQL queries.
  • 39-39: Similarly, the modification of the fields parameter type in the spotPools function to use DeepPartial<GQLSpotPool> aligns with the PR's goal. This ensures that the function can handle more complex and deeply nested optional properties effectively.
src/gql/subscription/markPriceCandlesSubscription.ts (3)
  • 9-9: The addition of DeepPartial to the import statement is correct and supports the subsequent modifications in the function signatures to utilize DeepPartial. This change is in line with the PR's goal of enhancing type specificity and flexibility in handling partial objects in subscriptions.
  • 13-14: Updating the fields parameter type to DeepPartial<GQLMarkPriceCandle> in the markPriceCandlesSubscriptionQueryString function is consistent with the PR's objectives. This allows for more detailed control over the partiality of objects, which is particularly beneficial for GraphQL subscriptions that may require deep nesting of optional properties.
  • 28-30: The modification of the fields parameter type in the markPriceCandlesSubscription function to use DeepPartial<GQLMarkPriceCandle> aligns with the PR's goal of improving the SDK's handling of partial objects in subscriptions. This ensures that the function can handle more complex and deeply nested optional properties effectively.
src/gql/subscription/perpMarketSubscription.ts (3)
  • 9-9: The inclusion of DeepPartial in the import statement is appropriate and necessary for the changes made in the function signatures to utilize DeepPartial. This supports the PR's goal of allowing deeper nesting of optional properties in GraphQL subscriptions.
  • 17-18: The update of the fields parameter type to DeepPartial<GQLPerpMarket> in the perpMarketSubscriptionQueryString function is in line with the PR's objectives. This change enhances the flexibility and specificity of the SDK's handling of partial objects in subscriptions, particularly useful for complex GraphQL queries.
  • 32-34: Similarly, the modification of the fields parameter type in the perpMarketSubscription function to use DeepPartial<GQLPerpMarket> aligns with the PR's goal. This ensures that the function can handle more complex and deeply nested optional properties effectively in the context of subscriptions.
src/gql/subscription/oraclePricesSubscription.ts (3)
  • 9-9: The addition of DeepPartial to the import statement is correct and supports the subsequent modifications in the function signatures to utilize DeepPartial. This change is in line with the PR's goal of enhancing type specificity and flexibility in handling partial objects in subscriptions.
  • 18-18: Updating the fields parameter type to DeepPartial<GQLOraclePrice> in the oraclePricesSubscriptionQueryString function is consistent with the PR's objectives. This allows for more detailed control over the partiality of objects, which is particularly beneficial for GraphQL subscriptions that may require deep nesting of optional properties.
  • 34-34: The modification of the fields parameter type in the oraclePricesSubscription function to use DeepPartial<GQLOraclePrice> aligns with the PR's goal of improving the SDK's handling of partial objects in subscriptions. This ensures that the function can handle more complex and deeply nested optional properties effectively.
src/gql/query/validators.ts (3)
  • 10-10: The inclusion of DeepPartial in the import statement is appropriate and necessary for the changes made in the function signatures to utilize DeepPartial. This supports the PR's goal of allowing deeper nesting of optional properties in GraphQL queries.
  • 20-20: The update of the fields parameter type to DeepPartial<GQLValidator> in the validatorsQueryString function is in line with the PR's objectives. This change enhances the flexibility and specificity of the SDK's handling of partial objects, particularly useful for complex GraphQL queries.
  • 39-39: Similarly, the modification of the fields parameter type in the validators function to use DeepPartial<GQLValidator> aligns with the PR's goal. This ensures that the function can handle more complex and deeply nested optional properties effectively.
src/gql/query/unbondings.ts (3)
  • 10-10: The import of DeepPartial is correctly added to support the new type specificity requirements for the fields parameter in the functions within this file.
  • 20-20: The change from Partial<GQLUnbonding> to DeepPartial<GQLUnbonding> for the fields parameter in the unbondingsQueryString function is aligned with the PR's objective to allow deeper nesting of optional properties. This enhances type safety and flexibility in GraphQL queries.
  • 39-39: Similarly, the update to use DeepPartial<GQLUnbonding> for the fields parameter in the unbondings function is consistent with the PR's goals. It ensures that the function can handle more complex and nested optional properties effectively.
src/gql/query/delegations.ts (3)
  • 10-10: The addition of DeepPartial to the imports is correctly done to support the enhanced type specificity for the fields parameter in the functions within this file.
  • 20-20: Updating the type of the fields parameter in the delegationsQueryString function to DeepPartial<GQLDelegation> is a positive change. It aligns with the PR's objective to improve type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL queries.
  • 39-39: The change to DeepPartial<GQLDelegation> for the fields parameter in the delegations function is consistent with the PR's goals. This update ensures that the function can handle more complex and nested optional properties effectively.
src/gql/mutation/marketing.ts (3)
  • 9-9: The import of DeepPartial is correctly added, supporting the new type specificity requirements for the fields parameter in the mutation functions within this file.
  • 17-19: The direct acceptance of GQLMarketingMutationGqlUpdateTwitterUserArgs for the args parameter in the marketingMutationString function, along with the update to DeepPartial<GQLTwitterUser> for the fields parameter, is a significant improvement. It aligns with the PR's objective to enhance type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL mutations.
  • 35-38: Similarly, the update in the marketingMutation function to directly accept GQLMarketingMutationGqlUpdateTwitterUserArgs and use DeepPartial<GQLTwitterUser> for the fields parameter is consistent with the PR's goals. This ensures that the mutation can handle more complex and nested optional properties effectively.
src/gql/subscription/perpPositionsSubscription.ts (3)
  • 9-9: The addition of DeepPartial to the imports is correctly done to support the enhanced type specificity for the fields parameter in the subscription functions within this file.
  • 17-18: Updating the types of args and fields parameters in the perpPositionsSubscriptionQueryString function to GQLSubscriptionGqlPerpPositionsArgs and DeepPartial<GQLPerpPosition> respectively, is a positive change. It aligns with the PR's objective to improve type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL subscriptions.
  • 30-32: Similarly, the update in the perpPositionsSubscription function to use GQLSubscriptionGqlPerpPositionsArgs for args and DeepPartial<GQLPerpPosition> for fields is consistent with the PR's goals. This ensures that the subscription can handle more complex and nested optional properties effectively.
src/gql/query/spotPoolSwap.ts (3)
  • 10-10: The import of DeepPartial is correctly added to support the new type specificity requirements for the fields parameter in the functions within this file.
  • 20-20: Updating the type of the fields parameter in the spotPoolSwapQueryString function to DeepPartial<GQLSpotPoolSwap> is a positive change. It aligns with the PR's objective to improve type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL queries.
  • 39-39: The change to DeepPartial<GQLSpotPoolSwap> for the fields parameter in the spotPoolSwap function is consistent with the PR's goals. This update ensures that the function can handle more complex and nested optional properties effectively.
src/gql/query/redelegations.ts (3)
  • 10-10: The addition of DeepPartial to the imports is correctly done to support the enhanced type specificity for the fields parameter in the functions within this file.
  • 20-20: Updating the type of the fields parameter in the redelegationsQueryString function to DeepPartial<GQLRedelegation> is a positive change. It aligns with the PR's objective to improve type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL queries.
  • 39-39: The change to DeepPartial<GQLRedelegation> for the fields parameter in the redelegations function is consistent with the PR's goals. This update ensures that the function can handle more complex and nested optional properties effectively.
src/gql/query/spotPoolExited.ts (3)
  • 10-10: The import of DeepPartial is correctly added to support the new type specificity requirements for the fields parameter in the functions within this file.
  • 20-20: Updating the type of the fields parameter in the spotPoolExitedQueryString function to DeepPartial<GQLSpotPoolExited> is a positive change. It aligns with the PR's objective to improve type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL queries.
  • 39-39: The change to DeepPartial<GQLSpotPoolExited> for the fields parameter in the spotPoolExited function is consistent with the PR's goals. This update ensures that the function can handle more complex and nested optional properties effectively.
src/gql/query/spotPoolJoined.ts (3)
  • 10-10: The addition of DeepPartial to the imports is correctly done to support the enhanced type specificity for the fields parameter in the functions within this file.
  • 20-20: Updating the type of the fields parameter in the spotPoolJoinedQueryString function to DeepPartial<GQLSpotPoolJoined> is a positive change. It aligns with the PR's objective to improve type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL queries.
  • 39-39: The change to DeepPartial<GQLSpotPoolJoined> for the fields parameter in the spotPoolJoined function is consistent with the PR's goals. This update ensures that the function can handle more complex and nested optional properties effectively.
src/gql/query/spotPoolCreated.ts (3)
  • 10-10: The import of DeepPartial is correctly added to support the new type specificity requirements for the fields parameter in the functions within this file.
  • 20-20: Updating the type of the fields parameter in the spotPoolCreatedQueryString function to DeepPartial<GQLSpotPoolCreated> is a positive change. It aligns with the PR's objective to improve type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL queries.
  • 39-39: The change to DeepPartial<GQLSpotPoolCreated> for the fields parameter in the spotPoolCreated function is consistent with the PR's goals. This update ensures that the function can handle more complex and nested optional properties effectively.
src/gql/query/spotLpPositions.ts (3)
  • 10-10: The addition of DeepPartial to the imports is correctly done to support the enhanced type specificity for the fields parameter in the functions within this file.
  • 20-20: Updating the type of the fields parameter in the spotLpPositionsQueryString function to DeepPartial<GQLSpotLpPosition> is a positive change. It aligns with the PR's objective to improve type specificity and flexibility, allowing for deeper nesting of optional properties in GraphQL queries.
  • 39-39: The change to DeepPartial<GQLSpotLpPosition> for the fields parameter in the spotLpPositions function is consistent with the PR's goals. This update ensures that the function can handle more complex and nested optional properties effectively.
src/gql/query/distributionCommissions.ts (3)
  • 10-10: The import of DeepPartial is correctly added to enable more specific typing for partial object structures. This change aligns with the PR's objective to enhance type specificity and flexibility.
  • 20-20: The change from Partial<GQLDistributionCommission> to DeepPartial<GQLDistributionCommission> in the distributionCommissionsQueryString function's fields parameter is appropriate. It allows for deeper nesting of optional properties, improving the SDK's flexibility without compromising type safety.
  • 40-40: Similarly, the update to DeepPartial<GQLDistributionCommission> in the distributionCommissions function's fields parameter is consistent with the PR's goal. This modification enhances the function's ability to handle more complex partial structures.
src/gql/query/wasm.ts (2)
  • 9-9: The import of DeepPartial is correctly added, supporting the PR's objective to enable deeper partial object structures.
  • 20-21: The update to DeepPartial in the GqlWasmFields type and its nested userContracts property is appropriate. It ensures a more comprehensive type definition for nested structures, aligning with the PR's goals.
src/gql/query/oracle.ts (2)
  • 12-12: The import of DeepPartial is correctly added, supporting the PR's objective to enable deeper partial object structures.
  • 24-26: The update to DeepPartial in the OracleFields type and its nested properties (oraclePrices and oracles) is appropriate. It ensures a more comprehensive partial typing for these fields, aligning with the PR's goals.
src/gql/query/inflation.ts (2)
  • 12-12: The import of DeepPartial is correctly added, supporting the PR's objective to enable deeper partial object structures.
  • 24-26: The update to DeepPartial in the InflationFields type and its nested properties (distributions and inflations) is appropriate. It ensures a deeper level of partiality in the type definitions, aligning with the PR's goals.
src/gql/query/ibc.ts (2)
  • 11-11: The import of DeepPartial is correctly added, supporting the PR's objective to enable deeper partial object structures.
  • 23-25: The update to DeepPartial in the IbcFields type and its nested properties (ibcChannels and ibcTransfers) is appropriate. It ensures a more comprehensive partial type definition, aligning with the PR's goals.
src/gql/query/governance.ts (2)
  • 13-13: The import of DeepPartial is correctly added, supporting the PR's objective to enable deeper partial object structures.
  • 26-29: The update to DeepPartial in the GovernanceFields type and its nested properties (govDeposits, govProposals, and govVotes) is appropriate. It ensures a deeper level of partiality in the type definitions, aligning with the PR's goals.
src/gql/query/marketing.ts (3)
  • 3-3: The import of DeepPartial is correctly added, supporting the PR's objective to enable deeper partial object structures.
  • 22-25: The update to DeepPartial in the QueryMarketingArgs interface for its properties is appropriate. It ensures a more specific typing approach, aligning with the PR's goals.
  • 32-36: Similarly, the update to DeepPartial in the MarketingFields type and its nested properties is appropriate. It ensures a deeper level of partiality in the type definitions, aligning with the PR's goals.
src/gql/query/perp.ts (2)
  • 20-20: The import of DeepPartial is correctly added, supporting the PR's objective to enable deeper partial object structures.
  • 36-42: The update to DeepPartial in the GQLPerpFields type and its nested properties is appropriate. It indicates a deeper level of partiality in the type definitions, aligning with the PR's goals.
src/gql/query/stats.ts (2)
  • 27-27: The import of DeepPartial is correctly added, supporting the PR's objective to enable deeper partial object structures.
  • 44-51: The update to DeepPartial in the GQLStatsFields type and its nested properties is appropriate. It ensures a deeper level of partiality for the fields within the type, aligning with the PR's goals.
src/gql/utils/consts.ts (2)
  • 3-18: The newly introduced type aliases (OptionalArrayOr, OptionalUndefinedOr, OptionalNullOr, OptionalStringOr, OptionalNumberOr, OptionalBooleanOr) are well-defined and correctly utilize TypeScript's conditional types to provide flexibility in handling optional types. These type aliases enhance the SDK's ability to specify optional fields more granularly, which aligns with the PR's objectives.
  • 20-40: The DeepPartial<T> type is a significant addition that recursively applies partiality to all properties of an object, including nested objects. This implementation correctly leverages the newly defined type aliases to handle various cases (strings, numbers, booleans, null, undefined, arrays, and objects). This approach ensures that the DeepPartial<T> type can be applied to complex data structures, aligning with the PR's goal of enhancing type specificity and flexibility in the SDK.
src/gql/heart-monitor/heart-monitor.ts (5)
  • 123-124: The use of DeepPartial<GQLToken> as the type for the fields parameter in the communityPool method of the IHeartMonitor interface correctly applies the PR's objective of allowing deeper partial object structures. This change enhances the flexibility of specifying optional fields in GraphQL queries.
  • 128-129: The use of DeepPartial<GQLDelegation> as the type for the fields parameter in the delegations method of the IHeartMonitor interface aligns with the PR's goal. It allows for more granular control over the partiality of objects, which is particularly useful in the context of delegations where nested optional properties may be present.
  • 133-134: The distributionCommissions method's update to use DeepPartial<GQLDistributionCommission> for the fields parameter is consistent with the PR's objectives. This change enables specifying partial structures more deeply and specifically, which is beneficial for handling distribution commission data with optional nested properties.
  • 138-138: The featureFlags method's adoption of DeepPartial<GQLFeatureFlags> for the optional fields parameter is a good application of the PR's enhancements. It allows for specifying optional fields within feature flags more flexibly, accommodating the potential for nested optional properties.
  • 142-143: Using DeepPartial<GovernanceFields> in the governance method of the IHeartMonitor interface is an appropriate application of the PR's changes. It enhances the method's ability to handle governance-related data with optional nested properties, aligning with the goal of increasing type specificity and flexibility.

.github/workflows/test-ts-sdk.yaml Show resolved Hide resolved
@cgilbe27 cgilbe27 merged commit f2bb64d into main Mar 5, 2024
2 checks passed
nibibot pushed a commit that referenced this pull request Mar 5, 2024
## [3.2.0](v3.1.1...v3.2.0) (2024-03-05)

### Features

* deepPartial ([#329](#329)) ([#330](#330)) ([f2bb64d](f2bb64d))

 [skip ci]
@nibibot
Copy link

nibibot commented Mar 5, 2024

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nibibot
Copy link

nibibot commented Mar 6, 2024

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

5 participants