Skip to content

Commit 178a6a7

Browse files
committed
refactor(graphql): move HypercertWithMetadata to own file
- to prevent circular imports in tests
1 parent e2956bf commit 178a6a7

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { ObjectType } from "type-graphql";
2+
3+
import { Field } from "type-graphql";
4+
import { Metadata } from "../metadataTypeDefs.js";
5+
import { HypercertBaseType } from "./hypercertBaseType.js";
6+
7+
@ObjectType({
8+
description:
9+
"Hypercert with metadata, contract, orders, sales and fraction information",
10+
simpleResolvers: true,
11+
})
12+
export class HypercertWithMetadata extends HypercertBaseType {
13+
// Resolved fields
14+
@Field(() => Metadata, {
15+
nullable: true,
16+
description: "The metadata for the hypercert as referenced by the uri",
17+
})
18+
metadata?: Metadata;
19+
}

src/graphql/schemas/typeDefs/hypercertTypeDefs.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,6 @@ export class Hypercert extends HypercertBaseType {
6565
sales?: GetSalesResponse;
6666
}
6767

68-
@ObjectType({
69-
description:
70-
"Hypercert with metadata, contract, orders, sales and fraction information",
71-
simpleResolvers: true,
72-
})
73-
export class HypercertWithMetadata extends HypercertBaseType {
74-
// Resolved fields
75-
@Field(() => Metadata, {
76-
nullable: true,
77-
description: "The metadata for the hypercert as referenced by the uri",
78-
})
79-
metadata?: Metadata;
80-
}
81-
8268
@ObjectType({
8369
description:
8470
"Hypercert with metadata, contract, orders, sales and fraction information",

src/graphql/schemas/typeDefs/orderTypeDefs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DataResponse } from "../../../lib/graphql/DataResponse.js";
33
import { EthBigInt } from "../../scalars/ethBigInt.js";
44
import { BasicTypeDef } from "./baseTypes/basicTypeDef.js";
55
import { HypercertBaseType } from "./baseTypes/hypercertBaseType.js";
6-
import { HypercertWithMetadata } from "./hypercertTypeDefs.js";
6+
import { HypercertWithMetadata } from "./baseTypes/hypercertBaseWithMetadata.js";
77

88
@ObjectType({
99
description: "Marketplace order for a hypercert",

src/graphql/schemas/typeDefs/salesTypeDefs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Field, ObjectType } from "type-graphql";
22
import { EthBigInt } from "../../scalars/ethBigInt.js";
33
import { BasicTypeDef } from "./baseTypes/basicTypeDef.js";
44
import { DataResponse } from "../../../lib/graphql/DataResponse.js";
5-
import { HypercertWithMetadata } from "./hypercertTypeDefs.js";
65
import { HypercertBaseType } from "./baseTypes/hypercertBaseType.js";
6+
import { HypercertWithMetadata } from "./baseTypes/hypercertBaseWithMetadata.js";
77

88
@ObjectType()
99
export class Sale extends BasicTypeDef {

0 commit comments

Comments
 (0)