Commit 038e39a 1 parent b9b44ba commit 038e39a Copy full SHA for 038e39a
File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,28 @@ import { Network } from './src/utils/enums'
4
4
import configs from './src/utils/configs'
5
5
6
6
7
- // For every network we have same gql shema, so we can use just Mainnet here
8
- const urls = configs [ Network . Holesky ] . api
7
+ let network : Network = Network . Holesky
8
+
9
+ if ( process . env . NETWORK === 'mainnet' ) {
10
+ network = Network . Mainnet
11
+ }
12
+ if ( process . env . NETWORK === 'gnosis' ) {
13
+ network = Network . Gnosis
14
+ }
15
+
16
+ const config = configs [ network ]
17
+ const subgraphIndex = Number ( process . env . SUBGRAPH_INDEX || 0 )
18
+
19
+ const subgraphUrl = Array . isArray ( config . api . subgraph )
20
+ ? config . api . subgraph [ subgraphIndex ]
21
+ : config . api . subgraph
22
+
23
+ const urls : Record < string , string > = {
24
+ backend : config . api . backend ,
25
+ subgraph : subgraphUrl ,
26
+ }
27
+
28
+ console . log ( `Generating types for network: ${ config . network . id } ` , urls )
9
29
10
30
// https://the-guild.dev/graphql/codegen/plugins/typescript/typescript
11
31
const typesConfig = {
You can’t perform that action at this time.
0 commit comments