Skip to content

Commit 0f777fa

Browse files
authored
dashless ids (#575)
1 parent 4a5c29d commit 0f777fa

File tree

82 files changed

+878
-793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+878
-793
lines changed

.changeset/dark-radios-own.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@graphprotocol/hypergraph-react": minor
3+
"@graphprotocol/hypergraph": minor
4+
"connect": minor
5+
---
6+
7+
For IDs switch from UUIDs with dashes to UUIDs without dashes e.g. "a126ca53-0c8e-48d5-b888-82c734c38935" to "a126ca530c8e48d5b88882c734c38935"
8+
9+
- For all public API endpoints switch from `/graphql` to `/v2/graphql`
10+
- Expose new Utils: `Utils.GeoIdSchema`, `Utils.normalizeGeoId`, `Utils.isGeoId`, `Utils.parseGeoId`, `Utils.toUuid`
11+

apps/connect/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@base-ui-components/react": "1.0.0-beta.2",
18-
"@graphprotocol/grc-20": "^0.25.2",
18+
"@graphprotocol/grc-20": "^0.27.0",
1919
"@graphprotocol/hypergraph": "workspace:*",
2020
"@graphprotocol/hypergraph-react": "workspace:*",
2121
"@heroicons/react": "^2.2.0",

apps/connect/src/lib/get-app-info-by-ids.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// const apps = {
2-
// '93bb8907-085a-4a0e-83dd-62b0dc98e793': {
2+
// '93bb8907085a4a0e83dd62b0dc98e793': {
33
// name: 'Todos',
44
// },
55
// };

apps/connect/src/routes/authenticate.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import { usePublicSpaces } from '@/hooks/use-public-spaces';
1818
const CHAIN = import.meta.env.VITE_HYPERGRAPH_CHAIN === 'geogenesis' ? Connect.GEOGENESIS : Connect.GEO_TESTNET;
1919
const API_URL =
2020
import.meta.env.VITE_HYPERGRAPH_CHAIN === 'geogenesis'
21-
? `${Graph.MAINNET_API_ORIGIN}/graphql`
22-
: `${Graph.TESTNET_API_ORIGIN}/graphql`;
21+
? `${Graph.MAINNET_API_ORIGIN}/v2/graphql`
22+
: `${Graph.TESTNET_API_ORIGIN}/v2/graphql`;
2323

2424
type AuthenticateSearch = {
2525
data: unknown;

apps/connect/src/routes/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function Authorized() {
3333
isPending: publicSpacesPending,
3434
error: publicSpacesError,
3535
data: publicSpacesData,
36-
} = usePublicSpaces(`${Graph.TESTNET_API_ORIGIN}/graphql`);
36+
} = usePublicSpaces(`${Graph.TESTNET_API_ORIGIN}/v2/graphql`);
3737

3838
return (
3939
<div className="flex grow flex-col items-center justify-center">

apps/events/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"typesync": "hypergraph typesync"
1010
},
1111
"dependencies": {
12-
"@graphprotocol/grc-20": "^0.25.2",
12+
"@graphprotocol/grc-20": "^0.27.0",
1313
"@graphprotocol/hypergraph": "workspace:*",
1414
"@graphprotocol/hypergraph-react": "workspace:*",
1515
"@noble/hashes": "^1.8.0",

apps/events/src/Boot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ declare module '@tanstack/react-router' {
1414

1515
export function Boot() {
1616
return (
17-
<HypergraphAppProvider syncServerUri="http://localhost:3030" appId="93bb8907-085a-4a0e-83dd-62b0dc98e793">
17+
<HypergraphAppProvider syncServerUri="http://localhost:3030" appId="93bb8907085a4a0e83dd62b0dc98e793">
1818
<RouterProvider router={router} />
1919
</HypergraphAppProvider>
2020
);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const CreatePropertiesAndTypesEvent = ({ space }: { space: string }) => {
102102
const newMapping = `Event: {
103103
typeIds: [Id('${eventTypeId}')],
104104
properties: {
105-
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
105+
name: Id('a126ca530c8e48d5b88882c734c38935'),
106106
},
107107
relations: {
108108
sponsors: Id('${sponsorsRelationTypeId}'),
@@ -111,7 +111,7 @@ export const CreatePropertiesAndTypesEvent = ({ space }: { space: string }) => {
111111
Company: {
112112
typeIds: [Id('${companyTypeId}')],
113113
properties: {
114-
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
114+
name: Id('a126ca530c8e48d5b88882c734c38935'),
115115
},
116116
relations: {
117117
jobOffers: Id('${jobOffersRelationTypeId}'),
@@ -120,7 +120,7 @@ Company: {
120120
JobOffer: {
121121
typeIds: [Id('${jobOfferTypeId}')],
122122
properties: {
123-
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
123+
name: Id('a126ca530c8e48d5b88882c734c38935'),
124124
salary: Id('${salaryPropertyId}'),
125125
},
126126
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export const CreatePropertiesAndTypesTodos = ({ space }: { space: string }) => {
122122
const newMapping = `Todo2: {
123123
typeIds: [Id('${todoTypeId}')],
124124
properties: {
125-
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
125+
name: Id('a126ca530c8e48d5b88882c734c38935'),
126126
checked: Id('${checkedPropertyId}'),
127127
due: Id('${duePropertyId}'),
128128
point: Id('${pointPropertyId}'),
@@ -136,7 +136,7 @@ export const CreatePropertiesAndTypesTodos = ({ space }: { space: string }) => {
136136
User: {
137137
typeIds: [Id('${userId}')],
138138
properties: {
139-
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
139+
name: Id('a126ca530c8e48d5b88882c734c38935'),
140140
},
141141
}
142142
`;

apps/events/src/mapping.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,67 @@ import { Id } from '@graphprotocol/hypergraph';
33

44
export const mapping: Mapping.Mapping = {
55
User: {
6-
typeIds: [Id('bffa181e-a333-495b-949c-57f2831d7eca')],
6+
typeIds: [Id('bffa181ea333495b949c57f2831d7eca')],
77
properties: {
8-
name: Id('c9c79675-850a-42c5-bbbd-9e5c55d3f4e7'),
8+
name: Id('c9c79675850a42c5bbbd9e5c55d3f4e7'),
99
},
1010
},
1111
Todo: {
12-
typeIds: [Id('44fe82a9-e4c2-4330-a395-ce85ed78e421')],
12+
typeIds: [Id('44fe82a9e4c24330a395ce85ed78e421')],
1313
properties: {
14-
name: Id('c668aa67-bbca-4b2c-908c-9c5599035eab'),
15-
completed: Id('71e7654f-2623-4794-88fb-841c8f3dd9b4'),
14+
name: Id('c668aa67bbca4b2c908c9c5599035eab'),
15+
completed: Id('71e7654f2623479488fb841c8f3dd9b4'),
1616
},
1717
relations: {
18-
assignees: Id('5b80d3ee-2463-4246-b628-44ba808ab3e1'),
18+
assignees: Id('5b80d3ee24634246b62844ba808ab3e1'),
1919
},
2020
},
2121
Todo2: {
22-
typeIds: [Id('210f4e94-234c-49d7-af0f-f3b74fb07650')],
22+
typeIds: [Id('210f4e94234c49d7af0ff3b74fb07650')],
2323
properties: {
24-
name: Id('e291f4da-632d-4b70-aca8-5c6c01dbf1ca'),
25-
checked: Id('d1cc82ef-8bde-45f4-b31c-56b6d59279ec'),
26-
due: Id('6a28f275-b31c-47bc-83cd-ad416aaa7073'),
27-
amount: Id('0c8219be-e284-4738-bd95-91a1c113c78e'),
28-
point: Id('7f032477-c60e-4c85-a161-019b70db05ca'),
29-
website: Id('75b6a647-5c2b-41e7-92c0-b0a0c9b28b02'),
24+
name: Id('e291f4da632d4b70aca85c6c01dbf1ca'),
25+
checked: Id('d1cc82ef8bde45f4b31c56b6d59279ec'),
26+
due: Id('6a28f275b31c47bc83cdad416aaa7073'),
27+
amount: Id('0c8219bee2844738bd9591a1c113c78e'),
28+
point: Id('7f032477c60e4c85a161019b70db05ca'),
29+
website: Id('75b6a6475c2b41e792c0b0a0c9b28b02'),
3030
},
3131
relations: {
32-
assignees: Id('1115e9f8-db2e-41df-8969-c5d34c367c10'),
32+
assignees: Id('1115e9f8db2e41df8969c5d34c367c10'),
3333
},
3434
},
3535
JobOffer: {
36-
typeIds: [Id('a4c1b288-756e-477b-aab2-007decf01c61')],
36+
typeIds: [Id('a4c1b288756e477baab2007decf01c61')],
3737
properties: {
38-
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
39-
salary: Id('86ff5361-b820-4ba8-b689-b48e815e07d2'),
38+
name: Id('a126ca530c8e48d5b88882c734c38935'),
39+
salary: Id('86ff5361b8204ba8b689b48e815e07d2'),
4040
},
4141
},
4242
Company: {
43-
typeIds: [Id('bcf56f59-c532-47d5-a005-2d802f512c85')],
43+
typeIds: [Id('bcf56f59c53247d5a0052d802f512c85')],
4444
properties: {
45-
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
45+
name: Id('a126ca530c8e48d5b88882c734c38935'),
4646
},
4747
relations: {
48-
jobOffers: Id('54190b30-1c68-499c-9ed8-5c6190810e31'),
48+
jobOffers: Id('54190b301c68499c9ed85c6190810e31'),
4949
},
5050
},
5151
Event: {
52-
typeIds: [Id('239bc639-938e-427c-bebb-d562d82ae272')],
52+
typeIds: [Id('239bc639938e427cbebbd562d82ae272')],
5353
properties: {
54-
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
55-
description: Id('9b1f76ff-9711-404c-861e-59dc3fa7d037'),
54+
name: Id('a126ca530c8e48d5b88882c734c38935'),
55+
description: Id('9b1f76ff9711404c861e59dc3fa7d037'),
5656
},
5757
relations: {
58-
sponsors: Id('926b00ee-68b5-4462-a27f-3806af705118'),
58+
sponsors: Id('926b00ee68b54462a27f3806af705118'),
5959
},
6060
},
6161
Todo3: {
62-
typeIds: [Id('4f7bba76-7855-4d63-b59d-1d9f2be866df')],
62+
typeIds: [Id('4f7bba7678554d63b59d1d9f2be866df')],
6363
properties: {
64-
name: Id('47006386-d351-411c-8287-1dae1c1aa8c1'),
65-
completed: Id('9f9f00eb-4f32-4f71-92ba-b266566d0013'),
66-
description: Id('89cac80a-1dbd-4bca-97b2-45e1556d9122'),
64+
name: Id('47006386d351411c82871dae1c1aa8c1'),
65+
completed: Id('9f9f00eb4f324f7192bab266566d0013'),
66+
description: Id('89cac80a1dbd4bca97b245e1556d9122'),
6767
},
6868
},
6969
};

0 commit comments

Comments
 (0)