|
1 |
| -import { Entity, Type } from '@graphprotocol/hypergraph'; |
| 1 | +import { EntitySchema, Id, Type } from '@graphprotocol/hypergraph'; |
2 | 2 |
|
3 |
| -export class Image extends Entity.Class<Image>('Image')({ |
4 |
| - url: Type.String, |
5 |
| -}) {} |
| 3 | +export const Image = EntitySchema( |
| 4 | + { |
| 5 | + url: Type.String, |
| 6 | + }, |
| 7 | + { |
| 8 | + types: [Id('ba4e4146-0010-499d-a0a3-caaa7f579d0e')], |
| 9 | + properties: { |
| 10 | + url: Id('8a743832-c094-4a62-b665-0c3cc2f9c7bc'), |
| 11 | + }, |
| 12 | + }, |
| 13 | +); |
6 | 14 |
|
7 |
| -export class Project extends Entity.Class<Project>('Project')({ |
8 |
| - name: Type.String, |
9 |
| - description: Type.optional(Type.String), |
10 |
| - xUrl: Type.optional(Type.String), |
11 |
| - avatar: Type.Relation(Image), |
12 |
| -}) {} |
| 15 | +export const Project = EntitySchema( |
| 16 | + { |
| 17 | + name: Type.String, |
| 18 | + description: Type.optional(Type.String), |
| 19 | + x: Type.optional(Type.String), |
| 20 | + avatar: Type.Relation(Image), |
| 21 | + }, |
| 22 | + { |
| 23 | + types: [Id('484a18c5-030a-499c-b0f2-ef588ff16d50')], |
| 24 | + properties: { |
| 25 | + name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'), |
| 26 | + description: Id('9b1f76ff-9711-404c-861e-59dc3fa7d037'), |
| 27 | + x: Id('0d625978-4b3c-4b57-a86f-de45c997c73c'), |
| 28 | + avatar: Id('1155beff-fad5-49b7-a2e0-da4777b8792c'), |
| 29 | + }, |
| 30 | + }, |
| 31 | +); |
13 | 32 |
|
14 |
| -export class Dapp extends Entity.Class<Dapp>('Dapp')({ |
15 |
| - name: Type.String, |
16 |
| - description: Type.optional(Type.String), |
17 |
| - xUrl: Type.optional(Type.String), |
18 |
| - githubUrl: Type.optional(Type.String), |
19 |
| - avatar: Type.Relation(Image), |
20 |
| -}) {} |
| 33 | +export const Dapp = EntitySchema( |
| 34 | + { |
| 35 | + name: Type.String, |
| 36 | + description: Type.optional(Type.String), |
| 37 | + x: Type.optional(Type.String), |
| 38 | + github: Type.optional(Type.String), |
| 39 | + avatar: Type.Relation(Image), |
| 40 | + }, |
| 41 | + { |
| 42 | + types: [Id('8ca136d0-698a-4bbf-a76b-8e2741b2dc8c')], |
| 43 | + properties: { |
| 44 | + name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'), |
| 45 | + description: Id('9b1f76ff-9711-404c-861e-59dc3fa7d037'), |
| 46 | + x: Id('0d625978-4b3c-4b57-a86f-de45c997c73c'), |
| 47 | + github: Id('9eedefa8-60ae-4ac1-9a04-805054a4b094'), |
| 48 | + avatar: Id('1155beff-fad5-49b7-a2e0-da4777b8792c'), |
| 49 | + }, |
| 50 | + }, |
| 51 | +); |
21 | 52 |
|
22 |
| -export class Investor extends Entity.Class<Investor>('Investor')({ |
23 |
| - name: Type.String, |
24 |
| -}) {} |
| 53 | +export const Investor = EntitySchema( |
| 54 | + { |
| 55 | + name: Type.String, |
| 56 | + }, |
| 57 | + { |
| 58 | + types: [Id('331aea18-973c-4adc-8f53-614f598d262d')], |
| 59 | + properties: { |
| 60 | + name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'), |
| 61 | + }, |
| 62 | + }, |
| 63 | +); |
25 | 64 |
|
26 |
| -export class FundingStage extends Entity.Class<FundingStage>('FundingStage')({ |
27 |
| - name: Type.String, |
28 |
| -}) {} |
| 65 | +export const FundingStage = EntitySchema( |
| 66 | + { |
| 67 | + name: Type.String, |
| 68 | + }, |
| 69 | + { |
| 70 | + types: [Id('8d35d217-3fa1-4686-b74f-fcb3e9438067')], |
| 71 | + properties: { |
| 72 | + name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'), |
| 73 | + }, |
| 74 | + }, |
| 75 | +); |
29 | 76 |
|
30 |
| -export class InvestmentRound extends Entity.Class<InvestmentRound>('InvestmentRound')({ |
31 |
| - name: Type.String, |
32 |
| - raisedAmount: Type.optional(Type.Number), |
33 |
| - investors: Type.Relation(Investor), |
34 |
| - fundingStages: Type.Relation(FundingStage), |
35 |
| - raisedBy: Type.Relation(Project), |
36 |
| -}) {} |
| 77 | +export const InvestmentRound = EntitySchema( |
| 78 | + { |
| 79 | + name: Type.String, |
| 80 | + raisedAmount: Type.optional(Type.Number), |
| 81 | + investors: Type.Relation(Investor), |
| 82 | + fundingStages: Type.Relation(FundingStage), |
| 83 | + raisedBy: Type.Relation(Project), |
| 84 | + }, |
| 85 | + { |
| 86 | + types: [Id('8f03f4c9-59e4-44a8-a625-c0a40b1ff330')], |
| 87 | + properties: { |
| 88 | + name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'), |
| 89 | + raisedAmount: Id('16781706-dd9c-48bf-913e-cdf18b56034f'), |
| 90 | + investors: Id('9b8a610a-fa35-486e-a479-e253dbdabb4f'), |
| 91 | + fundingStages: Id('e278c3d4-78b9-4222-b272-5a39a8556bd2'), |
| 92 | + raisedBy: Id('b4878d1a-0609-488d-b8a6-e19862d6b62f'), |
| 93 | + }, |
| 94 | + }, |
| 95 | +); |
37 | 96 |
|
38 |
| -export class Asset extends Entity.Class<Asset>('Asset')({ |
39 |
| - name: Type.String, |
40 |
| - symbol: Type.optional(Type.String), |
41 |
| - blockchainAddress: Type.optional(Type.String), |
42 |
| -}) {} |
| 97 | +export const Asset = EntitySchema( |
| 98 | + { |
| 99 | + name: Type.String, |
| 100 | + symbol: Type.optional(Type.String), |
| 101 | + blockchainAddress: Type.optional(Type.String), |
| 102 | + }, |
| 103 | + { |
| 104 | + types: [Id('f8780a80-c238-4a2a-96cb-567d88b1aa63')], |
| 105 | + properties: { |
| 106 | + name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'), |
| 107 | + symbol: Id('ace1e96c-9b83-47b4-bd33-1d302ec0a0f5'), |
| 108 | + blockchainAddress: Id('56b5944f-f059-48d1-b0fa-34abe84219da'), |
| 109 | + }, |
| 110 | + }, |
| 111 | +); |
0 commit comments