@powerhousedao/academy 0.1.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +9 -0
- package/Dockerfile +31 -0
- package/ProcFile +1 -0
- package/README.md +43 -0
- package/babel.config.js +3 -0
- package/blog/BeyondCommunication-ABlueprintForDevelopment.md +88 -0
- package/blog/TheChallengeOfChange.md +86 -0
- package/blog/images/Iteration.png +0 -0
- package/blog/images/RAD.png +0 -0
- package/docs/academy/01-GetStarted/00-GetStarted.mdx +181 -0
- package/docs/academy/01-GetStarted/01_InstallDemoPackage.md +38 -0
- package/docs/academy/01-GetStarted/02-ToDoList/01-CreateNewPowerhouseProject.md +97 -0
- package/docs/academy/01-GetStarted/02-ToDoList/02-DefineToDoListDocumentModel.md +86 -0
- package/docs/academy/01-GetStarted/02-ToDoList/03-ImplementOperationReducers.md +201 -0
- package/docs/academy/01-GetStarted/02-ToDoList/04-BuildToDoListEditor.md +494 -0
- package/docs/academy/01-GetStarted/02-ToDoList/_category_.json +8 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/DocumentModelHeader.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/DocumentModelOperations.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/OpenDocumentModelEditor.gif +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/completeEditor.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/connectApp.gif +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/form.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/mytodolist.gif +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/reducers.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/vscode.png +0 -0
- package/docs/academy/01-GetStarted/styles.module.css +99 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/00-BuilderTools.md +234 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/01-SetupBuilderEnvironment.md +247 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/04-UtilitiesAndTips.md +79 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/01-SetupBuilderEnvironment.md +216 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/02-CreateNewPowerhouseProject.md +78 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/03-DefineChatroomDocumentModel.md +139 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/04-ImplementOperationReducers.md +364 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/05-ImplementChatroomEditor.md +194 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/06-LaunchALocalReactor.md +15 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-1.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-2.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-3.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-4.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-5.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/ChatRoomConnectApp.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/ChatRoomTest.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/completeEditor.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/form.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/reducers.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/vscode.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-StandardDocumentModelWorkflow.md +229 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/01-BuildingBeautifulDocumentEditors.md +109 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/02-ConfiguringDrives.md +51 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/03-BuildingADriveExplorer.md +174 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/01-OperationHistory.md +67 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/02-RevisionHistoryTimeline.md +132 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/_category_.json +7 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/committer-address-popup.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/revision-hash-popup.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/revision-history-list.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/signature-details-popup.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/images/CreateDrive.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/images/mytodolist.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/01-ReadingAndWritingThroughTheAPI.mdx +121 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/02-GraphQLAtPowerhouse.md +156 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/02-GraphQLAndSubgraphs.mdx +119 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/03-WorkingWithSubgraphs.md +312 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/04-analytics-processor.md +342 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md +215 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/02-CreateNewPowerhouseProject.md +55 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/03-GenerateAnAnalyticsProcessor.md +173 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/04-UpdateAnalyticsProcessor.md +223 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-SPV.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-a-new-asset.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-a-transaction.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Transaction-table.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/create-a-new-RWA-document.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/granularity.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/QueryingADocumentWithGraphQL.md +244 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/listener-raw.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/raw-reports1.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/raw-reports2.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/rwaRegister.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/apse.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/best-practices.md +60 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/filter.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/filteroptions.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/graphql/index.md +166 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/graphql/integration.md +75 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/dbs.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/high-level.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/indexeddb.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/libs-core.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/libs.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/lod.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/logo.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/navbar.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-1.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-2.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-3.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-4.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-5.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-6.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/paths-1.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/paths-2.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/intro.md +149 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/benchmarks.md +27 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/browser.md +77 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/compatibility.md +14 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/index.md +230 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/memory.md +72 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/pg.md +63 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/schema.md +14 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/utilities.md +102 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/index.md +7 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/maker.md +652 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/processors.md +3 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/OperationHistory.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/OperationsQuery.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/QueryDocumentID.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/SwitchboardButton.png +0 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/00-IntegrateInAFront-End +3 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/01-IntroducingFusion +18 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/02-IntroductionToPackages.md +79 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/02-PublishYourProject.md +230 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/03-RunOnACloudServer.md +279 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/03-SetupEnvironment.md +436 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/04-GraphQLNamespacing +44 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/05-LaunchYourBackend.md +3 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/06-LaunchYourFrontend.md +3 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/images/SSHConnection.png +0 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/images/homedesign.png +0 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/images/keyconcepts.png +0 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/images/tutorialschema.png +0 -0
- package/docs/academy/02-AdvancedTutorial/06-Authorization/Authorization.md +100 -0
- package/docs/academy/02-AdvancedTutorial/_category_.json +7 -0
- package/docs/academy/03-APIReferences/00-PowerhouseCLI.md +1 -0
- package/docs/academy/03-APIReferences/_category_.json +7 -0
- package/docs/academy/04-ComponentLibrary/01-PowerhouseDesignSystem.md +94 -0
- package/docs/academy/04-ComponentLibrary/02-BuildingWithScalars.md +54 -0
- package/docs/academy/04-ComponentLibrary/03-Scalar-Components/01-phid-field.mdx +72 -0
- package/docs/academy/04-ComponentLibrary/03-Scalar-Components/02-input-field.mdx +0 -0
- package/docs/academy/04-ComponentLibrary/04-Complex-Components/01-sidebar.mdx +36 -0
- package/docs/academy/04-ComponentLibrary/05-Layout-Components/01-test-toupdate.mdx +61 -0
- package/docs/academy/04-ComponentLibrary/06-Fragments/01-test-toupdate.mdx +61 -0
- package/docs/academy/04-ComponentLibrary/_category_.json +8 -0
- package/docs/academy/05-Architecture/00-PowerhouseArchitecture.md +50 -0
- package/docs/academy/05-Architecture/01-WorkingWithTheReactor.md +48 -0
- package/docs/academy/05-Architecture/02-ReferencingMonorepoPackages +65 -0
- package/docs/academy/05-Architecture/04-MovingBeyondCRUD +61 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/01-WhatIsADocumentModel.md +188 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/02-DAOandDocumentsModelsQ+A.md +177 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/02-domain-modeling.md +103 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/03-BenefitsOfDocumentModels.md +95 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/05-best-practices.md +257 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/_category_.json +8 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/three-data-layers.png +0 -0
- package/docs/academy/05-Architecture/_category_.json +7 -0
- package/docs/academy/05-Architecture/images/image.png +0 -0
- package/docs/academy/06-Cookbook.md +905 -0
- package/docs/academy/07-Glossary.md +50 -0
- package/docs/bookofpowerhouse/01-Overview.md +29 -0
- package/docs/bookofpowerhouse/02-GeneralFrameworkAndPhilosophy.md +15 -0
- package/docs/bookofpowerhouse/03-PowerhouseSoftwareArchitecture.md +33 -0
- package/docs/bookofpowerhouse/04-DevelopmentApproaches.md +36 -0
- package/docs/bookofpowerhouse/05-SNOsandANewModelForOSSandPublicGoods.md +73 -0
- package/docs/bookofpowerhouse/06-SNOsInActionAndPlatformEconomies.md +17 -0
- package/docs/renown/01-intro.md +18 -0
- package/docs/renown/02-renown-login-flow.md +60 -0
- package/docusaurus +0 -0
- package/docusaurus.config.ts +170 -0
- package/package.json +50 -0
- package/powerhouse-docs@0.0.0 +0 -0
- package/sidebars.ts +33 -0
- package/src/components/HomepageFeatures/index.tsx +250 -0
- package/src/components/HomepageFeatures/styles.module.css +267 -0
- package/src/css/custom.css +450 -0
- package/src/pages/index.module.css +37 -0
- package/src/pages/index.tsx +42 -0
- package/src/pages/markdown-page.md +7 -0
- package/static/.nojekyll +0 -0
- package/static/fonts/FranieBold.otf +0 -0
- package/static/fonts/FranieRegular.otf +0 -0
- package/static/img/Powerhouse Website Drive.png +0 -0
- package/static/img/Powerhouse Website Storage Layer (1).png +0 -0
- package/static/img/Powerhouse Website Storage Layer.png +0 -0
- package/static/img/Powerhouse-main-light.svg +13 -0
- package/static/img/Powerhouse-main.svg +13 -0
- package/static/img/Renown Intro Diagram.png +0 -0
- package/static/img/Union.svg +3 -0
- package/static/img/academy/icons/Advanced.svg +4 -0
- package/static/img/academy/icons/Book.svg +5 -0
- package/static/img/academy/icons/Cookbook.svg +3 -0
- package/static/img/academy/icons/Create.svg +3 -0
- package/static/img/academy/icons/Data.svg +3 -0
- package/static/img/academy/icons/Editor.svg +3 -0
- package/static/img/academy/icons/Flash.svg +3 -0
- package/static/img/academy/icons/Launch.svg +3 -0
- package/static/img/academy-icon.png +0 -0
- package/static/img/connect-icon.png +0 -0
- package/static/img/connect.png +0 -0
- package/static/img/docusaurus-social-card.jpg +0 -0
- package/static/img/docusaurus.png +0 -0
- package/static/img/empty-background.png +0 -0
- package/static/img/favicon.ico +0 -0
- package/static/img/fusion-icon.png +0 -0
- package/static/img/fusion.png +0 -0
- package/static/img/ph-icon-light.svg +3 -0
- package/static/img/powerhouse-layer.png +0 -0
- package/static/img/powerhouse-storage-layer.png +0 -0
- package/static/img/reactor.png +0 -0
- package/static/img/renown-icon.png +0 -0
- package/static/img/renown.png +0 -0
- package/static/img/switchboard-icon.png +0 -0
- package/static/img/switchboard.png +0 -0
- package/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/static/img/undraw_docusaurus_react.svg +170 -0
- package/static/img/undraw_docusaurus_tree.svg +40 -0
- package/static/img/video-placeholder.svg +16 -0
- package/static.json +7 -0
- package/tsconfig.json +7 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Querying a document with GraphQL
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
In this documentation we'll show how to use a **GraphQL** query to query a document model.
|
|
6
|
+
|
|
7
|
+
We will be looking at 2 different GraphQL queries for retrieving data from a 'Real World Asset Portfolio Report'.
|
|
8
|
+
But the **same queries can be used for any other document model**.
|
|
9
|
+
|
|
10
|
+
The queries below focus on 2 different ways of receiving the data.
|
|
11
|
+
We will show how you can receive:
|
|
12
|
+
|
|
13
|
+
> #### 1. The complete state of the document:
|
|
14
|
+
> Such as the array of accounts, Special Purpose Vehicles (SPVs), fixed income types, fee types, portfolio details, and transactions associated with a particular RWA-report.
|
|
15
|
+
|
|
16
|
+
> #### 2. Only the latest changes and updates:
|
|
17
|
+
> Or specific operations of a document by registering a listener with a specific filter.
|
|
18
|
+
|
|
19
|
+
### Adding the specific Document Drive to Connect with an URL
|
|
20
|
+
|
|
21
|
+
The specific drive where your RWA-report or any other document is being stored can be accessed through Connect. Connect functions as your decentralised document drive to access and edit document models that capture the data present in your organisation.
|
|
22
|
+
|
|
23
|
+
Get access to an organisations drive instances by adding this drive to your Connect Drive navigation tree view. click the (+) to add a public drive with the help of the correct link. To add a new drive you'll have to know the correct URL for the drive.
|
|
24
|
+
|
|
25
|
+
## Querying data from Connect with Switchboard
|
|
26
|
+
|
|
27
|
+
Whenever you want to start a query from a document within connect you can open up switchboard by looking for the switchboard logo in the top right hand corner of the document editor interface, or by clicking a document in the connect drive explorer and opening the document in switchboard. This feature will not be available for your local drives as they are not hosted on switchboard.
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
Right click a document and find a direct link to switchboard GraphQL playground*
|
|
31
|
+
|
|
32
|
+
## Querying data from Connect in Apollo Studio
|
|
33
|
+
|
|
34
|
+
Aside from switchboard you're able to make use of GraphQL interfaces such as Apollo Studio.
|
|
35
|
+
When opening the document in switchboard the endpoint will be visible at the top of the interface. Copy this endpoint and use it as your API endpoint in Apollo.
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
*The endpoint you'll be using for any other GraphQL playgrounds or sandboxes*
|
|
39
|
+
|
|
40
|
+
### 1. Querying the complete state of a document
|
|
41
|
+
|
|
42
|
+
This example query is structured to request a document by its unique identifier (id).
|
|
43
|
+
It extracts common fields such as id, name, documentType, revision, created, and lastModified.
|
|
44
|
+
|
|
45
|
+
Additionally, it retrieves specific data related to the 'Real World Assets' document model, including accounts, SPVs, fixed income types, fee types, portfolio, and transactions. The RWA section of the query is designed to pull in detailed information about the financial structure and transactions of real-world assets managed within the document model.
|
|
46
|
+
|
|
47
|
+
#### Common Document Fields
|
|
48
|
+
|
|
49
|
+
- `name`: The name of the document.
|
|
50
|
+
- `documentType`: The type classification of the document.
|
|
51
|
+
- `revision`: The version number of the document.
|
|
52
|
+
- `created`: The creation timestamp of the document.
|
|
53
|
+
- `lastModified`: The timestamp of when the document was last modified.
|
|
54
|
+
|
|
55
|
+
<details>
|
|
56
|
+
<summary>List of document model specific fields.</summary>
|
|
57
|
+
|
|
58
|
+
#### Real World Assets (RWA) Specific Fields
|
|
59
|
+
|
|
60
|
+
**State**
|
|
61
|
+
- `accounts`
|
|
62
|
+
- `id`: Unique identifier for the account.
|
|
63
|
+
- `reference`: Reference code or number associated with the account.
|
|
64
|
+
- `label`: A user-friendly name or label for the account.
|
|
65
|
+
- `principalLenderAccountId`: Identifier for the principal lender's account.
|
|
66
|
+
- `spvs`
|
|
67
|
+
- `id`: Unique identifier for the Special Purpose Vehicle (SPV).
|
|
68
|
+
- `name`: Name of the SPV.
|
|
69
|
+
- `feeTypes`
|
|
70
|
+
- `id`: Unique identifier for the fee type.
|
|
71
|
+
- `name`: Name of the fee type.
|
|
72
|
+
- `feeType`: The classification or category of the fee.
|
|
73
|
+
- `accountId`: Identifier for the account associated with the fee.
|
|
74
|
+
- `fixedIncomeTypes`
|
|
75
|
+
- `id`: Unique identifier for the fixed income type.
|
|
76
|
+
- `name`: Name of the fixed income type.
|
|
77
|
+
|
|
78
|
+
**Portfolio**
|
|
79
|
+
|
|
80
|
+
**Fixed Income**
|
|
81
|
+
- `id`: Unique identifier for the fixed income asset.
|
|
82
|
+
- `fixedIncomeTypeId`: Identifier for the type of fixed income.
|
|
83
|
+
- `name`: Name of the fixed income asset.
|
|
84
|
+
- `spvId`: Identifier for the SPV associated with the fixed income asset.
|
|
85
|
+
- `maturity`: Maturity date of the fixed income asset.
|
|
86
|
+
- `purchaseDate`: Purchase date of the fixed income asset.
|
|
87
|
+
- `notional`: The notional amount of the fixed income asset.
|
|
88
|
+
- `purchasePrice`: Purchase price of the fixed income asset.
|
|
89
|
+
- `purchaseProceeds`: Proceeds from the purchase of the fixed income asset.
|
|
90
|
+
- `totalDiscount`: Total discount received for the fixed income asset.
|
|
91
|
+
- `annualizedYield`: The annualized yield of the fixed income asset.
|
|
92
|
+
- `ISIN`: International Securities Identification Number for the fixed income asset.
|
|
93
|
+
- `CUSIP`: Committee on Uniform Securities Identification Procedures number for the fixed income asset.
|
|
94
|
+
- `coupon`: Coupon rate of the fixed income asset.
|
|
95
|
+
|
|
96
|
+
**Cash**
|
|
97
|
+
|
|
98
|
+
- `id`: Unique identifier for the cash holding.
|
|
99
|
+
- `spvId`: Identifier for the SPV associated with the cash holding.
|
|
100
|
+
- `currency`: Currency of the cash holding
|
|
101
|
+
|
|
102
|
+
</details>
|
|
103
|
+
|
|
104
|
+
```graphql title="An example query for the full state of a document"
|
|
105
|
+
query {
|
|
106
|
+
document(id: "") {
|
|
107
|
+
name
|
|
108
|
+
documentType
|
|
109
|
+
revision
|
|
110
|
+
created
|
|
111
|
+
lastModified
|
|
112
|
+
... on RealWorldAssets {
|
|
113
|
+
state {
|
|
114
|
+
accounts {
|
|
115
|
+
id
|
|
116
|
+
reference
|
|
117
|
+
label
|
|
118
|
+
}
|
|
119
|
+
principalLenderAccountId
|
|
120
|
+
spvs {
|
|
121
|
+
id
|
|
122
|
+
name
|
|
123
|
+
}
|
|
124
|
+
serviceProviderFeeTypes {
|
|
125
|
+
id
|
|
126
|
+
name
|
|
127
|
+
feeType
|
|
128
|
+
accountId
|
|
129
|
+
}
|
|
130
|
+
fixedIncomeTypes {
|
|
131
|
+
id
|
|
132
|
+
name
|
|
133
|
+
}
|
|
134
|
+
portfolio {
|
|
135
|
+
... on FixedIncome {
|
|
136
|
+
id
|
|
137
|
+
fixedIncomeTypeId
|
|
138
|
+
name
|
|
139
|
+
spvId
|
|
140
|
+
maturity
|
|
141
|
+
purchaseDate
|
|
142
|
+
notional
|
|
143
|
+
purchasePrice
|
|
144
|
+
purchaseProceeds
|
|
145
|
+
totalDiscount
|
|
146
|
+
annualizedYield
|
|
147
|
+
ISIN
|
|
148
|
+
CUSIP
|
|
149
|
+
coupon
|
|
150
|
+
}
|
|
151
|
+
... on Cash {
|
|
152
|
+
id
|
|
153
|
+
spvId
|
|
154
|
+
currency
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 2. Querying for the latest updates or specific documents
|
|
165
|
+
|
|
166
|
+
This query is particularly useful when you only need the latest changes from the document drive.
|
|
167
|
+
|
|
168
|
+
### 2.1 Registering a listener
|
|
169
|
+
For this purpose we support adding listeners through a graphQL mutation such as the PullResponderListenerbelow.
|
|
170
|
+
|
|
171
|
+
```graphql
|
|
172
|
+
mutation registerListener($filter: InputListenerFilter!) {
|
|
173
|
+
registerPullResponderListener(filter: $filter) {
|
|
174
|
+
listenerId
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 2.2 Defining the filter
|
|
180
|
+
|
|
181
|
+
Through this listener you can define the filter with query variables.
|
|
182
|
+
This allows you to filter for specific document ID's or a lists, documentTypes, scopes or branches.
|
|
183
|
+
Branches allow you to query different versions of a document in case there is a conflict accross different versions of the document or when contributors are maintaining separate versions with the help of branching
|
|
184
|
+
|
|
185
|
+
In this case we're filtering by document type makerdao/rwa-portfolio.
|
|
186
|
+
|
|
187
|
+
```graphql
|
|
188
|
+
{
|
|
189
|
+
"filter":{
|
|
190
|
+
"documentId": ["*"],
|
|
191
|
+
"documentType": ["makerdao/rwa-portfolio"],
|
|
192
|
+
"scope": "global",
|
|
193
|
+
"branch": "main"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
This combination of query + query variables will return a listenerID which can be used in the next step to query for specific strands.
|
|
199
|
+
|
|
200
|
+

|
|
201
|
+
*An example of registering a listener and receiving a listenerId back.*
|
|
202
|
+
|
|
203
|
+
:::info
|
|
204
|
+
A strand in this scenario can be understood as a list of operations that has been applied to the RWA portfolio or any other document. As a query variable you'll want to add the received listenerId from the previous step together with the pullstrands query below
|
|
205
|
+
:::
|
|
206
|
+
|
|
207
|
+
```graphql title="Pullstrands query"
|
|
208
|
+
query pullStrands ($listenerId:ID, $since: Date) {
|
|
209
|
+
system {
|
|
210
|
+
sync {
|
|
211
|
+
strands (listenerId: $listenerId, since: $since) {
|
|
212
|
+
driveId
|
|
213
|
+
documentId
|
|
214
|
+
scope
|
|
215
|
+
branch
|
|
216
|
+
operations {
|
|
217
|
+
index
|
|
218
|
+
skip
|
|
219
|
+
type
|
|
220
|
+
input
|
|
221
|
+
hash
|
|
222
|
+
timestamp
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
```graphql title="Query variables for pullStrands"
|
|
231
|
+
{
|
|
232
|
+
"listenerId":"7ef04e24-4466-4642-863d-4a71c29d30c7",
|
|
233
|
+
"since":"2024-02-21T16:45:30.300Z"
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+

|
|
238
|
+
*An example of using the ListenerID to pull specific strands (or document operations)*
|
|
239
|
+
|
|
240
|
+
In case you'd only like to receive the latest operations of a document the latest timestamp can be used as a filter in the since query variable to only get the most relevant or latest changes.
|
|
241
|
+
|
|
242
|
+
:::info
|
|
243
|
+
A "strand" within the context of Powerhouse's Document Synchronization Protocol also refers to a single synchronization channel that connects exactly one unit of synchronization to another, with all four parameters (drive_url, doc_id, scope, branch) set to fixed values. This setup means that synchronization happens at a granular level, focusing specifically on one precise aspect of synchronization between two distinct points of instances of a document or document drive.
|
|
244
|
+
:::
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/best-practices.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1000
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Best Practices
|
|
6
|
+
|
|
7
|
+
### GraphQL
|
|
8
|
+
|
|
9
|
+
**Start general, end with detailed queries.** In the case you want to find a specific number for a specific metric and dimension, the rule of thumb is to start general in the filter definitions and slowly start cutting down the paths to a particular team or budget period.
|
|
10
|
+
|
|
11
|
+
For example: Looking at the dimension section in the filter options: To see available sub paths for the budget, leave the select: "atlas" and lod as 5 . With lod:5 you’ll be able to see the different paths available under your defined filter. Then, later you can apply a more detailed path in the select: "atlas/..." path that will suit your needs.
|
|
12
|
+
|
|
13
|
+
```graphql
|
|
14
|
+
{
|
|
15
|
+
"filter": {
|
|
16
|
+
...
|
|
17
|
+
"dimensions": [
|
|
18
|
+
{
|
|
19
|
+
"name": "budget",
|
|
20
|
+
"select": "atlas",
|
|
21
|
+
"lod": 5
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
...
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Follow upper case, lower case rules.** To make sure to get the results you require, you must follow the upper or lower case styling for defining the metrics and granularity. To see the available metrics and dimensions just use the referenced queries. For granularity, check the above granularity section for the different types.
|
|
30
|
+
|
|
31
|
+
**Fetch per specified path** if performance is an issue.
|
|
32
|
+
|
|
33
|
+
### Guidelines for Selecting and Combining Dimensions
|
|
34
|
+
|
|
35
|
+
1. **Understand the Purpose of Analysis**
|
|
36
|
+
Before selecting dimensions, clarify the objective of your analysis. Are you looking to track expenses for a specific project, analyze budget utilization, or examine transaction patterns? Your objective will guide which dimensions are most relevant.
|
|
37
|
+
|
|
38
|
+
2. **Choose Relevant Dimensions**
|
|
39
|
+
Select dimensions that align with your analytical goals. For instance, use the 'Project' dimension for project-based financial tracking or 'Wallet' for blockchain transaction analysis.
|
|
40
|
+
|
|
41
|
+
3. **Combining Dimensions for Depth**
|
|
42
|
+
Combine multiple dimensions to gain more nuanced insights. For example, you might combine 'Budget' and 'Category' to understand how different categories of expenses contribute to overall budget utilization within a specific area.
|
|
43
|
+
|
|
44
|
+
4. **Hierarchy and Path Considerations**
|
|
45
|
+
Pay attention to the hierarchical structure in dimension paths. For instance, paths like atlas/scopes/SUP/I/PHOENIX/ suggest a structured breakdown that can be crucial for detailed analysis.
|
|
46
|
+
|
|
47
|
+
5. **Utilize Descriptions for Context**
|
|
48
|
+
Where available, use the descriptions provided with dimension values to understand the context and relevance of each dimension to your analysis. This is particularly helpful in dimensions with null labels, where the path and description provide critical information.
|
|
49
|
+
|
|
50
|
+
6. **Avoid Over-Complication**
|
|
51
|
+
While combining dimensions can provide depth, avoid overly complex combinations that might lead to confusing or inconclusive results. Stick to combinations that directly serve your analysis objectives.
|
|
52
|
+
|
|
53
|
+
7. **Use Icons for Quick Reference**
|
|
54
|
+
Where icons are available, they can be used as a quick visual reference to identify different dimensions or categories, particularly in user interfaces where rapid identification is beneficial.
|
|
55
|
+
|
|
56
|
+
8. **Experiment and Iterate**
|
|
57
|
+
Don’t hesitate to experiment with different combinations of dimensions to see which provide the most meaningful insights. The flexibility of the dimensions allows for various permutations and combinations to suit diverse analytical needs.
|
|
58
|
+
|
|
59
|
+
9. **Stay Updated**
|
|
60
|
+
Keep abreast of any changes or additions to the dimensions within the analytics engine, as this can impact ongoing and future analyses.
|
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/filteroptions.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 3
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# GraphQL API
|
|
6
|
+
|
|
7
|
+
A basic understanding of GraphQL is helpful to understand this document, as we use concepts and vocabulary from the broader ecosystem. For a good primer on the subject, see the [Introduction to GraphQL](https://graphql.org/learn/).
|
|
8
|
+
|
|
9
|
+
## Basic GraphQL Structure:
|
|
10
|
+
|
|
11
|
+
- **Query**: At its core, a GraphQL query is about asking or 'querying' for specific fields on objects. The query is structured like a JSON object, but without the values. This structure lets you specify exactly which data you want to fetch from the server.
|
|
12
|
+
|
|
13
|
+
- **Fields**: In a GraphQL query, you specify a set of fields within braces. Each field corresponds to a piece of data you want to fetch.
|
|
14
|
+
|
|
15
|
+
- **Nested Fields**: Fields can also be nested, allowing you to fetch related data. For example, if you have a user, you can fetch the user's name and, within the same query, fetch a list of the user's friends and their names.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
Imagine you have a user object and you want to fetch the user's name and email, along with the names of their friends. A basic GraphQL query might look like this:
|
|
20
|
+
|
|
21
|
+
```graphql
|
|
22
|
+
query {
|
|
23
|
+
user(id: "1") {
|
|
24
|
+
name
|
|
25
|
+
email
|
|
26
|
+
friends {
|
|
27
|
+
name
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
In this example, query is the operation type, user is the field on the root type, and name, email, and friends are fields on the user type. The id: `"1"` is a parameter passed to the query, specifying which user to fetch.
|
|
34
|
+
You can find more examples of GraphQL core concept in the section [GraphQL at Powerhouse](/docs/academy/AdvancedTutorial/WorkWithData/GraphQLAtPowerhouse).
|
|
35
|
+
|
|
36
|
+
## Analytics Query Structure
|
|
37
|
+
|
|
38
|
+
In the GraphQL query for the Analytics Engine below, each element requests specific pieces of data from the analytics API. Here is a breakdown of the fields and elements with a dropdown with their descriptions below.
|
|
39
|
+
|
|
40
|
+
```graphql
|
|
41
|
+
query Analytics($filter: AnalyticsFilter) {
|
|
42
|
+
analytics {
|
|
43
|
+
series(filter: $filter) {
|
|
44
|
+
period
|
|
45
|
+
start
|
|
46
|
+
end
|
|
47
|
+
rows {
|
|
48
|
+
metric
|
|
49
|
+
unit
|
|
50
|
+
dimensions {
|
|
51
|
+
name
|
|
52
|
+
path
|
|
53
|
+
label
|
|
54
|
+
description
|
|
55
|
+
icon
|
|
56
|
+
}
|
|
57
|
+
value
|
|
58
|
+
sum
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
<details>
|
|
66
|
+
<summary>👉 Expand this dropdown to explore the list of fields and retrievable data..</summary>
|
|
67
|
+
|
|
68
|
+
In the provided GraphQL query, each field and element plays a specific role in determining what data is returned by the analytics engine. Here's a clear and concise description of each:
|
|
69
|
+
|
|
70
|
+
- `query Analytics($filter: AnalyticsFilter):` This is the declaration of the query named 'Analytics', which accepts a variable `$filter` of type `AnalyticsFilter`. This variable will be used to apply certain filters to the analytics data retrieved.
|
|
71
|
+
|
|
72
|
+
- `analytics`: This is the main query operation. It calls the analytics field on the GraphQL API.
|
|
73
|
+
|
|
74
|
+
- `series(filter: $filter)`: This field represents a collection of data points or a data set that matches the criteria specified by the filter. It's an array of results, where each result is a time-bound statistical representation of the filtered data. And passes the `$filter` variable as an argument to determine the scope of the data returned.
|
|
75
|
+
|
|
76
|
+
- `period`: Within each series, this field denotes the aggregation period for the data (e.g., monthly, quarterly, annually). It's a label describing the time span each series covers.
|
|
77
|
+
start: This is the starting date and time of the data series, indicating when the period begins.
|
|
78
|
+
|
|
79
|
+
- `end`: This is the ending date and time of the data series, indicating when the period ends.
|
|
80
|
+
|
|
81
|
+
- `rows`: Represents the individual records or entries in the data series. Each row corresponds to a unique combination of dimensions for the specified period.
|
|
82
|
+
|
|
83
|
+
- `metric`: Within each row, this field specifies the particular metric being measured (e.g., budget, actuals, forecast).
|
|
84
|
+
|
|
85
|
+
- `unit`: This indicates the unit of measurement for the metric, such as quantities, currency (e.g., DAI), or percentages.
|
|
86
|
+
|
|
87
|
+
- `dimensions`: A nested array that provides context for the metric by breaking it down into finer categories or segments, such as 'project' or 'category'. Each dimension can contain:
|
|
88
|
+
- `name`: The identifier or key for the dimension.
|
|
89
|
+
- `path`: A structured representation of the dimension's hierarchy or location within a dataset.
|
|
90
|
+
- `label`: A human-readable label for the dimension, which can be used for display purposes.
|
|
91
|
+
- `description`: A brief explanation of the dimension to give users an understanding of what it represents.
|
|
92
|
+
- `icon`: A graphical representation or icon associated with the dimension for easier identification in user interfaces.
|
|
93
|
+
|
|
94
|
+
- `value`: The actual numerical value of the metric for each row within the specified period.
|
|
95
|
+
- `sum`: A total or aggregated value of the metric over the entire period, providing a summarized figure.
|
|
96
|
+
|
|
97
|
+
This query structure allows users to extract detailed and summarized analytics data with it's context provided with the help of the the dimensions, tailored to specific time frames and measurements.
|
|
98
|
+
|
|
99
|
+
</details>
|
|
100
|
+
|
|
101
|
+
### Filters
|
|
102
|
+
|
|
103
|
+
In the analytics engine, the filter object in a GraphQL query is crucial for tailoring the data retrieval to specific requirements. For the query to function correctly, a complete and fully structured filter object, containing all necessary parameters, must be used. Here's a guide on how to construct these filter objects and examples of different filter configurations.
|
|
104
|
+
|
|
105
|
+
### Constructing a Complete Filter Object
|
|
106
|
+
|
|
107
|
+
A filter object must include all the following parameters:
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
1. Start Date (`start`): The beginning date of the data retrieval period.
|
|
111
|
+
|
|
112
|
+
2. End Date (`end`): The end date of the data retrieval period.
|
|
113
|
+
|
|
114
|
+
3. Granularity(`granularity`): Determines the aggregation level of the data (e.g., total, annual, monthly).
|
|
115
|
+
|
|
116
|
+
4. Metrics (`metrics`): A list of metrics to be analyzed (e.g., Budget, Actuals).
|
|
117
|
+
|
|
118
|
+
5. Dimensions (`dimensions`): Specifies qualitative data categories for segmentation, each with sub-parameters like `name`, `select`, and level of detail (`lod`).
|
|
119
|
+
|
|
120
|
+
In the analytics engine, dimensions play a critical role in segmenting and analyzing data. The `select` field within a dimension and its correlation with the level of detail (`lod`)
|
|
121
|
+
parameter are particularly crucial for tailoring your query to retrieve the most relevant and precise data. Here's a detailed explanation of their importance:
|
|
122
|
+
|
|
123
|
+
The `select` Field in Dimensions
|
|
124
|
+
- **Function**: The select field specifies the exact segment or category within a dimension that you want to analyze. For example, in a dimension named "project," the select field could specify a particular project like "SES" or "Atlas."
|
|
125
|
+
- **Path Specification**: The value set in the select field often represents a path in the data hierarchy. This path directs the query to focus on specific segments or nodes within the broader dimension category.
|
|
126
|
+
- **Precision in Data Retrieval**: By setting the right path in the select field, you ensure that the query fetches data pertinent only to that specific segment, leading to more targeted and relevant insights.
|
|
127
|
+
- **Example**: If you set the **select** field to "`atlas/scopes/SUP/I/PHOENIX/`" in the "`budget`" dimension, the query will retrieve data related to the budget allocated specifically for the "`PHOENIX`" project under the "`SUP`" scope in the "`Atlas`" system.
|
|
128
|
+
|
|
129
|
+
The level of detail (`lod`) Parameter
|
|
130
|
+
- **Granularity** Within Dimensions: While the select field specifies what to select within a dimension, the `lod` parameter determines how detailed or summarized the information should be.
|
|
131
|
+
- **Hierarchy Levels**: Different levels in `lod` represent different levels of detail in the data hierarchy. A higher `lod` value typically means a more detailed breakdown, while a lower value indicates a more summarized or aggregated view.
|
|
132
|
+
- **Correlation with `select` Path**: The lod value you choose should correspond appropriately to the path specified in the `select` field. A mismatch might lead to data that is either too granular or too generalized than what is needed.
|
|
133
|
+
- **Impact on Analysis**: The level of detail can significantly affect the analysis. For instance, a high lod can provide in-depth insights into a specific area, useful for detailed audits or close examination of a particular segment. Conversely, a low lod is better for broader overviews or when comparing larger categories.
|
|
134
|
+
|
|
135
|
+
Importance of Correct Configuration
|
|
136
|
+
- **Accuracy of Results**: Setting the correct path in the select field and aligning it with an appropriate lod ensures the accuracy and relevance of the query results. Incorrect or mismatched configurations might lead to misleading insights or data that doesn’t serve the intended analytical purpose.
|
|
137
|
+
- **Customized Analysis**: Together, the select field and lod allow for a high degree of customization in data queries. Users can tailor their data requests precisely to their specific requirements, whether they need a broad overview or a detailed breakdown.
|
|
138
|
+
- Follow the right upper or lower case letter style from metrics, granularity and dimensions.
|
|
139
|
+
|
|
140
|
+
6. **Currency (`currency`)**: The currency format for the financial data (e.g., DAI, MKR).
|
|
141
|
+
|
|
142
|
+
The filter object can be created by using the UI menu from the graphql apollo studio explorer:
|
|
143
|
+
|
|
144
|
+

|
|
145
|
+
*Select the filter*
|
|
146
|
+
|
|
147
|
+

|
|
148
|
+
*Select all filter fields and sub fields*
|
|
149
|
+
|
|
150
|
+
## Troubleshooting
|
|
151
|
+
|
|
152
|
+
### Common Issues
|
|
153
|
+
|
|
154
|
+
**Mistyping the filter options or not using proper upper or lower case when necessary.** Make sure to check this first when running into problems
|
|
155
|
+
|
|
156
|
+
### Error Messages
|
|
157
|
+
|
|
158
|
+
Usually, error messages are explicit and easy to understand what is wrong, below you can find some examples.
|
|
159
|
+
|
|
160
|
+
- `"message": "Cannot read properties of undefined (reading 'filter')"`, → There is something wrong with the filter options, make sure you’ve added all fields in the filter options.
|
|
161
|
+
|
|
162
|
+
- `"message": "No valid metrics provided, make sure to use metrics from this list: Actuals, Budget, Forecast, FTEs, PaymentsOffChainIncluded, PaymentsOnChain, ProtocolNetOutflow"`, → A wrong format when adding metrics
|
|
163
|
+
|
|
164
|
+
- `"message": "Variable \"$filter\" got invalid value \"Monthlyu\" at \"filter.granularity\"; Value \"Monthlyu\" does not exist in \"AnalyticsGranularity\" enum. Did you mean the enum value \"monthly\"?"`, → Granularity filter is mistyped.
|
|
165
|
+
|
|
166
|
+
**If you are receiving error messages with status code of 500, reach out to the dev team.**
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/graphql/integration.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Integration
|
|
6
|
+
|
|
7
|
+
The `analytics-engine-graphql` module provides types and resolvers needed for a fully-functional GraphQL Server API. This library has no dependencies on any particular server but has been tested using [Apollo Server 3 and 4](https://www.apollographql.com/docs/apollo-server).
|
|
8
|
+
|
|
9
|
+
## Resolvers and Types
|
|
10
|
+
|
|
11
|
+
The graphql package contains typical resolvers and typedefs. The resolvers, however, are dependent on another object: `AnalyticsModel`. This object is responsible for connecting GQL types with an `IAnalyticsStore` implementation.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { AnalyticsModel, AnalyticsResolvers, typedefs } from "@powerhousedao/analytics-engine-graphql";
|
|
15
|
+
import { AnalyticsQueryEngine } from "@powerhousedao/analytics-engine-core";
|
|
16
|
+
import { MemoryAnalyticsStore } from "@powerhousedao/analytics-engine-browser";
|
|
17
|
+
|
|
18
|
+
const model = new AnalyticsModel(new AnalyticsQueryEngine(new MemoryAnalyticsStore()));
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
> Note that the analytics resolvers require the passed in context to have an `AnalyticsModel` implementation on it. See below for details.
|
|
22
|
+
|
|
23
|
+
### Apollo 4
|
|
24
|
+
|
|
25
|
+
A minimal Apollo 4 example is noted below for completeness, but a full working example can be found in the [MakerDAO-SES Ecosystem API repo](https://github.com/makerdao-ses/ecosystem-api/). Note, in particular, that we pass along a specific context in the Apollo express middleware.
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import express from "express";
|
|
29
|
+
import http from "http";
|
|
30
|
+
|
|
31
|
+
import { makeExecutableSchema } from "@graphql-tools/schema";
|
|
32
|
+
import { ApolloServer } from "@apollo/server";
|
|
33
|
+
import { expressMiddleware } from '@apollo/server/express4';
|
|
34
|
+
import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
|
|
35
|
+
|
|
36
|
+
import { AnalyticsModel, AnalyticsResolvers, typedefs } from "@powerhousedao/analytics-engine-graphql";
|
|
37
|
+
import { AnalyticsQueryEngine } from "@powerhousedao/analytics-engine-core";
|
|
38
|
+
import { MemoryAnalyticsStore } from "@powerhousedao/analytics-engine-browser";
|
|
39
|
+
|
|
40
|
+
// create a typical http service
|
|
41
|
+
const app = express();
|
|
42
|
+
const httpServer = http.createServer(app);
|
|
43
|
+
|
|
44
|
+
// create analytics gql schema from typedefs + resolvers
|
|
45
|
+
const schema = makeExecutableSchema({
|
|
46
|
+
typeDefs: typedefs,
|
|
47
|
+
resolvers: AnalyticsResolvers,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// create an apollo instance
|
|
51
|
+
const plugins = [ApolloServerPluginDrainHttpServer({ httpServer }), responseCachePlugin()];
|
|
52
|
+
const server = new ApolloServer({
|
|
53
|
+
schema,
|
|
54
|
+
plugins,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
await server.start();
|
|
58
|
+
|
|
59
|
+
// needed by the analytics resolvers
|
|
60
|
+
const model = new AnalyticsModel(new AnalyticsQueryEngine(new MemoryAnalyticsStore()));
|
|
61
|
+
|
|
62
|
+
app.use("/graphql",
|
|
63
|
+
express.json(),
|
|
64
|
+
expressMiddleware(server, {
|
|
65
|
+
context: ({ req }) => {
|
|
66
|
+
// the analytics resolvers expect this on the context
|
|
67
|
+
return {
|
|
68
|
+
dataSources: { db: { Analytics: model } },
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
await new Promise<void>((resolve) => httpServer.listen(options, resolve));
|
|
75
|
+
```
|
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/high-level.jpg
ADDED
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/indexeddb.png
ADDED
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/libs-core.jpg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/navbar.png
ADDED
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-1.jpg
ADDED
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-2.jpg
ADDED
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-3.jpg
ADDED
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-4.jpg
ADDED
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-5.jpg
ADDED
|
Binary file
|
package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-6.jpg
ADDED
|
Binary file
|