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
2 changes: 1 addition & 1 deletion apps/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ app.use(express.json({ limit: '2mb' }));
app.use(cors());

app.get('/', (_req, res) => {
res.send('Server is running (v0.0.13)');
res.send('Server is running (v0.0.14)');
});

app.get('/connect/spaces', async (req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/hypergraph-react",
"version": "0.0.13",
"version": "0.0.14",
"description": "React implementation and additional functionality, components, and hooks for the hypergraph SDK framework",
"keywords": ["Web3", "Local-First", "Knowledge Graph", "Graph Protocol", "react"],
"publishConfig": {
Expand Down
10 changes: 7 additions & 3 deletions packages/hypergraph-react/src/hooks/use-spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ export const useSpaces = (params: { mode: 'public' | 'private' }) => {
const publicResult = useQuery({
queryKey: ['hypergraph-spaces', params.mode],
queryFn: async () => {
const result = await request<PublicSpacesQueryResult>(Graph.TESTNET_API_ORIGIN, publicSpacesQueryDocument, {
accountAddress,
});
const result = await request<PublicSpacesQueryResult>(
`${Graph.TESTNET_API_ORIGIN}/graphql`,
publicSpacesQueryDocument,
{
accountAddress,
},
);
return result?.spaces
? result.spaces.map((space) => ({
id: space.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type DeleteEntityResult = {
};

export const generateDeleteOps = async ({ id, space }: { id: string; space: string }) => {
const result = await request<DeleteEntityResult>(Graph.TESTNET_API_ORIGIN, deleteEntityQueryDocument, {
const result = await request<DeleteEntityResult>(`${Graph.TESTNET_API_ORIGIN}/graphql`, deleteEntityQueryDocument, {
entityId: id,
});
if (result.entity === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ export const useDeleteEntityPublic = <S extends Entity.AnyNoContext>(type: S, {

return async ({ id, walletClient }: { id: string; walletClient: Connect.SmartSessionClient }) => {
try {
const result = await request<EntityToDeleteQueryResult>(Graph.TESTNET_API_ORIGIN, deleteEntityQueryDocument, {
spaceId: space,
entityId: id,
});
const result = await request<EntityToDeleteQueryResult>(
`${Graph.TESTNET_API_ORIGIN}/graphql`,
deleteEntityQueryDocument,
{
spaceId: space,
entityId: id,
},
);
if (!result) {
return { success: false, error: 'Entity not found' };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const usePublicSpace = ({ spaceId, enabled }: { spaceId: string; enabled:
const result = useQuery({
queryKey: ['hypergraph-public-space', spaceId],
queryFn: async () => {
const result = await request<SpaceQueryResult>(Graph.TESTNET_API_ORIGIN, spaceQueryDocument, {
const result = await request<SpaceQueryResult>(`${Graph.TESTNET_API_ORIGIN}/graphql`, spaceQueryDocument, {
spaceId,
});
return result?.space?.page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export const useQueryPublic = <S extends Entity.AnyNoContext>(type: S, params?:
queryDocument = entitiesQueryDocumentLevel2;
}

const result = await request<EntityQueryResult>(Graph.TESTNET_API_ORIGIN, queryDocument, {
const result = await request<EntityQueryResult>(`${Graph.TESTNET_API_ORIGIN}/graphql`, queryDocument, {
spaceId: space,
typeIds: mappingEntry?.typeIds || [],
relationTypeIdsLevel1,
Expand Down
12 changes: 8 additions & 4 deletions packages/hypergraph-react/src/prepare-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ export const preparePublish = async <S extends Entity.AnyNoContext>({
entity,
publicSpace,
}: PreparePublishParams<S>) => {
const data = await request<EntityToPublishQueryResult>(Graph.TESTNET_API_ORIGIN, entityToPublishQueryDocument, {
entityId: entity.id,
spaceId: publicSpace,
});
const data = await request<EntityToPublishQueryResult>(
`${Graph.TESTNET_API_ORIGIN}/graphql`,
entityToPublishQueryDocument,
{
entityId: entity.id,
spaceId: publicSpace,
},
);

const mapping = store.getSnapshot().context.mapping;
const typeName = entity.type;
Expand Down
4 changes: 2 additions & 2 deletions packages/hypergraph-react/src/publish-ops.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Op } from '@graphprotocol/grc-20';
import { Ipfs } from '@graphprotocol/grc-20';
import { Graph, Ipfs } from '@graphprotocol/grc-20';
import { Connect } from '@graphprotocol/hypergraph';
import type { Hash } from 'viem';

Expand Down Expand Up @@ -34,7 +34,7 @@ export const publishOps = async ({ name, ops, walletClient, space }: PublishPara
const cid = publishResult.cid;

// This returns the correct contract address and calldata depending on the space id
const result = await fetch(`https://api-testnet.geobrowser.io/space/${space}/edit/calldata`, {
const result = await fetch(`${Graph.TESTNET_API_ORIGIN}/space/${space}/edit/calldata`, {
method: 'POST',
body: JSON.stringify({ cid }),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/hypergraph",
"version": "0.0.13",
"version": "0.0.14",
"description": "SDK for building performant, type-safe, local-first dapps on top of The Graph ecosystem knowledge graphs.",
"publishConfig": {
"access": "public",
Expand Down
Loading