-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
* feat: deepPartial * fix: rem gate
Important Auto Review SkippedAuto 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 To trigger a single review, invoke the WalkthroughThe overarching modification across these updates focuses on enhancing type specificity and flexibility within GraphQL queries and subscriptions. This is achieved by transitioning from Changes
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? 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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
There was a problem hiding this 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
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 utilizeDeepPartial
.- 17-17: The update of the
fields
parameter type fromPartial<GQLFeatureFlags>
toDeepPartial<GQLFeatureFlags>
in thefeatureFlagsQueryString
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 thefeatureFlags
function to useDeepPartial<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 utilizeDeepPartial
instead ofPartial
. This change supports the PR's goal of enhancing type specificity and flexibility.- 19-19: Updating the
fields
parameter type toDeepPartial<GQLToken>
in thecommunityPoolQueryString
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 thecommunityPool
function to useDeepPartial<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 utilizeDeepPartial
. 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 toDeepPartial<GQLMarkPriceCandle>
in themarkPriceCandlesQueryString
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 themarkPriceCandles
function to useDeepPartial<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 utilizeDeepPartial
. 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 toDeepPartial<GQLUser>
in theusersQueryString
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 theusers
function to useDeepPartial<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 utilizeDeepPartial
. 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 toDeepPartial<GQLSpotPool>
in thespotPoolsQueryString
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 thespotPools
function to useDeepPartial<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 utilizeDeepPartial
. 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 toDeepPartial<GQLMarkPriceCandle>
in themarkPriceCandlesSubscriptionQueryString
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 themarkPriceCandlesSubscription
function to useDeepPartial<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 utilizeDeepPartial
. 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 toDeepPartial<GQLPerpMarket>
in theperpMarketSubscriptionQueryString
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 theperpMarketSubscription
function to useDeepPartial<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 utilizeDeepPartial
. 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 toDeepPartial<GQLOraclePrice>
in theoraclePricesSubscriptionQueryString
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 theoraclePricesSubscription
function to useDeepPartial<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 utilizeDeepPartial
. 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 toDeepPartial<GQLValidator>
in thevalidatorsQueryString
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 thevalidators
function to useDeepPartial<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 thefields
parameter in the functions within this file.- 20-20: The change from
Partial<GQLUnbonding>
toDeepPartial<GQLUnbonding>
for thefields
parameter in theunbondingsQueryString
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 thefields
parameter in theunbondings
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 thefields
parameter in the functions within this file.- 20-20: Updating the type of the
fields
parameter in thedelegationsQueryString
function toDeepPartial<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 thefields
parameter in thedelegations
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 thefields
parameter in the mutation functions within this file.- 17-19: The direct acceptance of
GQLMarketingMutationGqlUpdateTwitterUserArgs
for theargs
parameter in themarketingMutationString
function, along with the update toDeepPartial<GQLTwitterUser>
for thefields
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 acceptGQLMarketingMutationGqlUpdateTwitterUserArgs
and useDeepPartial<GQLTwitterUser>
for thefields
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 thefields
parameter in the subscription functions within this file.- 17-18: Updating the types of
args
andfields
parameters in theperpPositionsSubscriptionQueryString
function toGQLSubscriptionGqlPerpPositionsArgs
andDeepPartial<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 useGQLSubscriptionGqlPerpPositionsArgs
forargs
andDeepPartial<GQLPerpPosition>
forfields
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 thefields
parameter in the functions within this file.- 20-20: Updating the type of the
fields
parameter in thespotPoolSwapQueryString
function toDeepPartial<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 thefields
parameter in thespotPoolSwap
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 thefields
parameter in the functions within this file.- 20-20: Updating the type of the
fields
parameter in theredelegationsQueryString
function toDeepPartial<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 thefields
parameter in theredelegations
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 thefields
parameter in the functions within this file.- 20-20: Updating the type of the
fields
parameter in thespotPoolExitedQueryString
function toDeepPartial<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 thefields
parameter in thespotPoolExited
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 thefields
parameter in the functions within this file.- 20-20: Updating the type of the
fields
parameter in thespotPoolJoinedQueryString
function toDeepPartial<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 thefields
parameter in thespotPoolJoined
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 thefields
parameter in the functions within this file.- 20-20: Updating the type of the
fields
parameter in thespotPoolCreatedQueryString
function toDeepPartial<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 thefields
parameter in thespotPoolCreated
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 thefields
parameter in the functions within this file.- 20-20: Updating the type of the
fields
parameter in thespotLpPositionsQueryString
function toDeepPartial<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 thefields
parameter in thespotLpPositions
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>
toDeepPartial<GQLDistributionCommission>
in thedistributionCommissionsQueryString
function'sfields
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 thedistributionCommissions
function'sfields
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 theGqlWasmFields
type and its nesteduserContracts
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 theOracleFields
type and its nested properties (oraclePrices
andoracles
) 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 theInflationFields
type and its nested properties (distributions
andinflations
) 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 theIbcFields
type and its nested properties (ibcChannels
andibcTransfers
) 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 theGovernanceFields
type and its nested properties (govDeposits
,govProposals
, andgovVotes
) 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 theQueryMarketingArgs
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 theMarketingFields
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 theGQLPerpFields
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 theGQLStatsFields
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 theDeepPartial<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 thefields
parameter in thecommunityPool
method of theIHeartMonitor
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 thefields
parameter in thedelegations
method of theIHeartMonitor
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 useDeepPartial<GQLDistributionCommission>
for thefields
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 ofDeepPartial<GQLFeatureFlags>
for the optionalfields
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 thegovernance
method of theIHeartMonitor
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.
🎉 This PR is included in version 3.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
feat: deepPartial
fix: rem gate
Summary by CodeRabbit
Chores
New Features
Refactor
DeepPartial
instead ofPartial
for more specific typing and deeper partial object structures.Documentation