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
9 changes: 8 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
"Bash(pnpm test:*)",
"Bash(pnpm vitest:*)",
"Bash(pnpm changeset:*)",
"Bash(npx tsc:*)"
"Bash(npx tsc:*)",
"Bash(find:*)",
"Bash(grep:*)",
"WebFetch(domain:raw.githubusercontent.com)",
"Bash(node -e:*)",
"Bash(pnpm build:*)",
"mcp__chrome-devtools__list_pages",
"Bash(pnpm lint:*)"
],
"deny": [],
"ask": []
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@base-ui-components/react": "1.0.0-beta.2",
"@graphprotocol/grc-20": "^0.27.0",
"@graphprotocol/grc-20": "^0.32.3",
"@graphprotocol/hypergraph": "workspace:*",
"@graphprotocol/hypergraph-react": "workspace:*",
"@heroicons/react": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:script": "tsx test-script.ts"
},
"dependencies": {
"@graphprotocol/grc-20": "^0.27.0",
"@graphprotocol/grc-20": "^0.32.3",
"@graphprotocol/hypergraph": "workspace:*",
"@graphprotocol/hypergraph-react": "workspace:*",
"@noble/hashes": "^1.8.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/events/src/Boot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function Boot() {
<HypergraphAppProvider
syncServerUri="http://localhost:3030"
appId="93bb8907085a4a0e83dd62b0dc98e793"
apiOrigin="https://testnet-api.geobrowser.io"
apiOrigin="https://testnet-api-staging.geobrowser.io"
>
<RouterProvider router={router} />
</HypergraphAppProvider>
Expand Down
10 changes: 6 additions & 4 deletions apps/events/src/components/create-events.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Graph, type Op } from '@graphprotocol/grc-20';
import { Graph, type GrcOp } from '@graphprotocol/grc-20';
import type { Connect } from '@graphprotocol/hypergraph';
import { publishOps, useHypergraphApp } from '@graphprotocol/hypergraph-react';
import { mapping } from '../mapping';
Expand All @@ -12,15 +12,16 @@ const createEvents = async ({
space: string;
}) => {
try {
const ops: Array<Op> = [];
const ops: Array<GrcOp> = [];

const { id: jobOfferTypeId, ops: createJobOfferTypeOps } = Graph.createEntity({
name: 'My Test Job Offer',
types: mapping.JobOffer.typeIds,
values: [
{
property: mapping.JobOffer.properties?.salary as string,
value: '80000',
type: 'float64',
value: 80000,
},
],
});
Expand All @@ -32,7 +33,8 @@ const createEvents = async ({
values: [
{
property: mapping.JobOffer.properties?.salary as string,
value: '90000',
type: 'float64',
value: 90000,
},
],
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Graph, type Op } from '@graphprotocol/grc-20';
import { Graph, type GrcOp } from '@graphprotocol/grc-20';
import type { Connect } from '@graphprotocol/hypergraph';
import { publishOps, useHypergraphApp } from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
Expand All @@ -12,9 +12,9 @@ const createPropertiesAndTypesEvent = async ({
smartSessionClient: Connect.SmartSessionClient;
space: string;
}) => {
const ops: Array<Op> = [];
const ops: Array<GrcOp> = [];
const { id: salaryPropertyId, ops: createSalaryPropertyOps } = Graph.createProperty({
dataType: 'NUMBER',
dataType: 'FLOAT64',
name: 'Salary',
});
ops.push(...createSalaryPropertyOps);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Graph, type Op } from '@graphprotocol/grc-20';
import { Graph, type GrcOp } from '@graphprotocol/grc-20';
import type { Connect } from '@graphprotocol/hypergraph';
import { publishOps, useHypergraphApp } from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
Expand All @@ -12,7 +12,7 @@ const createPropertiesAndTypesTodos = async ({
smartSessionClient: Connect.SmartSessionClient;
space: string;
}) => {
const ops: Array<Op> = [];
const ops: Array<GrcOp> = [];
const { id: checkedPropertyId, ops: createCheckedPropertyOps } = Graph.createProperty({
dataType: 'BOOLEAN',
name: 'Checked',
Expand Down Expand Up @@ -44,13 +44,13 @@ const createPropertiesAndTypesTodos = async ({
ops.push(...createPointPropertyOps);

const { id: amountPropertyId, ops: createAmountPropertyOps } = Graph.createProperty({
dataType: 'NUMBER',
dataType: 'FLOAT64',
name: 'Amount',
});
ops.push(...createAmountPropertyOps);

const { id: websitePropertyId, ops: createWebsitePropertyOps } = Graph.createProperty({
dataType: 'STRING',
dataType: 'TEXT',
name: 'Website',
});
ops.push(...createWebsitePropertyOps);
Expand Down
2 changes: 1 addition & 1 deletion apps/events/src/routes/podcasts.lazy.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Person, PersonHostTest, Podcast, Topic } from '@/schema';
import { useEntities, useEntity, usePublicSpaces } from '@graphprotocol/hypergraph-react';
import { createLazyFileRoute } from '@tanstack/react-router';
import { Person, PersonHostTest, Podcast, Topic } from '@/schema';
Comment on lines 2 to +3
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The import statements have been reordered. While this doesn't affect functionality, the imports from @/schema should typically come after external package imports (from @graphprotocol and @tanstack). Consider maintaining consistent import ordering throughout the codebase for better maintainability.

Copilot uses AI. Check for mistakes.

export const Route = createLazyFileRoute('/podcasts')({
component: RouteComponent,
Expand Down
2 changes: 1 addition & 1 deletion apps/events/test-script.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SystemIds } from '@graphprotocol/grc-20';
import { Config, Entity, Id, Type } from '@graphprotocol/hypergraph';

Config.setApiOrigin('https://testnet-api.geobrowser.io');
Config.setApiOrigin('https://testnet-api-staging.geobrowser.io');

const BOUNTY_TYPE_ID = Id('327976dea5ad45769b83b7e7ec6337cf');
const REWARD_PROPERTY_ID = Id('e8e7301136354e84b46b767e7cd530a8');
Expand Down
2 changes: 1 addition & 1 deletion apps/next-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"type": "module",
"dependencies": {
"@graphprotocol/grc-20": "^0.27.0",
"@graphprotocol/grc-20": "^0.32.3",
"@graphprotocol/hypergraph": "workspace:*",
"@graphprotocol/hypergraph-react": "workspace:*",
"next": "15.5.9",
Expand Down
2 changes: 1 addition & 1 deletion apps/privy-login-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"typesync": "hypergraph typesync"
},
"dependencies": {
"@graphprotocol/grc-20": "^0.27.0",
"@graphprotocol/grc-20": "^0.32.3",
"@graphprotocol/hypergraph": "workspace:*",
"@graphprotocol/hypergraph-react": "workspace:*",
"@noble/hashes": "^1.8.0",
Expand Down
10 changes: 6 additions & 4 deletions apps/privy-login-example/src/components/create-events.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Graph, type Op } from '@graphprotocol/grc-20';
import { Graph, type GrcOp } from '@graphprotocol/grc-20';
import type { Connect } from '@graphprotocol/hypergraph';
import { publishOps, useHypergraphApp } from '@graphprotocol/hypergraph-react';
import { mapping } from '../mapping';
Expand All @@ -12,15 +12,16 @@ const createEvents = async ({
space: string;
}) => {
try {
const ops: Array<Op> = [];
const ops: Array<GrcOp> = [];

const { id: jobOfferTypeId, ops: createJobOfferTypeOps } = Graph.createEntity({
name: 'My Test Job Offer',
types: mapping.JobOffer.typeIds,
values: [
{
property: mapping.JobOffer.properties?.salary as string,
value: '80000',
type: 'float64',
value: 80000,
},
],
});
Expand All @@ -32,7 +33,8 @@ const createEvents = async ({
values: [
{
property: mapping.JobOffer.properties?.salary as string,
value: '90000',
type: 'float64',
value: 90000,
},
],
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Graph, type Op } from '@graphprotocol/grc-20';
import { Graph, type GrcOp } from '@graphprotocol/grc-20';
import type { Connect } from '@graphprotocol/hypergraph';
import { publishOps, useHypergraphApp } from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
Expand All @@ -12,9 +12,9 @@ const createPropertiesAndTypesEvent = async ({
smartSessionClient: Connect.SmartSessionClient;
space: string;
}) => {
const ops: Array<Op> = [];
const ops: Array<GrcOp> = [];
const { id: salaryPropertyId, ops: createSalaryPropertyOps } = Graph.createProperty({
dataType: 'NUMBER',
dataType: 'FLOAT64',
name: 'Salary',
});
ops.push(...createSalaryPropertyOps);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Graph, type Op } from '@graphprotocol/grc-20';
import { Graph, type GrcOp } from '@graphprotocol/grc-20';
import type { Connect } from '@graphprotocol/hypergraph';
import { publishOps, useHypergraphApp } from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
Expand All @@ -12,7 +12,7 @@ const createPropertiesAndTypesTodos = async ({
smartSessionClient: Connect.SmartSessionClient;
space: string;
}) => {
const ops: Array<Op> = [];
const ops: Array<GrcOp> = [];
const { id: checkedPropertyId, ops: createCheckedPropertyOps } = Graph.createProperty({
dataType: 'BOOLEAN',
name: 'Checked',
Expand Down Expand Up @@ -44,13 +44,13 @@ const createPropertiesAndTypesTodos = async ({
ops.push(...createPointPropertyOps);

const { id: amountPropertyId, ops: createAmountPropertyOps } = Graph.createProperty({
dataType: 'NUMBER',
dataType: 'FLOAT64',
name: 'Amount',
});
ops.push(...createAmountPropertyOps);

const { id: websitePropertyId, ops: createWebsitePropertyOps } = Graph.createProperty({
dataType: 'STRING',
dataType: 'TEXT',
name: 'Website',
});
ops.push(...createWebsitePropertyOps);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@changesets/cli": "^2.29.8",
"@effect/language-service": "^0.40.0",
"@effect/vitest": "^0.25.1",
"@graphprotocol/grc-20": "^0.27.0",
"@graphprotocol/grc-20": "^0.32.3",
"babel-plugin-annotate-pure-calls": "^0.5.0",
"glob": "^11.0.3",
"pkg-pr-new": "^0.0.56",
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@automerge/automerge": "^3.1.1",
"@automerge/automerge-repo": "^2.2.0",
"@automerge/automerge-repo-react-hooks": "^2.2.0",
"@graphprotocol/grc-20": "^0.27.0",
"@graphprotocol/grc-20": "^0.32.3",
"@noble/hashes": "^1.8.0",
"@tanstack/react-query": "^5.85.5",
"effect": "^3.17.13",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Op } from '@graphprotocol/grc-20';
import type { GrcOp } from '@graphprotocol/grc-20';
import { Config } from '@graphprotocol/hypergraph';
import { gql, request } from 'graphql-request';

Expand Down Expand Up @@ -51,7 +51,7 @@ export const generateDeleteOps = async ({ id }: { id: string; space: string }) =
if (result.entity === null) {
throw new Error('Entity not found');
}
const ops: Op[] = [];
const ops: GrcOp[] = [];
// for (const attribute of result.entity.currentVersion.version.triples.nodes) {
// ops.push(Triple.remove({ attributeId: attribute.attributeId, entityId: id }));
// }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,16 @@
import { Graph, type Op } from '@graphprotocol/grc-20';
import { Graph } from '@graphprotocol/grc-20';
import type { Connect } from '@graphprotocol/hypergraph';
import { Config, Constants } from '@graphprotocol/hypergraph';
import { Constants } from '@graphprotocol/hypergraph';
import { useQueryClient } from '@tanstack/react-query';
import * as Option from 'effect/Option';
import type * as Schema from 'effect/Schema';
import * as SchemaAST from 'effect/SchemaAST';
import request, { gql } from 'graphql-request';
import { publishOps } from '../publish-ops.js';

type DeleteEntityPublicParams = {
space: string;
};

const deleteEntityQueryDocument = gql`
query entityToDelete($entityId: UUID!, $spaceId: UUID!) {
entity(id: $entityId) {
valuesList(filter: {spaceId: {is: $spaceId}}) {
propertyId
}
relationsList(filter: {spaceId: {is: $spaceId}}) {
id
}
}
}
`;

type EntityToDeleteQueryResult = {
entity: {
valuesList: {
propertyId: string;
}[];
relationsList: {
id: string;
}[];
};
} | null;

export const useDeleteEntityPublic = <S extends Schema.Schema.AnyNoContext>(
type: S,
{ space }: DeleteEntityPublicParams,
Expand All @@ -44,28 +19,7 @@ export const useDeleteEntityPublic = <S extends Schema.Schema.AnyNoContext>(

return async ({ id, walletClient }: { id: string; walletClient: Connect.SmartSessionClient }) => {
try {
const result = await request<EntityToDeleteQueryResult>(
`${Config.getApiOrigin()}/v2/graphql`,
deleteEntityQueryDocument,
{
spaceId: space,
entityId: id,
},
);
if (!result) {
return { success: false, error: 'Entity not found' };
}
const { valuesList, relationsList } = result.entity;
const ops: Op[] = [];
const { ops: unsetEntityValuesOps } = Graph.unsetEntityValues({
id,
properties: valuesList.map(({ propertyId }) => propertyId),
});
ops.push(...unsetEntityValuesOps);
for (const relation of relationsList) {
const { ops: deleteRelationOps } = Graph.deleteRelation({ id: relation.id });
ops.push(...deleteRelationOps);
}
const { ops } = Graph.deleteEntity({ id });

const { cid, txResult } = await publishOps({
ops,
Expand Down
Loading
Loading