Skip to content

Commit 0da3817

Browse files
committed
upgrade grc-20 (most features not working yet) and remove KG endpoint usage
1 parent 0dd7abe commit 0da3817

31 files changed

Lines changed: 202 additions & 462 deletions

apps/connect/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11-
"@graphprotocol/grc-20": "^0.11.5",
1211
"@graphprotocol/hypergraph": "workspace:*",
1312
"@graphprotocol/hypergraph-react": "workspace:*",
1413
"@privy-io/react-auth": "^2.13.0",

apps/events/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11-
"@graphprotocol/grc-20": "^0.11.5",
11+
"@graphprotocol/grc-20": "^0.20.0",
1212
"@graphprotocol/hypergraph": "workspace:*",
1313
"@graphprotocol/hypergraph-react": "workspace:*",
1414
"@noble/hashes": "^1.8.0",

apps/events/src/components/create-properties-and-types.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const createPropertiesAndTypes = async ({
1111
}: { smartAccountWalletClient: GeoSmartAccount; space: string }) => {
1212
const ops: Array<Op> = [];
1313
const { id: checkedPropertyId, ops: createCheckedPropertyOps } = Graph.createProperty({
14-
type: 'CHECKBOX',
14+
dataType: 'CHECKBOX',
1515
name: 'Checked',
1616
});
1717
ops.push(...createCheckedPropertyOps);
@@ -22,32 +22,32 @@ const createPropertiesAndTypes = async ({
2222
ops.push(...createUserOps);
2323

2424
const { id: assigneesRelationTypeId, ops: createAssigneesRelationTypeOps } = Graph.createProperty({
25-
type: 'RELATION',
25+
dataType: 'RELATION',
2626
name: 'Assignees',
2727
relationValueTypes: [userId],
2828
});
2929
ops.push(...createAssigneesRelationTypeOps);
3030

3131
const { id: duePropertyId, ops: createDuePropertyOps } = Graph.createProperty({
32-
type: 'TIME',
32+
dataType: 'TIME',
3333
name: 'Due',
3434
});
3535
ops.push(...createDuePropertyOps);
3636

3737
const { id: pointPropertyId, ops: createPointPropertyOps } = Graph.createProperty({
38-
type: 'POINT',
38+
dataType: 'POINT',
3939
name: 'Point',
4040
});
4141
ops.push(...createPointPropertyOps);
4242

4343
const { id: amountPropertyId, ops: createAmountPropertyOps } = Graph.createProperty({
44-
type: 'NUMBER',
44+
dataType: 'NUMBER',
4545
name: 'Amount',
4646
});
4747
ops.push(...createAmountPropertyOps);
4848

4949
const { id: websitePropertyId, ops: createWebsitePropertyOps } = Graph.createProperty({
50-
type: 'URL',
50+
dataType: 'TEXT',
5151
name: 'Website',
5252
});
5353
ops.push(...createWebsitePropertyOps);

apps/events/src/components/playground.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useQuery } from '@graphprotocol/hypergraph-react';
2-
import { NewsStory } from '../schema';
2+
import { Event } from '../schema';
33

44
export const Playground = () => {
5-
const { data: entityData, isLoading, isError } = useQuery(NewsStory, { mode: 'public' });
5+
const { data: entityData, isLoading, isError } = useQuery(Event, { mode: 'public' });
66

77
console.log({ isLoading, isError, entityData });
88

apps/events/src/components/todo/todos-public-kg.tsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

apps/events/src/components/todo/todos-public-geo.tsx renamed to apps/events/src/components/todo/todos-public.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Todo2 } from '../../schema';
1212
import { Spinner } from '../spinner';
1313
import { Button } from '../ui/button';
1414

15-
export const TodosPublicGeo = () => {
15+
export const TodosPublic = () => {
1616
const space = useHypergraphSpace();
1717
const {
1818
data: dataPublic,

apps/events/src/components/todos2.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import Select from 'react-select';
1616
import { Todo2, User } from '../schema';
1717
import { Spinner } from './spinner';
1818
import { TodosLocal } from './todo/todos-local';
19-
import { TodosPublicGeo } from './todo/todos-public-geo';
20-
import { TodosPublicKg } from './todo/todos-public-kg';
19+
import { TodosPublic } from './todo/todos-public';
2120
import { Button } from './ui/button';
2221
import { Input } from './ui/input';
2322
import { Modal } from './ui/modal';
@@ -262,9 +261,7 @@ export const Todos2 = () => {
262261

263262
<TodosLocal />
264263

265-
<TodosPublicGeo />
266-
267-
<TodosPublicKg />
264+
<TodosPublic />
268265
</>
269266
);
270267
};

apps/events/src/components/users/users-public-geo.tsx renamed to apps/events/src/components/users/users-public.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { User } from '../../schema';
44
import { Spinner } from '../spinner';
55
import { Button } from '../ui/button';
66

7-
export const UsersPublicGeo = () => {
7+
export const UsersPublic = () => {
88
const space = useHypergraphSpace();
99
const { data: dataPublic, isLoading: isLoadingPublic, isError: isErrorPublic } = useQuery(User, { mode: 'public' });
1010

apps/events/src/mapping.ts

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,31 @@ import { Id } from '@graphprotocol/grc-20';
22
import type { Mapping } from '@graphprotocol/hypergraph-react';
33

44
export const mapping: Mapping = {
5-
NewsStory: {
6-
typeIds: [Id.Id('VKPGYGnFuaoAASiAukCVCX')],
5+
Event: {
6+
typeIds: [Id.Id('4d876b81-787e-41fc-ab5d-075d4da66a3f')],
77
properties: {
8-
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
9-
publishDate: Id.Id('KPNjGaLx5dKofVhT6Dfw22'),
10-
description: Id.Id('LA1DqP5v6QAdsgLPXGF3YA'),
11-
},
12-
},
13-
Todo2: {
14-
typeIds: [Id.Id('LJuM8ju67mCv78FhAiK9k9')],
15-
properties: {
16-
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
17-
checked: Id.Id('Ud9kn9gAUsCr1pxvxcgDj8'),
18-
due: Id.Id('CFisPgjjWVdnaMtSWJDBqA'),
19-
point: Id.Id('BkcVo7JZHF5LsWw7XZJwwe'),
20-
website: Id.Id('XZmLQ8XyaUHnNWgSSbzaHU'),
21-
amount: Id.Id('LfzKTfgy5Qg3PxAfKB2BL7'),
22-
},
23-
relations: {
24-
assignees: Id.Id('HCdFcTRyMyZMXScKox738i'),
25-
},
26-
},
27-
User: {
28-
typeIds: [Id.Id('Fk5qzwdpKsD35gm5ts4SZA')],
29-
properties: {
30-
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
8+
name: Id.Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
9+
// description: Id.Id('9b1f76ff-9711-404c-861e-59dc3fa7d037'),
3110
},
3211
},
12+
// Todo2: {
13+
// typeIds: [Id.Id('LJuM8ju67mCv78FhAiK9k9')],
14+
// properties: {
15+
// name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
16+
// checked: Id.Id('Ud9kn9gAUsCr1pxvxcgDj8'),
17+
// due: Id.Id('CFisPgjjWVdnaMtSWJDBqA'),
18+
// point: Id.Id('BkcVo7JZHF5LsWw7XZJwwe'),
19+
// website: Id.Id('XZmLQ8XyaUHnNWgSSbzaHU'),
20+
// amount: Id.Id('LfzKTfgy5Qg3PxAfKB2BL7'),
21+
// },
22+
// relations: {
23+
// assignees: Id.Id('HCdFcTRyMyZMXScKox738i'),
24+
// },
25+
// },
26+
// User: {
27+
// typeIds: [Id.Id('Fk5qzwdpKsD35gm5ts4SZA')],
28+
// properties: {
29+
// name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
30+
// },
31+
// },
3332
};

apps/events/src/routes/playground.lazy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const Route = createLazyFileRoute('/playground')({
99

1010
function RouteComponent() {
1111
return (
12-
<HypergraphSpaceProvider space="BDuZwkjCg3nPWMDshoYtpS" mapping={mapping}>
12+
<HypergraphSpaceProvider space="aa84b08d-779a-495c-93f1-44e667baf6d7" mapping={mapping}>
1313
<div className="flex flex-col gap-4 max-w-(--breakpoint-sm) mx-auto py-8">
1414
<h1 className="text-2xl font-bold">Playground</h1>
1515
<Playground />

0 commit comments

Comments
 (0)