Skip to content

Commit

Permalink
updated graphql package with more currencies and metrics, also export…
Browse files Browse the repository at this point in the history
… AnalyticsModel correctly
  • Loading branch information
thegoldenmule committed Nov 21, 2024
1 parent b33e2f0 commit 7fe9e1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powerhousedao/analytics-engine-graphql",
"version": "0.1.1",
"version": "0.2.0",
"license": "AGPL-3.0-only",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
15 changes: 12 additions & 3 deletions graphql/src/AnalyticsResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,28 @@ export const AnalyticsResolvers: any = {
},
metrics: async (parent: any, { filter }: any, { dataSources }: any) => {
return [
"Actuals",
"AuditorNetOutflow",
"Budget",
"Contributors",
"Count",
"DailyDaiPriceChange",
"DailyEthPriceChange",
"DailyMkrPriceChange",
"DailyUsdcPriceChange",
"DailyUsdpPriceChange",
"Forecast",
"Actuals",
"PaymentsOnChain",
"PaymentsOffChainIncluded",
"PaymentsOnChain",
"ProtocolNetOutflow",
];
},
dimensions: async (_: any, { filter }: any, { dataSources }: any) => {
const queryEngine: AnalyticsModel = dataSources.db.Analytics;
return await queryEngine.getDimensions();
},
currencies: async (_: any, { filter }: any, { dataSources }: any) => {
return ["MKR", "DAI"];
return ["DAI", "FTE", "GUSD", "MKR", "USDC", "USDP", "USDT"];
},
multiCurrencySeries: async (
_: any,
Expand Down
3 changes: 2 additions & 1 deletion graphql/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { AnalyticsResolvers } from "./AnalyticsResolvers.js";
export type { queryFilter, AnalyticsModel } from "./AnalyticsModel.js";
export type { queryFilter } from "./AnalyticsModel.js";
export { AnalyticsModel } from "./AnalyticsModel.js";
export { typedefs } from "./schema.js";

0 comments on commit 7fe9e1d

Please sign in to comment.