Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ When updating the GraphQL schema in the SDK:
- **Query-specific types**: colocate with their corresponding query files (permits.ts, transactions.ts, swaps.ts, user.ts, reserve.ts, hub.ts, misc.ts)
- Use pattern: `export type InputName = ReturnType<typeof graphql.scalar<'InputName'>>;`
- Exclude fork-related input types unless explicitly needed
- Ensure for all usage of `ReturnType<typeof graphql.scalar<'<input-name>'>>` there is a corresponding input type in `packages/graphql/src/graphql.ts`

4. **Validate:**
- Use `pnpm check` from `packages/graphql` to check integrity of GraphQL documents
7 changes: 7 additions & 0 deletions packages/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ type UserBorrowItem {
input UserBorrowsQueryRequest @oneOf {
userSpoke: UserSpokeInput
userPositionId: UserPositionId
userChains: UserChains
}

input UserBorrowsRequest {
Expand All @@ -1451,6 +1452,11 @@ input UserBorrowsRequestOrderBy @oneOf {
paid: OrderDirection
}

input UserChains {
user: EvmAddress!
chainIds: [ChainId!]!
}

input UserHistoryFilter @oneOf {
spoke: SpokeInput
chainIds: [ChainId!]
Expand Down Expand Up @@ -1594,6 +1600,7 @@ input UserSummaryRequest {
input UserSuppliesQueryRequest @oneOf {
userSpoke: UserSpokeInput
userPositionId: UserPositionId
userChains: UserChains
}

input UserSuppliesRequest {
Expand Down
5 changes: 3 additions & 2 deletions packages/graphql/src/graphql-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ export type introspection_types = {
'UserBalancesRequestFilter': { kind: 'INPUT_OBJECT'; name: 'UserBalancesRequestFilter'; isOneOf: true; inputFields: [{ name: 'chainIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; defaultValue: null }, { name: 'hub'; type: { kind: 'INPUT_OBJECT'; name: 'HubInput'; ofType: null; }; defaultValue: null }, { name: 'spoke'; type: { kind: 'INPUT_OBJECT'; name: 'SpokeInput'; ofType: null; }; defaultValue: null }, { name: 'swappable'; type: { kind: 'INPUT_OBJECT'; name: 'SwappableTokensRequestQuery'; ofType: null; }; defaultValue: null }]; };
'UserBalancesRequestOrderBy': { kind: 'INPUT_OBJECT'; name: 'UserBalancesRequestOrderBy'; isOneOf: true; inputFields: [{ name: 'name'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'balance'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }]; };
'UserBorrowItem': { kind: 'OBJECT'; name: 'UserBorrowItem'; fields: { 'amount': { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'paid': { name: 'paid'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Reserve'; ofType: null; }; } }; }; };
'UserBorrowsQueryRequest': { kind: 'INPUT_OBJECT'; name: 'UserBorrowsQueryRequest'; isOneOf: true; inputFields: [{ name: 'userSpoke'; type: { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; ofType: null; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }]; };
'UserBorrowsQueryRequest': { kind: 'INPUT_OBJECT'; name: 'UserBorrowsQueryRequest'; isOneOf: true; inputFields: [{ name: 'userSpoke'; type: { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; ofType: null; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }, { name: 'userChains'; type: { kind: 'INPUT_OBJECT'; name: 'UserChains'; ofType: null; }; defaultValue: null }]; };
'UserBorrowsRequest': { kind: 'INPUT_OBJECT'; name: 'UserBorrowsRequest'; isOneOf: false; inputFields: [{ name: 'query'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UserBorrowsQueryRequest'; ofType: null; }; }; defaultValue: null }, { name: 'orderBy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UserBorrowsRequestOrderBy'; ofType: null; }; }; defaultValue: "{name: ASC}" }]; };
'UserBorrowsRequestOrderBy': { kind: 'INPUT_OBJECT'; name: 'UserBorrowsRequestOrderBy'; isOneOf: true; inputFields: [{ name: 'name'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'balance'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'apy'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'paid'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }]; };
'UserChains': { kind: 'INPUT_OBJECT'; name: 'UserChains'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'chainIds'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; }; defaultValue: null }]; };
'UserHistoryFilter': { kind: 'INPUT_OBJECT'; name: 'UserHistoryFilter'; isOneOf: true; inputFields: [{ name: 'spoke'; type: { kind: 'INPUT_OBJECT'; name: 'SpokeInput'; ofType: null; }; defaultValue: null }, { name: 'chainIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; defaultValue: null }, { name: 'txHash'; type: { kind: 'INPUT_OBJECT'; name: 'TxHashInput'; ofType: null; }; defaultValue: null }]; };
'UserHistoryItem': { kind: 'UNION'; name: 'UserHistoryItem'; fields: {}; possibleTypes: 'BorrowActivity' | 'LiquidatedActivity' | 'RepayActivity' | 'SupplyActivity' | 'SwapActivity' | 'WithdrawActivity'; };
'UserHistoryRequest': { kind: 'INPUT_OBJECT'; name: 'UserHistoryRequest'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'activityTypes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'ActivityType'; ofType: null; }; }; }; }; defaultValue: "[BORROW, SUPPLY, WITHDRAW, REPAY, SWAP, LIQUIDATED]" }, { name: 'filter'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UserHistoryFilter'; ofType: null; }; }; defaultValue: null }, { name: 'pageSize'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'PageSize'; ofType: null; }; }; defaultValue: "FIFTY" }, { name: 'cursor'; type: { kind: 'SCALAR'; name: 'Cursor'; ofType: null; }; defaultValue: null }]; };
Expand All @@ -194,7 +195,7 @@ export type introspection_types = {
'UserSummaryHistoryItem': { kind: 'OBJECT'; name: 'UserSummaryHistoryItem'; fields: { 'borrows': { name: 'borrows'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FiatAmount'; ofType: null; }; } }; 'date': { name: 'date'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'healthFactor': { name: 'healthFactor'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; } }; 'netBalance': { name: 'netBalance'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FiatAmount'; ofType: null; }; } }; 'supplies': { name: 'supplies'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FiatAmount'; ofType: null; }; } }; }; };
'UserSummaryHistoryRequest': { kind: 'INPUT_OBJECT'; name: 'UserSummaryHistoryRequest'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'filter'; type: { kind: 'INPUT_OBJECT'; name: 'UserSummaryFilter'; ofType: null; }; defaultValue: null }, { name: 'window'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TimeWindow'; ofType: null; }; }; defaultValue: null }]; };
'UserSummaryRequest': { kind: 'INPUT_OBJECT'; name: 'UserSummaryRequest'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'filter'; type: { kind: 'INPUT_OBJECT'; name: 'UserSummaryFilter'; ofType: null; }; defaultValue: null }]; };
'UserSuppliesQueryRequest': { kind: 'INPUT_OBJECT'; name: 'UserSuppliesQueryRequest'; isOneOf: true; inputFields: [{ name: 'userSpoke'; type: { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; ofType: null; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }]; };
'UserSuppliesQueryRequest': { kind: 'INPUT_OBJECT'; name: 'UserSuppliesQueryRequest'; isOneOf: true; inputFields: [{ name: 'userSpoke'; type: { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; ofType: null; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }, { name: 'userChains'; type: { kind: 'INPUT_OBJECT'; name: 'UserChains'; ofType: null; }; defaultValue: null }]; };
'UserSuppliesRequest': { kind: 'INPUT_OBJECT'; name: 'UserSuppliesRequest'; isOneOf: false; inputFields: [{ name: 'query'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UserSuppliesQueryRequest'; ofType: null; }; }; defaultValue: null }, { name: 'orderBy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UserSuppliesRequestOrderBy'; ofType: null; }; }; defaultValue: "{name: ASC}" }]; };
'UserSuppliesRequestOrderBy': { kind: 'INPUT_OBJECT'; name: 'UserSuppliesRequestOrderBy'; isOneOf: true; inputFields: [{ name: 'name'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'balance'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'apy'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'earned'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }]; };
'UserSupplyItem': { kind: 'OBJECT'; name: 'UserSupplyItem'; fields: { 'amount': { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'earned': { name: 'earned'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'isCollateral': { name: 'isCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Reserve'; ofType: null; }; } }; }; };
Expand Down
1 change: 1 addition & 0 deletions packages/graphql/src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export type UserBalancesRequestOrderBy = ReturnType<
export type UserBorrowsQueryRequest = ReturnType<
typeof graphql.scalar<'UserBorrowsQueryRequest'>
>;
export type UserChains = ReturnType<typeof graphql.scalar<'UserChains'>>;
export type UserBorrowsRequestOrderBy = ReturnType<
typeof graphql.scalar<'UserBorrowsRequestOrderBy'>
>;
Expand Down