Skip to content

Commit 64ba7f4

Browse files
committed
cleanup imports
1 parent 5324cc8 commit 64ba7f4

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

packages/hypergraph-react/src/internal/convert-property-value.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { PropertyTypeSymbol } from '@graphprotocol/hypergraph/constants';
1+
import { Constants } from '@graphprotocol/hypergraph';
22
import * as Option from 'effect/Option';
33
import * as SchemaAST from 'effect/SchemaAST';
44

55
export const convertPropertyValue = (
66
property: { propertyId: string; string: string; boolean: boolean; number: number; time: string; point: string },
77
type: SchemaAST.AST,
88
) => {
9-
const propertyType = SchemaAST.getAnnotation<string>(PropertyTypeSymbol)(type);
9+
const propertyType = SchemaAST.getAnnotation<string>(Constants.PropertyTypeSymbol)(type);
1010
if (Option.isSome(propertyType)) {
1111
if (propertyType.value === 'string') {
1212
return property.string;

packages/hypergraph-react/src/internal/convert-relations.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { PropertyIdSymbol, TypeIdsSymbol } from '@graphprotocol/hypergraph/constants';
2-
import { isRelation } from '@graphprotocol/hypergraph/utils/isRelation';
1+
import { Constants, Utils } from '@graphprotocol/hypergraph';
32
import * as Option from 'effect/Option';
43
import type * as Schema from 'effect/Schema';
54
import * as SchemaAST from 'effect/SchemaAST';
@@ -34,13 +33,13 @@ export const convertRelations = <S extends Schema.Schema.AnyNoContext>(
3433
const rawEntity: Record<string, string | boolean | number | unknown[] | Date> = {};
3534

3635
for (const prop of ast.propertySignatures) {
37-
const result = SchemaAST.getAnnotation<string>(PropertyIdSymbol)(prop.type);
36+
const result = SchemaAST.getAnnotation<string>(Constants.PropertyIdSymbol)(prop.type);
3837

39-
if (isRelation(prop.type) && Option.isSome(result)) {
38+
if (Utils.isRelation(prop.type) && Option.isSome(result)) {
4039
rawEntity[String(prop.name)] = [];
4140

4241
const relationTransformation = prop.type.rest?.[0]?.type;
43-
const typeIds: string[] = SchemaAST.getAnnotation<string[]>(TypeIdsSymbol)(relationTransformation).pipe(
42+
const typeIds: string[] = SchemaAST.getAnnotation<string[]>(Constants.TypeIdsSymbol)(relationTransformation).pipe(
4443
Option.getOrElse(() => []),
4544
);
4645
if (typeIds.length === 0) {
@@ -69,7 +68,7 @@ export const convertRelations = <S extends Schema.Schema.AnyNoContext>(
6968
};
7069

7170
for (const nestedProp of relationTransformation.propertySignatures) {
72-
const nestedResult = SchemaAST.getAnnotation<string>(PropertyIdSymbol)(nestedProp.type);
71+
const nestedResult = SchemaAST.getAnnotation<string>(Constants.PropertyIdSymbol)(nestedProp.type);
7372
if (Option.isSome(nestedResult)) {
7473
const value = relationEntry.toEntity.valuesList?.find((a) => a.propertyId === nestedResult.value);
7574
if (!value) {

0 commit comments

Comments
 (0)