Skip to content

Conversation

@nikgraf
Copy link
Collaborator

@nikgraf nikgraf commented Jun 2, 2025

from:

import { Entity } from '@graphprotocol/hypergraph';

export class Todo extends Entity.Class<Todo>('Todo')({
  name: Entity.Text,
  completed: Entity.Checkbox,
  assignees: Entity.Relation(User),
}) {}

to

import { Entity, Type } from '@graphprotocol/hypergraph';

export class Todo extends Entity.Class<Todo>('Todo')({
  name: Type.Text,
  completed: Type.Checkbox,
  assignees: Type.Relation(User),
}) {}

@vercel
Copy link

vercel bot commented Jun 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hypergraph-connect ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 0:22am
hypergraph-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 0:22am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the schema definition by migrating type definitions from the Entity module to a new standalone Type module. Key changes include:

  • Switching from Entity.Text, Entity.Number, etc. to Type.Text, Type.Number, etc. across tests and application files.
  • Introducing a new file (packages/hypergraph/src/type/type.ts) for type definitions.
  • Updating exports in packages/hypergraph/src/index.ts and cleaning up duplicate type definitions from the Entity module.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/hypergraph/test/entity/findMany.test.ts Updated entity definitions to use Type module types.
packages/hypergraph/test/entity/entity.test.ts Updated entity definitions to use Type module types.
packages/hypergraph/src/type/type.ts New file defining type schemas.
packages/hypergraph/src/index.ts Added export for Type and adjusted Inboxes export order.
packages/hypergraph/src/entity/entity.ts Removed duplicate type definitions, now using Type module types.
packages/hypergraph-react/test/HypergraphSpaceContext.test.tsx Updated import to include Type module types.
apps/events/src/schema.ts Updated schema definitions to use Type module types.

@nikgraf nikgraf merged commit 82b867a into main Jun 2, 2025
7 checks passed
@nikgraf nikgraf deleted the ng/update-type-exports branch June 2, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants