Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/deep-banks-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@graphprotocol/hypergraph-react": patch
"@graphprotocol/hypergraph": patch
"@graphprotocol/typesync": patch
"@graphprotocol/hypergraph-cli": patch
---

remove unsupported dataType Url
2 changes: 1 addition & 1 deletion apps/events/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class Todo2 extends Entity.Class<Todo2>('Todo2')({
due: Type.Date,
amount: Type.Number,
point: Type.Point,
website: Type.Url,
website: Type.Text,
}) {}

export class JobOffer extends Entity.Class<JobOffer>('JobOffer')({
Expand Down
2 changes: 0 additions & 2 deletions apps/typesync/client/src/Components/App/Schema/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ function fieldToEntityString({
return 'Type.Boolean';
case type_name === 'Date':
return 'Type.Date';
case type_name === 'Url':
return 'Type.Url';
case type_name === 'Point':
return 'Type.Point';
case type_name.startsWith('Relation'):
Expand Down
2 changes: 0 additions & 2 deletions apps/typesync/src/Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ function fieldToEntityString({
return 'Type.Checkbox';
case dataType === 'Date':
return 'Type.Date';
case dataType === 'Url':
return 'Type.Url';
case dataType === 'Point':
return 'Type.Point';
case Mapping.isDataTypeRelation(dataType):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ export function useGenerateUpdateOps<const S extends Entity.AnyNoContext>(type:
// // @ts-expect-error: must be an array of numbers
// value: rawValue.join(','),
// };
// } else if (type.fields[key] === Type.Url) {
// value = {
// type: 'URL',
// // @ts-expect-error: must be a URL
// value: rawValue.toString(),
// };
// } else if (type.fields[key] === Type.Date) {
// value = {
// type: 'TIME',
Expand Down
9 changes: 3 additions & 6 deletions packages/hypergraph-react/src/internal/use-query-public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ const convertPropertyValue = (
if (type.fields[key] === Type.Point) {
return property.value;
}
if (type.fields[key] === Type.Url) {
return property.value;
}
if (type.fields[key] === Type.Date) {
return property.value;
}
Expand All @@ -178,7 +175,7 @@ const convertRelations = <S extends Entity.AnyNoContext>(
mappingEntry: MappingEntry,
mapping: Mapping,
) => {
const rawEntity: Record<string, string | boolean | number | unknown[] | URL | Date> = {};
const rawEntity: Record<string, string | boolean | number | unknown[] | Date> = {};

for (const [key, relationId] of Object.entries(mappingEntry?.relations ?? {})) {
const properties = (queryEntity.relationsList ?? []).filter((a) => a.typeId === relationId);
Expand Down Expand Up @@ -212,7 +209,7 @@ const convertRelations = <S extends Entity.AnyNoContext>(
// @ts-expect-error TODO: properly access the type.name
const type = field.value;

let rawEntity: Record<string, string | boolean | number | unknown[] | URL | Date> = {
let rawEntity: Record<string, string | boolean | number | unknown[] | Date> = {
id: propertyEntry.toEntity.id,
name: propertyEntry.toEntity.name,
// TODO: should be determined by the actual value
Expand Down Expand Up @@ -262,7 +259,7 @@ export const parseResult = <S extends Entity.AnyNoContext>(
const invalidEntities: Record<string, unknown>[] = [];

for (const queryEntity of queryData.entities) {
let rawEntity: Record<string, string | boolean | number | unknown[] | URL | Date> = {
let rawEntity: Record<string, string | boolean | number | unknown[] | Date> = {
id: queryEntity.id,
};

Expand Down
8 changes: 0 additions & 8 deletions packages/hypergraph-react/src/use-query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ const _getDiff = <S extends Entity.AnyNoContext>(
new: localEntity[key],
};
}
} else if (field === Type.Url) {
if (entity[key].toString() !== localEntity[key].toString()) {
diff[key] = {
type: 'property',
current: entity[key],
new: localEntity[key],
};
}
} else if (field === Type.Point) {
if (entity[key].join(',') !== localEntity[key].join(',')) {
diff[key] = {
Expand Down
1 change: 0 additions & 1 deletion packages/hypergraph/src/type/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const Number = Schema.Number;
export const Checkbox = Schema.Boolean;
// biome-ignore lint/suspicious/noShadowRestrictedNames: is part of a namespaces module and therefor ok
export const Date = Schema.Date;
export const Url = Schema.URL;
export const Point = Schema.transform(Schema.String, Schema.Array(Number), {
strict: true,
decode: (str: string) => {
Expand Down
5 changes: 1 addition & 4 deletions packages/typesync/src/Mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export type SchemaDataTypeRelation = typeof SchemaDataTypeRelation.Type;
/**
* @since 0.0.1
*/
export const SchemaDataTypePrimitive = EffectSchema.Literal('Text', 'Number', 'Checkbox', 'Date', 'Point', 'Url');
export const SchemaDataTypePrimitive = EffectSchema.Literal('Text', 'Number', 'Checkbox', 'Date', 'Point');
/**
* @since 0.0.1
*/
Expand Down Expand Up @@ -761,9 +761,6 @@ export function mapSchemaDataTypeToGRC20PropDataType(dataType: SchemaDataType):
case dataType === 'Point': {
return 'POINT';
}
case dataType === 'Url': {
return 'TEXT';
}
case isDataTypeRelation(dataType): {
return 'RELATION';
}
Expand Down
Loading