Skip to content

Commit ff74686

Browse files
authored
split schema and mapping file (#190)
1 parent 9e2f14a commit ff74686

File tree

8 files changed

+35
-35
lines changed

8 files changed

+35
-35
lines changed

apps/events/src/mapping.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Id } from '@graphprotocol/grc-20';
2+
import type { Mapping } from '@graphprotocol/hypergraph-react';
3+
4+
export const mapping: Mapping = {
5+
NewsStory: {
6+
typeIds: [Id.Id('VKPGYGnFuaoAASiAukCVCX')],
7+
properties: {
8+
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
9+
publishDate: Id.Id('KPNjGaLx5dKofVhT6Dfw22'),
10+
description: Id.Id('LA1DqP5v6QAdsgLPXGF3YA'),
11+
},
12+
},
13+
Todo2: {
14+
typeIds: [Id.Id('4ewpH1mPW9f2tLhaHdKKyn')],
15+
properties: {
16+
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
17+
checked: Id.Id('7zyFtwuuf9evFNZqcLSytU'),
18+
},
19+
relations: {
20+
assignees: Id.Id('GeLe54zpz1MiMWAF8LFCCt'),
21+
},
22+
},
23+
User: {
24+
typeIds: [Id.Id('KYCunro75we8KbjpsDKbm7')],
25+
properties: {
26+
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
27+
},
28+
},
29+
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Playground } from '@/components/playground';
2+
import { mapping } from '@/mapping.js';
23
import { HypergraphSpaceProvider } from '@graphprotocol/hypergraph-react';
34
import { createLazyFileRoute } from '@tanstack/react-router';
4-
import { mapping } from '../schema';
55

66
export const Route = createLazyFileRoute('/playground')({
77
component: RouteComponent,

apps/events/src/routes/space/$spaceId/chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SpaceChat } from '@/components/SpaceChat';
2-
import { mapping } from '@/schema';
2+
import { mapping } from '@/mapping.js';
33
import { store } from '@graphprotocol/hypergraph';
44
import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react';
55
import { createFileRoute } from '@tanstack/react-router';

apps/events/src/routes/space/$spaceId/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TodosReadOnlyFilter } from '@/components/todos-read-only-filter';
55
import { Button } from '@/components/ui/button';
66
import { Users } from '@/components/users';
77
import { availableAccounts } from '@/lib/availableAccounts';
8-
import { mapping } from '@/schema';
8+
import { mapping } from '@/mapping.js';
99
import { store } from '@graphprotocol/hypergraph';
1010
import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react';
1111
import { createFileRoute } from '@tanstack/react-router';

apps/events/src/routes/space/$spaceId/playground.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TodosPublicGeo } from '@/components/todo/todos-public-geo';
2-
import { mapping } from '@/schema';
2+
import { mapping } from '@/mapping.js';
33
import { store } from '@graphprotocol/hypergraph';
44
import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react';
55
import { createFileRoute } from '@tanstack/react-router';

apps/events/src/routes/space/$spaceId/public-integration.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CreatePropertiesAndTypes } from '@/components/create-properties-and-types';
22
import { Todos2 } from '@/components/todos2';
3-
import { mapping } from '@/schema';
3+
import { mapping } from '@/mapping.js';
44
import { store } from '@graphprotocol/hypergraph';
55
import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react';
66
import { createFileRoute } from '@tanstack/react-router';

apps/events/src/routes/space/$spaceId/users.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { UsersMerged } from '@/components/users/users-merged';
22
import { UsersPublicGeo } from '@/components/users/users-public-geo';
3-
import { mapping } from '@/schema';
3+
import { mapping } from '@/mapping.js';
44
import { store } from '@graphprotocol/hypergraph';
55
import { HypergraphSpaceProvider, useHypergraphApp } from '@graphprotocol/hypergraph-react';
66
import { createFileRoute } from '@tanstack/react-router';

apps/events/src/schema.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { Id } from '@graphprotocol/grc-20';
21
import { Entity } from '@graphprotocol/hypergraph';
3-
import type { Mapping } from '@graphprotocol/hypergraph-react';
42

53
export class User extends Entity.Class<User>('User')({
64
name: Entity.Text,
@@ -23,30 +21,3 @@ export class NewsStory extends Entity.Class<NewsStory>('NewsStory')({
2321
description: Entity.Text,
2422
publishDate: Entity.Text,
2523
}) {}
26-
27-
export const mapping: Mapping = {
28-
NewsStory: {
29-
typeIds: [Id.Id('VKPGYGnFuaoAASiAukCVCX')],
30-
properties: {
31-
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
32-
publishDate: Id.Id('KPNjGaLx5dKofVhT6Dfw22'),
33-
description: Id.Id('LA1DqP5v6QAdsgLPXGF3YA'),
34-
},
35-
},
36-
Todo2: {
37-
typeIds: [Id.Id('4ewpH1mPW9f2tLhaHdKKyn')],
38-
properties: {
39-
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
40-
checked: Id.Id('7zyFtwuuf9evFNZqcLSytU'),
41-
},
42-
relations: {
43-
assignees: Id.Id('GeLe54zpz1MiMWAF8LFCCt'),
44-
},
45-
},
46-
User: {
47-
typeIds: [Id.Id('KYCunro75we8KbjpsDKbm7')],
48-
properties: {
49-
name: Id.Id('LuBWqZAu6pz54eiJS5mLv8'),
50-
},
51-
},
52-
};

0 commit comments

Comments
 (0)