Skip to content

Commit dc3ca22

Browse files
committed
fix: updated GraphQL query for FetchSecurityMarketData because it was failing for some securities
1 parent d2281c7 commit dc3ca22

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ws_api/wealthsimple_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class WealthsimpleAPIBase:
2929
'FetchSecuritySearchResult': "query FetchSecuritySearchResult($query: String!) {\n securitySearch(input: {query: $query}) {\n results {\n ...SecuritySearchResult\n __typename\n }\n __typename\n }\n}\n\nfragment SecuritySearchResult on Security {\n id\n buyable\n status\n stock {\n symbol\n name\n primaryExchange\n __typename\n }\n securityGroups {\n id\n name\n __typename\n }\n quoteV2 {\n ... on EquityQuote {\n marketStatus\n __typename\n }\n __typename\n }\n __typename\n}",
3030
'FetchSecurityHistoricalQuotes': "query FetchSecurityHistoricalQuotes($id: ID!, $timerange: String! = \"1d\") {\n security(id: $id) {\n id\n historicalQuotes(timeRange: $timerange) {\n ...HistoricalQuote\n __typename\n }\n __typename\n }\n}\n\nfragment HistoricalQuote on HistoricalQuote {\n adjustedPrice\n currency\n date\n securityId\n time\n __typename\n}",
3131
'FetchAccountsWithBalance': "query FetchAccountsWithBalance($ids: [String!]!, $type: BalanceType!) {\n accounts(ids: $ids) {\n ...AccountWithBalance\n __typename\n }\n}\n\nfragment AccountWithBalance on Account {\n id\n custodianAccounts {\n id\n financials {\n ... on CustodianAccountFinancialsSo {\n balance(type: $type) {\n ...Balance\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\n\nfragment Balance on Balance {\n quantity\n securityId\n __typename\n}",
32-
'FetchSecurityMarketData': "query FetchSecurityMarketData($id: ID!) {\n security(id: $id) {\n id\n ...SecurityMarketData\n __typename\n }\n}\n\nfragment SecurityMarketData on Security {\n id\n allowedOrderSubtypes\n marginRates {\n ...MarginRates\n __typename\n }\n fundamentals {\n avgVolume\n high52Week\n low52Week\n yield\n peRatio\n marketCap\n currency\n description\n __typename\n }\n quote {\n bid\n ask\n open\n high\n low\n volume\n askSize\n bidSize\n last\n lastSize\n quotedAsOf\n quoteDate\n amount\n previousClose\n __typename\n }\n stock {\n primaryExchange\n primaryMic\n name\n symbol\n __typename\n }\n __typename\n}\n\nfragment MarginRates on MarginRates {\n clientMarginRate\n __typename\n}",
32+
'FetchSecurityMarketData': "query FetchSecurityMarketData($id: ID!) {\n security(id: $id) {\n id\n ...SecurityMarketData\n __typename\n }\n}\n\nfragment SecurityMarketData on Security {\n id\n allowedOrderSubtypes\n marginRates {\n ...ClientMarginRates\n __typename\n }\n managementExpenseRatio\n fundamentals {\n ...Fundamentals\n __typename\n }\n stock {\n ...Stock\n __typename\n }\n __typename\n}\n\nfragment Fundamentals on Fundamentals {\n avgVolume\n beta\n circulatingSupply\n companyCash\n companyCeo\n companyDebt\n companyEarningsGrowth\n companyGrossProfitMargin\n companyHqLocation\n companyRevenue\n currency\n dailyVolume\n description\n eps\n high52Week\n inceptionYear\n low52Week\n marketCap\n numberOfEmployees\n peRatio\n sharesOutstanding\n totalAssets\n totalSupply\n yield\n __typename\n}\n\nfragment Stock on Stock {\n description\n dividendFrequency\n ipoState\n leverageRatio\n name\n primaryExchange\n primaryMic\n segmentMic\n symbol\n usPtp\n __typename\n}\n\nfragment ClientMarginRates on MarginRates {\n clientMarginRate\n __typename\n}",
3333
'FetchFundsTransfer': "query FetchFundsTransfer($id: ID!) {\n fundsTransfer: funds_transfer(id: $id, include_cancelled: true) {\n ...FundsTransfer\n __typename\n }\n}\n\nfragment FundsTransfer on FundsTransfer {\n id\n status\n cancellable\n rejectReason: reject_reason\n schedule {\n id\n __typename\n }\n source {\n ...BankAccountOwner\n __typename\n }\n destination {\n ...BankAccountOwner\n __typename\n }\n __typename\n}\n\nfragment BankAccountOwner on BankAccountOwner {\n bankAccount: bank_account {\n ...BankAccount\n __typename\n }\n __typename\n}\n\nfragment BankAccount on BankAccount {\n id\n accountName: account_name\n corporate\n createdAt: created_at\n currency\n institutionName: institution_name\n jurisdiction\n nickname\n type\n updatedAt: updated_at\n verificationDocuments: verification_documents {\n ...BankVerificationDocument\n __typename\n }\n verifications {\n ...BankAccountVerification\n __typename\n }\n ...CaBankAccount\n ...UsBankAccount\n __typename\n}\n\nfragment CaBankAccount on CaBankAccount {\n accountName: account_name\n accountNumber: account_number\n __typename\n}\n\nfragment UsBankAccount on UsBankAccount {\n accountName: account_name\n accountNumber: account_number\n __typename\n}\n\nfragment BankVerificationDocument on VerificationDocument {\n id\n acceptable\n updatedAt: updated_at\n createdAt: created_at\n documentId: document_id\n documentType: document_type\n rejectReason: reject_reason\n reviewedAt: reviewed_at\n reviewedBy: reviewed_by\n __typename\n}\n\nfragment BankAccountVerification on BankAccountVerification {\n custodianProcessedAt: custodian_processed_at\n custodianStatus: custodian_status\n document {\n ...BankVerificationDocument\n __typename\n }\n __typename\n}",
3434
'FetchInstitutionalTransfer': "query FetchInstitutionalTransfer($id: ID!) {\n accountTransfer(id: $id) {\n ...InstitutionalTransfer\n __typename\n }\n}\n\nfragment InstitutionalTransfer on InstitutionalTransfer {\n id\n accountId: account_id\n state\n documentId: document_id\n documentType: document_type\n expectedCompletionDate: expected_completion_date\n timelineExpectation: timeline_expectation {\n lowerBound: lower_bound\n upperBound: upper_bound\n __typename\n }\n estimatedCompletionMaximum: estimated_completion_maximum\n estimatedCompletionMinimum: estimated_completion_minimum\n institutionName: institution_name\n transferStatus: external_state\n redactedInstitutionAccountNumber: redacted_institution_account_number\n expectedValue: expected_value\n transferType: transfer_type\n cancellable\n pdfUrl: pdf_url\n clientVisibleState: client_visible_state\n shortStatusDescription: short_status_description\n longStatusDescription: long_status_description\n progressPercentage: progress_percentage\n type\n rolloverType: rollover_type\n autoSignatureEligible: auto_signature_eligible\n parentInstitution: parent_institution {\n id\n name\n __typename\n }\n stateHistories: state_histories {\n id\n state\n notes\n transitionSubmittedBy: transition_submitted_by\n transitionedAt: transitioned_at\n transitionCode: transition_code\n __typename\n }\n transferFeeReimbursement: transfer_fee_reimbursement {\n id\n feeAmount: fee_amount\n __typename\n }\n docusignSentViaEmail: docusign_sent_via_email\n clientAccountType: client_account_type\n primaryClientIdentityId: primary_client_identity_id\n primaryOwnerSigned: primary_owner_signed\n secondaryOwnerSigned: secondary_owner_signed\n __typename\n}",
3535
'FetchAccountHistoricalFinancials': "query FetchAccountHistoricalFinancials($id: ID!, $currency: Currency!, $startDate: Date, $resolution: DateResolution!, $endDate: Date, $first: Int, $cursor: String) {\n account(id: $id) {\n id\n financials {\n historicalDaily(\n currency: $currency\n startDate: $startDate\n resolution: $resolution\n endDate: $endDate\n first: $first\n after: $cursor\n ) {\n edges {\n node {\n ...AccountHistoricalFinancials\n __typename\n }\n __typename\n }\n pageInfo {\n hasNextPage\n endCursor\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n }\n\n fragment AccountHistoricalFinancials on AccountHistoricalDailyFinancials {\n date\n netLiquidationValueV2 {\n ...Money\n __typename\n }\n netDepositsV2 {\n ...Money\n __typename\n }\n __typename\n }\n\n fragment Money on Money {\n amount\n cents\n currency\n __typename\n }",

0 commit comments

Comments
 (0)