diff --git a/.changeset/remove-backlinks-feature.md b/.changeset/remove-backlinks-feature.md
new file mode 100644
index 00000000..a1092b71
--- /dev/null
+++ b/.changeset/remove-backlinks-feature.md
@@ -0,0 +1,7 @@
+---
+"@graphprotocol/hypergraph": patch
+"@graphprotocol/hypergraph-react": patch
+---
+
+Removed the temporary `backlinksTotalCountsTypeId1` option and response field from `Entity.findManyPublic` and the React `useEntities` helpers.
+
diff --git a/apps/events/src/routes/podcasts.lazy.tsx b/apps/events/src/routes/podcasts.lazy.tsx
index 137e1202..8c595a65 100644
--- a/apps/events/src/routes/podcasts.lazy.tsx
+++ b/apps/events/src/routes/podcasts.lazy.tsx
@@ -79,7 +79,6 @@ function RouteComponent() {
episodesTotalCount: true,
},
orderBy: { property: 'dateFounded', direction: 'asc' },
- backlinksTotalCountsTypeId1: '972d201a-d780-4568-9e01-543f67b26bee',
});
console.log({ data, isLoading, isError });
@@ -117,7 +116,7 @@ function RouteComponent() {
{data?.map((podcast) => (
- {podcast.backlinksTotalCountsTypeId1} - {podcast.dateFounded.toISOString()} {podcast.name} - {podcast.id}
+ {podcast.dateFounded.toISOString()} {podcast.name} - {podcast.id}
{podcast.listenOn.map((listenOn) => (
diff --git a/packages/hypergraph-react/src/hooks/use-entities.tsx b/packages/hypergraph-react/src/hooks/use-entities.tsx
index 36679a4b..70c4c28b 100644
--- a/packages/hypergraph-react/src/hooks/use-entities.tsx
+++ b/packages/hypergraph-react/src/hooks/use-entities.tsx
@@ -27,7 +27,6 @@ type UseEntitiesParams<
direction: 'asc' | 'desc';
}
| undefined;
- backlinksTotalCountsTypeId1?: string | undefined;
includeSpaceIds?: IncludeSpaceIds;
logInvalidResults?: boolean;
};
@@ -41,7 +40,7 @@ type UseEntitiesPrivateResult = Omit<
UseEntitiesPublicResult,
'data'
> & {
- data: (Entity.Entity & { backlinksTotalCountsTypeId1?: number })[];
+ data: Entity.Entity[];
deleted: Entity.Entity[];
};
@@ -65,7 +64,6 @@ export function useEntities<
first,
offset,
orderBy,
- backlinksTotalCountsTypeId1,
includeSpaceIds,
logInvalidResults: logInvalidResultsParam,
} = params;
@@ -81,7 +79,6 @@ export function useEntities<
first,
offset,
orderBy,
- backlinksTotalCountsTypeId1,
...(includeSpaceIds !== undefined ? { includeSpaceIds } : {}),
...publicSpaceParams,
logInvalidResults,
@@ -97,7 +94,7 @@ export function useEntities<
return {
...publicResult,
- data: localResult.entities as (Entity.Entity & { backlinksTotalCountsTypeId1?: number })[],
+ data: localResult.entities,
deleted: localResult.deletedEntities,
} as UseEntitiesResult;
}
diff --git a/packages/hypergraph-react/src/internal/use-entities-public.tsx b/packages/hypergraph-react/src/internal/use-entities-public.tsx
index 5f9767dc..f6205c0e 100644
--- a/packages/hypergraph-react/src/internal/use-entities-public.tsx
+++ b/packages/hypergraph-react/src/internal/use-entities-public.tsx
@@ -35,7 +35,6 @@ export const useEntitiesPublic: UseEntitiesPublicFn = (type, params) => {
first = 100,
offset,
orderBy,
- backlinksTotalCountsTypeId1,
includeSpaceIds: includeSpaceIdsParam,
logInvalidResults = true,
} = params ?? {};
@@ -57,7 +56,6 @@ export const useEntitiesPublic: UseEntitiesPublicFn = (type, params) => {
first,
offset,
orderBy,
- backlinksTotalCountsTypeId1,
includeSpaceIds,
],
queryFn: async () => {
@@ -68,7 +66,6 @@ export const useEntitiesPublic: UseEntitiesPublicFn = (type, params) => {
first,
offset,
orderBy,
- backlinksTotalCountsTypeId1,
...(includeSpaceIdsParam !== undefined ? { includeSpaceIds: includeSpaceIdsParam } : {}),
logInvalidResults,
});
diff --git a/packages/hypergraph/src/entity/find-many-public.ts b/packages/hypergraph/src/entity/find-many-public.ts
index 59ed0f0f..d02f1bfd 100644
--- a/packages/hypergraph/src/entity/find-many-public.ts
+++ b/packages/hypergraph/src/entity/find-many-public.ts
@@ -29,7 +29,6 @@ export type FindManyPublicParams<
direction: 'asc' | 'desc';
}
| undefined;
- backlinksTotalCountsTypeId1?: string | undefined;
includeSpaceIds?: IncludeSpaceIds;
logInvalidResults?: boolean | undefined;
};
@@ -56,8 +55,6 @@ const buildEntitiesQuery = (
'$first: Int',
'$filter: EntityFilter!',
'$offset: Int',
- '$backlinksTotalCountsTypeId1: UUID',
- '$backlinksTotalCountsTypeId1Present: Boolean!',
]
.filter(Boolean)
.join(', ');
@@ -75,12 +72,6 @@ const buildEntitiesQuery = (
: spaceSelection.mode === 'many'
? '(filter: { spaceId: { in: $spaceIds } })'
: '';
- const backlinksSpaceFilter =
- spaceSelection.mode === 'single'
- ? 'spaceId: {is: $spaceId}, '
- : spaceSelection.mode === 'many'
- ? 'spaceId: {in: $spaceIds}, '
- : '';
return `
query ${queryName}(${variableDefinitions}) {
@@ -102,9 +93,6 @@ query ${queryName}(${variableDefinitions}) {
time
point
}
- backlinksTotalCountsTypeId1: backlinks(filter: { ${backlinksSpaceFilter}fromEntity: { typeIds: { is: [$backlinksTotalCountsTypeId1] } }}) @include(if: $backlinksTotalCountsTypeId1Present) {
- totalCount
- }
${level1Relations}
}
}`;
@@ -132,9 +120,6 @@ export type EntityQueryResult = {
name: string;
spaceIds: readonly (string | null)[] | null;
valuesList: ValuesList;
- backlinksTotalCountsTypeId1: {
- totalCount: number;
- } | null;
} & {
// For aliased relations_* fields - provides proper typing with totalCount
[K: `relations_${string}`]: RelationsListWithNodes | undefined;
@@ -148,7 +133,6 @@ type ParsedEntity<
IncludeSpaceIds extends boolean | undefined,
> = Entity.WithSpaceIds, IncludeSpaceIds> & {
__schema: S;
- backlinksTotalCountsTypeId1?: number;
};
export type FindManyParseResult = {
@@ -219,7 +203,6 @@ export const parseResult = (`${Graph.TESTNET_API_ORIGIN}/graphql`, queryDocument, queryVariables);
const { data, invalidEntities, invalidRelationEntities } = parseResult(
diff --git a/packages/hypergraph/test/entity/find-many-public.test.ts b/packages/hypergraph/test/entity/find-many-public.test.ts
index f2b26867..1f06011a 100644
--- a/packages/hypergraph/test/entity/find-many-public.test.ts
+++ b/packages/hypergraph/test/entity/find-many-public.test.ts
@@ -57,14 +57,12 @@ describe('findManyPublic parseResult', () => {
name: 'Parent valid',
valuesList: [buildValueEntry(TITLE_PROPERTY_ID, { string: 'Parent valid' })],
spaceIds: [],
- backlinksTotalCountsTypeId1: null,
},
{
id: 'parent-invalid',
name: 'Parent invalid',
valuesList: [],
spaceIds: [],
- backlinksTotalCountsTypeId1: null,
},
],
};
@@ -88,7 +86,6 @@ describe('findManyPublic parseResult', () => {
name: 'Parent with invalid child',
valuesList: [buildValueEntry(TITLE_PROPERTY_ID, { string: 'Parent with invalid child' })],
spaceIds: [],
- backlinksTotalCountsTypeId1: null,
[relationAlias]: {
nodes: [
{
@@ -107,7 +104,6 @@ describe('findManyPublic parseResult', () => {
],
};
- // @ts-expect-error
const result = parseResult(queryData, Parent, relationInfo);
expect(result.data).toHaveLength(1);
@@ -128,7 +124,6 @@ describe('findManyPublic parseResult', () => {
name: 'Parent with spaces',
valuesList: [buildValueEntry(TITLE_PROPERTY_ID, { string: 'Parent with spaces' })],
spaceIds: ['space-1', null, 'space-2'],
- backlinksTotalCountsTypeId1: null,
},
],
};