@powerhousedao/vetra-builder-package 0.0.4 → 0.0.5
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.
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* This file aggregates all processor factories
|
|
3
3
|
* Auto-generated by codegen - DO NOT EDIT MANUALLY
|
|
4
4
|
*/
|
|
5
|
-
// Import processor factories here as they are generated
|
|
5
|
+
// Import other processor factories here as they are generated
|
|
6
6
|
import { vetraReadModelProcessorFactory } from "./vetra-read-model/factory.js";
|
|
7
7
|
export const processorFactory = (module) => {
|
|
8
8
|
// Initialize all processor factories once with the module
|
|
9
9
|
const factories = [];
|
|
10
|
-
// Add processors here as they are generated
|
|
10
|
+
// Add other processors here as they are generated
|
|
11
11
|
factories.push(vetraReadModelProcessorFactory(module));
|
|
12
12
|
// Return the inner function that will be called for each drive
|
|
13
13
|
return async (driveHeader) => {
|
|
14
14
|
const processors = [];
|
|
15
|
-
// Call each cached factory with the
|
|
15
|
+
// Call each cached factory with the driveId
|
|
16
16
|
for (const factory of factories) {
|
|
17
17
|
const factoryProcessors = await factory(driveHeader);
|
|
18
18
|
processors.push(...factoryProcessors);
|
|
@@ -4,8 +4,8 @@ export const getResolvers = (subgraph) => {
|
|
|
4
4
|
const db = subgraph.relationalDb;
|
|
5
5
|
return {
|
|
6
6
|
Query: {
|
|
7
|
-
fetchAllBuilderAccounts: async (parent, args
|
|
8
|
-
const driveId =
|
|
7
|
+
fetchAllBuilderAccounts: async (parent, args) => {
|
|
8
|
+
const driveId = args.driveId || "powerhouse";
|
|
9
9
|
const accounts = await VetraReadModelProcessor.query(driveId, db)
|
|
10
10
|
.selectFrom("builder_accounts")
|
|
11
11
|
.selectAll()
|
|
@@ -25,8 +25,8 @@ export const getResolvers = (subgraph) => {
|
|
|
25
25
|
members: [], // Will be resolved by field resolver
|
|
26
26
|
}));
|
|
27
27
|
},
|
|
28
|
-
fetchBuilderAccount: async (parent, args
|
|
29
|
-
const driveId =
|
|
28
|
+
fetchBuilderAccount: async (parent, args) => {
|
|
29
|
+
const driveId = args.driveId || "powerhouse";
|
|
30
30
|
const account = await VetraReadModelProcessor.query(driveId, db)
|
|
31
31
|
.selectFrom("builder_accounts")
|
|
32
32
|
.selectAll()
|
|
@@ -63,7 +63,7 @@ export const schema = gql `
|
|
|
63
63
|
|
|
64
64
|
type Query {
|
|
65
65
|
example(driveId: String!): String
|
|
66
|
-
fetchAllBuilderAccounts: [BuilderAccountType!]!
|
|
67
|
-
fetchBuilderAccount(id: String!): BuilderAccountType
|
|
66
|
+
fetchAllBuilderAccounts(driveId: String): [BuilderAccountType!]!
|
|
67
|
+
fetchBuilderAccount(driveId: String, id: String!): BuilderAccountType
|
|
68
68
|
}
|
|
69
69
|
`;
|