From 1d3b6043774849a3448d05a4044e56f907cf6828 Mon Sep 17 00:00:00 2001 From: Juan Mardikian Date: Thu, 16 Apr 2026 12:37:57 -0400 Subject: [PATCH 1/2] feat: geo explore page --- apps/web/app/api/explore/feed/route.ts | 98 +++ apps/web/app/explore/page.tsx | 45 ++ apps/web/app/home/component.tsx | 2 +- apps/web/core/browse/browse-nav-icon-src.ts | 1 + .../resolve-member-space-from-wallet.ts | 30 + apps/web/core/explore/explore-constants.ts | 22 + .../core/explore/explore-entities-document.ts | 117 +++ .../web/core/explore/explore-relative-time.ts | 38 + apps/web/core/explore/fetch-explore-feed.ts | 440 +++++++++++ .../core/explore/global-scores-document.ts | 17 + apps/web/core/gql/gql.ts | 6 +- apps/web/core/gql/graphql.ts | 743 +++++++++++------- apps/web/core/io/graphql-client.ts | 5 +- apps/web/core/io/query-fragments.tsx | 1 + apps/web/core/utils/utils.ts | 1 + apps/web/core/wallet/privy.tsx | 2 + apps/web/design-system/dropdown.tsx | 39 +- .../browse-sidebar/browse-sidebar.tsx | 4 + .../load-browse-sidebar-data.ts | 20 +- .../partials/comments/comments-section.tsx | 11 +- .../explore/explore-comments-icon.tsx | 23 + .../partials/explore/explore-feed-card.tsx | 104 +++ .../explore/explore-join-space-button.tsx | 46 ++ apps/web/partials/explore/explore-page.tsx | 166 ++++ apps/web/public/browse-nav/explore.svg | 11 + 25 files changed, 1680 insertions(+), 312 deletions(-) create mode 100644 apps/web/app/api/explore/feed/route.ts create mode 100644 apps/web/app/explore/page.tsx create mode 100644 apps/web/core/browse/resolve-member-space-from-wallet.ts create mode 100644 apps/web/core/explore/explore-constants.ts create mode 100644 apps/web/core/explore/explore-entities-document.ts create mode 100644 apps/web/core/explore/explore-relative-time.ts create mode 100644 apps/web/core/explore/fetch-explore-feed.ts create mode 100644 apps/web/core/explore/global-scores-document.ts create mode 100644 apps/web/partials/explore/explore-comments-icon.tsx create mode 100644 apps/web/partials/explore/explore-feed-card.tsx create mode 100644 apps/web/partials/explore/explore-join-space-button.tsx create mode 100644 apps/web/partials/explore/explore-page.tsx create mode 100644 apps/web/public/browse-nav/explore.svg diff --git a/apps/web/app/api/explore/feed/route.ts b/apps/web/app/api/explore/feed/route.ts new file mode 100644 index 0000000000..ba34904f89 --- /dev/null +++ b/apps/web/app/api/explore/feed/route.ts @@ -0,0 +1,98 @@ +import { NextResponse } from 'next/server'; +import { cookies } from 'next/headers'; + +import { getGovernanceHomeSpaceContext } from '~/app/home/governance-home-space-ids'; +import type { BrowseSidebarData } from '~/core/browse/fetch-browse-sidebar-data'; +import { fetchBrowseSidebarData } from '~/core/browse/fetch-browse-sidebar-data'; +import { + resolveMemberSpaceFromWalletSafe, +} from '~/core/browse/resolve-member-space-from-wallet'; +import { WALLET_ADDRESS } from '~/core/cookie'; +import { + type ExploreSort, + type ExploreTime, + fetchExploreFeed, +} from '~/core/explore/fetch-explore-feed'; + +function normId(id: string): string { + return id.replace(/-/g, '').toLowerCase(); +} + +const SORTS: ExploreSort[] = ['new', 'top', 'controversial']; +const TIMES: ExploreTime[] = ['today', 'week', 'month', 'year', 'all']; + +function parseSort(raw: string | null): ExploreSort { + if (raw && (SORTS as string[]).includes(raw)) return raw as ExploreSort; + return 'top'; +} + +function parseTime(raw: string | null): ExploreTime { + if (raw && (TIMES as string[]).includes(raw)) return raw as ExploreTime; + return 'week'; +} + +export async function GET(request: Request) { + const { searchParams } = new URL(request.url); + const sort = parseSort(searchParams.get('sort')); + const time = parseTime(searchParams.get('time')); + const spaceId = searchParams.get('spaceId'); + const cursor = searchParams.get('cursor'); + + const cookieWallet = (await cookies()).get(WALLET_ADDRESS)?.value; + + let personalMemberSpaceId: string | null = null; + let memberOrEditorSpaceIds: string[] = []; + + if (cookieWallet) { + personalMemberSpaceId = await resolveMemberSpaceFromWalletSafe(cookieWallet); + if (personalMemberSpaceId) { + try { + const ctx = await getGovernanceHomeSpaceContext(personalMemberSpaceId); + memberOrEditorSpaceIds = [...new Set([...ctx.editorIds, ...ctx.myProposalSpaceIds, personalMemberSpaceId])]; + } catch { + memberOrEditorSpaceIds = [personalMemberSpaceId]; + } + } + } + + let browse: BrowseSidebarData; + try { + browse = await fetchBrowseSidebarData(personalMemberSpaceId); + } catch { + try { + browse = await fetchBrowseSidebarData(null); + } catch { + browse = { + featured: [], + editorOf: [], + memberOf: [], + documentationImage: null, + personalSpaceId: null, + }; + } + } + + let spaceFilter: string | null = null; + if (spaceId && spaceId !== 'all') { + const want = normId(spaceId); + const match = [...browse.featured, ...browse.editorOf, ...browse.memberOf].find(r => normId(r.id) === want); + if (match) spaceFilter = match.id; + } + + try { + const result = await fetchExploreFeed({ + browse, + sort, + time, + spaceFilterId: spaceFilter, + cursor, + walletAddress: cookieWallet ?? null, + memberOrEditorSpaceIds, + }); + return NextResponse.json(result); + } catch (e) { + console.error('explore feed', e); + /** Degraded response so the Explore UI still mounts when GraphQL is down; client shows empty feed. */ + return NextResponse.json({ items: [], nextCursor: null }); + } +} diff --git a/apps/web/app/explore/page.tsx b/apps/web/app/explore/page.tsx new file mode 100644 index 0000000000..59c761f8a2 --- /dev/null +++ b/apps/web/app/explore/page.tsx @@ -0,0 +1,45 @@ +import { cookies } from 'next/headers'; + +import type { BrowseSidebarData } from '~/core/browse/fetch-browse-sidebar-data'; +import { fetchBrowseSidebarData } from '~/core/browse/fetch-browse-sidebar-data'; +import { resolveMemberSpaceFromWalletSafe } from '~/core/browse/resolve-member-space-from-wallet'; +import { WALLET_ADDRESS } from '~/core/cookie'; + +import { ExplorePage } from '~/partials/explore/explore-page'; + +function normId(id: string): string { + return id.replace(/-/g, '').toLowerCase(); +} + +export default async function ExploreRoutePage() { + const wallet = (await cookies()).get(WALLET_ADDRESS)?.value; + let memberSpaceId: string | null = null; + let browse: BrowseSidebarData; + try { + memberSpaceId = wallet ? await resolveMemberSpaceFromWalletSafe(wallet) : null; + browse = await fetchBrowseSidebarData(memberSpaceId); + } catch { + try { + browse = await fetchBrowseSidebarData(null); + } catch { + browse = { + featured: [], + editorOf: [], + memberOf: [], + documentationImage: null, + personalSpaceId: null, + }; + } + } + + const seen = new Set(); + const initialSpaceOptions: { value: string; label: string }[] = []; + for (const row of [...browse.featured, ...browse.editorOf, ...browse.memberOf]) { + const k = normId(row.id); + if (seen.has(k)) continue; + seen.add(k); + initialSpaceOptions.push({ value: row.id, label: row.name }); + } + + return ; +} diff --git a/apps/web/app/home/component.tsx b/apps/web/app/home/component.tsx index c4b417f228..b3baa8feaa 100644 --- a/apps/web/app/home/component.tsx +++ b/apps/web/app/home/component.tsx @@ -48,7 +48,7 @@ export async function Component({ return ( <> -
+
{header} { + const profile = await Effect.runPromise(fetchProfile(walletAddress)); + if (validateSpaceId(profile.spaceId)) { + return profile.spaceId; + } + const space = await Effect.runPromise(getSpaceByAddress(walletAddress)); + return space && validateSpaceId(space.id) ? space.id : null; +} + +/** + * Same as {@link resolveMemberSpaceFromWallet} but never throws (subgraph / network errors). + * Used when resolving the wallet must not break pages or API routes that can still serve data. + */ +export async function resolveMemberSpaceFromWalletSafe(walletAddress: string): Promise { + try { + return await resolveMemberSpaceFromWallet(walletAddress); + } catch { + return null; + } +} diff --git a/apps/web/core/explore/explore-constants.ts b/apps/web/core/explore/explore-constants.ts new file mode 100644 index 0000000000..d85ab34b74 --- /dev/null +++ b/apps/web/core/explore/explore-constants.ts @@ -0,0 +1,22 @@ +/** Entity types shown on Explore (Geo ontology IDs, hyphenless for GraphQL variables). */ +export const EXPLORE_ENTITY_TYPE_IDS = [ + 'e550fe517e904b2c8fffdf13408f5634', + '972d201ad78045689e01543f67b26bee', + 'f3d4461486b74d2583d89709c9d84f65', + 'd6f0506def324d8e9de4976b986e78ec', + '96f859efa1ca4b229372c86ad58b694b', + '4d876b81787e41fcab5d075d4da66a3f', + '5e24fb52856c4189a9716af4387b1b89', + '7ed45f2bc48b419e8e4664d5ff680b0d', + '484a18c5030a499cb0f2ef588ff16d50', +] as const; + +export const EXPLORE_ENTITY_NAME_PROPERTY_ID = 'a126ca530c8e48d5b88882c734c38935'; +export const EXPLORE_ENTITY_DESCRIPTION_PROPERTY_ID = '9b1f76ff9711404c861e59dc3fa7d037'; +export const EXPLORE_COVER_PROPERTY_ID = '34f535072e6b42c5a84443981a77cfa2'; +export const EXPLORE_AVATAR_PROPERTY_ID = '1155befffad549b7a2e0da4777b8792c'; + +export const EXPLORE_PAGE_SIZE = 22; + +/** Show a "New" badge when the entity was last edited within this window (seconds). */ +export const EXPLORE_NEW_POST_MAX_AGE_SEC = 48 * 3600; diff --git a/apps/web/core/explore/explore-entities-document.ts b/apps/web/core/explore/explore-entities-document.ts new file mode 100644 index 0000000000..5bd969b7c2 --- /dev/null +++ b/apps/web/core/explore/explore-entities-document.ts @@ -0,0 +1,117 @@ +import type { TypedDocumentNode } from '@graphql-typed-document-node/core'; +import { parse } from 'graphql'; + +/** + * Like `allEntitiesConnectionDocument`, but scopes `valuesList` / `relationsList` to any of + * the given spaces so multi-space explore feeds still decode cover/avatar/description. + */ +const EXPLORE_ENTITIES_CONNECTION_SOURCE = /* GraphQL */ ` + fragment ExplorePropertyFragment on PropertyInfo { + id + name + dataTypeId + dataTypeName + renderableTypeId + renderableTypeName + format + isType + } + + query ExploreEntitiesConnection( + $spaceIds: UUIDFilter + $typeIds: UUIDFilter + $limit: Int + $offset: Int + $filter: EntityFilter + $orderBy: [EntitiesOrderBy!] + $spaceIdsForLists: [UUID!]! + ) { + entitiesConnection( + first: $limit + offset: $offset + filter: $filter + orderBy: $orderBy + spaceIds: $spaceIds + typeIds: $typeIds + ) { + nodes { + id + name + description + spaceIds + updatedAt + + types { + id + name + } + + valuesList(filter: { spaceId: { in: $spaceIdsForLists } }) { + spaceId + property { + ...ExplorePropertyFragment + } + text + integer + float + point + boolean + time + language + unit + datetime + date + decimal + bytes + schedule + } + + relationsList(filter: { spaceId: { in: $spaceIdsForLists } }) { + id + spaceId + position + verified + entityId + fromEntity { + id + name + } + toEntity { + id + name + types { + id + name + } + valuesList(filter: { spaceId: { in: $spaceIdsForLists } }) { + spaceId + property { + ...ExplorePropertyFragment + } + text + integer + float + point + boolean + time + datetime + date + decimal + bytes + schedule + } + } + toSpaceId + type { + id + name + } + } + } + } + } +`; + +export const exploreEntitiesConnectionDocument = parse( + EXPLORE_ENTITIES_CONNECTION_SOURCE +) as TypedDocumentNode; diff --git a/apps/web/core/explore/explore-relative-time.ts b/apps/web/core/explore/explore-relative-time.ts new file mode 100644 index 0000000000..6fff76aa9d --- /dev/null +++ b/apps/web/core/explore/explore-relative-time.ts @@ -0,0 +1,38 @@ +import { formatDistanceToNowStrict } from 'date-fns'; + +import { EXPLORE_NEW_POST_MAX_AGE_SEC } from './explore-constants'; + +/** + * GraphQL may return unix seconds as a string, milliseconds, or an ISO datetime string. + */ +export function parseEntityUpdatedAtToUnixSec(raw: string | undefined): number { + if (raw == null || raw === '') return 0; + const s = String(raw).trim(); + const n = Number(s); + if (Number.isFinite(n)) { + if (n > 1e12) return Math.floor(n / 1000); + if (n > 1e9) return Math.floor(n); + } + const ms = Date.parse(s); + if (Number.isFinite(ms)) return Math.floor(ms / 1000); + return 0; +} + +export function isExploreNewPost(updatedAtSec: number, nowSec = Math.floor(Date.now() / 1000)): boolean { + if (updatedAtSec <= 0) return false; + return nowSec - updatedAtSec <= EXPLORE_NEW_POST_MAX_AGE_SEC; +} + +/** + * Compact relative labels for the feed metadata row (e.g. `3m ago`, `2d ago`). + */ +export function formatExploreRelativeTime(updatedAtSec: number): string { + if (updatedAtSec <= 0) return '—'; + const date = new Date(updatedAtSec * 1000); + const diffSec = Math.max(0, (Date.now() - updatedAtSec * 1000) / 1000); + if (diffSec < 45) return 'just now'; + if (diffSec < 3600) return `${Math.floor(diffSec / 60)}m ago`; + if (diffSec < 86400) return `${Math.floor(diffSec / 3600)}h ago`; + if (diffSec < 30 * 86400) return `${Math.floor(diffSec / 86400)}d ago`; + return formatDistanceToNowStrict(date, { addSuffix: true }); +} diff --git a/apps/web/core/explore/fetch-explore-feed.ts b/apps/web/core/explore/fetch-explore-feed.ts new file mode 100644 index 0000000000..104288536a --- /dev/null +++ b/apps/web/core/explore/fetch-explore-feed.ts @@ -0,0 +1,440 @@ +import * as Effect from 'effect/Effect'; + +import { ContentIds, SystemIds } from '@geoprotocol/geo-sdk/lite'; + +import type { BrowseSidebarData } from '~/core/browse/fetch-browse-sidebar-data'; +import { COMMENT_REPLY_TO_ID, COMMENT_TYPE_ID } from '~/core/comment-ids'; +import { + EntitiesOrderBy, + type EntityFilter, + type GlobalScoreFilter, + type UuidFilter, +} from '~/core/gql/graphql'; +import { EntityDecoder } from '~/core/io/decoders/entity'; +import { graphql } from '~/core/io/graphql-client'; +import { getAllEntities, getEntity, getEntityVoteCount } from '~/core/io/queries'; +import { hasActiveMemberProposal } from '~/core/io/subgraph/fetch-proposed-members'; +import { fetchProfile } from '~/core/io/subgraph'; +import type { Entity } from '~/core/types'; + +import { + EXPLORE_AVATAR_PROPERTY_ID, + EXPLORE_COVER_PROPERTY_ID, + EXPLORE_ENTITY_DESCRIPTION_PROPERTY_ID, + EXPLORE_ENTITY_NAME_PROPERTY_ID, + EXPLORE_ENTITY_TYPE_IDS, + EXPLORE_PAGE_SIZE, +} from './explore-constants'; +import { exploreEntitiesConnectionDocument } from './explore-entities-document'; +import { exploreGlobalScoresDocument } from './global-scores-document'; +import { isExploreNewPost, parseEntityUpdatedAtToUnixSec } from './explore-relative-time'; + +export type ExploreSort = 'new' | 'top' | 'controversial'; +export type ExploreTime = 'today' | 'week' | 'month' | 'year' | 'all'; + +export type ExploreFeedItem = { + entityId: string; + spaceId: string; + spaceName: string; + spaceImage: string | null; + types: { id: string; name: string | null }[]; + updatedAtSec: number; + title: string; + description: string | null; + imageUrl: string | null; + upvotes: number; + downvotes: number; + commentCount: number; + isMemberOrEditor: boolean; + hasPendingMembershipRequest: boolean; + /** True when last edit is recent (see EXPLORE_NEW_POST_MAX_AGE_SEC). */ + isNewPost: boolean; +}; + +export type ExploreFeedResult = { + items: ExploreFeedItem[]; + nextCursor: string | null; +}; + +function normId(id: string): string { + return id.replace(/-/g, '').toLowerCase(); +} + +const TYPE_SET = new Set(EXPLORE_ENTITY_TYPE_IDS.map(id => normId(id))); + +function timeThresholdSec(filter: ExploreTime): number | null { + const now = Math.floor(Date.now() / 1000); + switch (filter) { + case 'today': + return now - 86400; + case 'week': + return now - 7 * 86400; + case 'month': + return now - 30 * 86400; + case 'year': + return now - 365 * 86400; + case 'all': + default: + return null; + } +} + +function pickDisplaySpaceId(entity: Entity, allowed: Set): string | null { + for (const sid of entity.spaces) { + if (allowed.has(normId(sid))) return sid; + } + return entity.spaces[0] ?? null; +} + +function textValueForProperty(entity: Entity, propertyId: string, spaceId: string): string | null { + const pid = normId(propertyId); + const sid = normId(spaceId); + const row = entity.values.find(v => normId(v.property.id) === pid && normId(v.spaceId) === sid); + if (!row?.value) return null; + const t = row.value.trim(); + return t.length ? t : null; +} + +function imageFromRelationMedia(relations: Entity['relations'], spaceId: string): string | null { + if (!relations?.length) return null; + const sid = normId(spaceId); + const coverT = normId(SystemIds.COVER_PROPERTY); + const avatarT = normId(ContentIds.AVATAR_PROPERTY); + const pool = relations.filter(r => normId(r.spaceId) === sid); + const scan = pool.length ? pool : relations; + for (const r of scan) { + if (normId(r.type.id) === coverT && r.toEntity.value) { + const v = r.toEntity.value.trim(); + if (v) return v; + } + } + for (const r of scan) { + if (normId(r.type.id) === avatarT && r.toEntity.value) { + const v = r.toEntity.value.trim(); + if (v) return v; + } + } + return null; +} + +function imageFromEntity(entity: Entity, spaceId: string): string | null { + const cover = textValueForProperty(entity, EXPLORE_COVER_PROPERTY_ID, spaceId); + if (cover) return cover; + const av = textValueForProperty(entity, EXPLORE_AVATAR_PROPERTY_ID, spaceId); + if (av) return av; + return imageFromRelationMedia(entity.relations, spaceId); +} + +function entityMatchesExploreTypes(entity: Entity): boolean { + return entity.types.some(t => TYPE_SET.has(normId(t.id))); +} + +async function countCommentsForEntity(entityId: string): Promise { + const list = await Effect.runPromise( + getAllEntities({ + typeIds: { in: [COMMENT_TYPE_ID] }, + filter: { + relations: { + some: { + toEntityId: { is: entityId }, + typeId: { is: COMMENT_REPLY_TO_ID }, + }, + }, + }, + limit: 1000, + }) + ); + return list.length; +} + +function decodeExploreEntities(data: { entitiesConnection?: { nodes?: unknown[] } | null }): Entity[] { + return ( + data.entitiesConnection?.nodes + ?.map((n: unknown) => EntityDecoder.decode(n)) + .filter((e): e is Entity => e !== null) ?? [] + ); +} + +async function fetchExploreEntitiesPage(args: { + spaceIds: string[]; + time: ExploreTime; + limit: number; + offset: number; + orderBy: EntitiesOrderBy[]; +}): Promise { + const t = timeThresholdSec(args.time); + const filter: EntityFilter = { + ...(t != null ? { updatedAt: { greaterThanOrEqualTo: String(t) } } : {}), + }; + + return Effect.runPromise( + graphql({ + query: exploreEntitiesConnectionDocument, + decoder: decodeExploreEntities, + variables: { + spaceIds: { in: args.spaceIds } as UuidFilter, + typeIds: { overlaps: [...EXPLORE_ENTITY_TYPE_IDS] } as UuidFilter, + limit: args.limit, + offset: args.offset, + filter, + orderBy: args.orderBy, + spaceIdsForLists: args.spaceIds, + }, + }) + ); +} + +async function enrichItems( + entities: Entity[], + allowedSpaceIds: Set, + memberOrEditorSpaceIds: Set +): Promise[]> { + const votePairs = await Promise.all( + entities.map(async e => { + try { + const v = await Effect.runPromise(getEntityVoteCount(e.id, 0)); + return { e, v }; + } catch { + return { e, v: null }; + } + }) + ); + + const withVotes = votePairs.filter(({ v }) => v != null && v.upvotes >= 1); + const commentCounts = await Promise.all( + withVotes.map(async ({ e }) => { + try { + const c = await countCommentsForEntity(e.id); + return { e, c }; + } catch { + return { e, c: 0 }; + } + }) + ); + + const items: Omit[] = []; + + for (const { e, v } of withVotes) { + const spaceId = pickDisplaySpaceId(e, allowedSpaceIds); + if (!spaceId || !entityMatchesExploreTypes(e)) continue; + + const cc = commentCounts.find(x => normId(x.e.id) === normId(e.id))?.c ?? 0; + const title = + textValueForProperty(e, EXPLORE_ENTITY_NAME_PROPERTY_ID, spaceId) ?? e.name?.trim() ?? 'Untitled'; + const description = + textValueForProperty(e, EXPLORE_ENTITY_DESCRIPTION_PROPERTY_ID, spaceId) ?? e.description ?? null; + + const updatedAtSec = parseEntityUpdatedAtToUnixSec(e.updatedAt); + items.push({ + entityId: e.id, + spaceId, + types: e.types.filter(t => TYPE_SET.has(normId(t.id))).map(t => ({ id: t.id, name: t.name })), + updatedAtSec, + title, + description, + imageUrl: imageFromEntity(e, spaceId), + upvotes: v!.upvotes, + downvotes: v!.downvotes, + commentCount: cc, + isMemberOrEditor: memberOrEditorSpaceIds.has(normId(spaceId)), + hasPendingMembershipRequest: false, + isNewPost: isExploreNewPost(updatedAtSec), + }); + } + + return items; +} + +function browseSpaceRowsToMap(data: BrowseSidebarData): Map { + const m = new Map(); + const add = (row: { id: string; name: string; image: string | null }) => { + m.set(normId(row.id), { name: row.name, image: row.image }); + }; + for (const row of data.featured) add(row); + for (const row of data.editorOf) add(row); + for (const row of data.memberOf) add(row); + return m; +} + +async function hydrateEntitiesForSpace(entities: Entity[], allowed: Set): Promise { + return Promise.all( + entities.map(async e => { + const sid = pickDisplaySpaceId(e, allowed); + if (!sid) return e; + const full = await Effect.runPromise(getEntity(e.id, sid)); + return full ?? e; + }) + ); +} + +export async function fetchExploreFeed(args: { + browse: BrowseSidebarData; + sort: ExploreSort; + time: ExploreTime; + spaceFilterId: string | null; + cursor: string | null; + walletAddress?: string | null; + memberOrEditorSpaceIds: string[]; +}): Promise { + const spaceMeta = browseSpaceRowsToMap(args.browse); + const baseIds = [...new Set([...spaceMeta.keys()].map(normId))].filter(id => + args.spaceFilterId ? id === normId(args.spaceFilterId) : true + ); + if (baseIds.length === 0) { + return { items: [], nextCursor: null }; + } + + const allowed = new Set(baseIds); + const memberOrEditorSet = new Set(args.memberOrEditorSpaceIds.map(normId)); + + const cursorOffset = args.cursor ? parseInt(args.cursor, 10) : 0; + if (args.cursor != null && Number.isNaN(cursorOffset)) { + return { items: [], nextCursor: null }; + } + + const pageSize = EXPLORE_PAGE_SIZE; + const scanChunk = 55; + + const attachMeta = async ( + rows: Omit[] + ): Promise => { + const out: ExploreFeedItem[] = rows.map(r => ({ + ...r, + spaceName: spaceMeta.get(normId(r.spaceId))?.name ?? r.spaceId.slice(0, 8), + spaceImage: spaceMeta.get(normId(r.spaceId))?.image ?? null, + hasPendingMembershipRequest: false, + })); + + const wallet = args.walletAddress; + if (!wallet) return out; + + const pendingTargets = [...new Set(out.filter(o => !o.isMemberOrEditor).map(o => o.spaceId))]; + if (pendingTargets.length === 0) return out; + + try { + const profile = await Effect.runPromise(fetchProfile(wallet)); + const memberSpaceId = profile?.spaceId; + if (!memberSpaceId) return out; + + const pendingMap = new Map(); + await Promise.all( + pendingTargets.map(async sid => { + try { + const p = await hasActiveMemberProposal(sid, memberSpaceId); + pendingMap.set(normId(sid), p); + } catch { + pendingMap.set(normId(sid), false); + } + }) + ); + + for (const row of out) { + if (!row.isMemberOrEditor) { + row.hasPendingMembershipRequest = pendingMap.get(normId(row.spaceId)) ?? false; + } + } + } catch { + /* Profile / membership checks must not drop the whole feed when subgraph is flaky. */ + } + return out; + }; + + if (args.sort === 'top') { + const filter: GlobalScoreFilter = { + score: { greaterThanOrEqualTo: 1 }, + }; + let scoreRows: { entityId: string; score: string }[] = []; + try { + scoreRows = await Effect.runPromise( + graphql({ + query: exploreGlobalScoresDocument, + decoder: (data: { globalScoresConnection?: { nodes?: { entityId: string; score: string }[] } | null }) => + data.globalScoresConnection?.nodes ?? [], + variables: { first: scanChunk, offset: cursorOffset, filter }, + }) + ); + } catch { + scoreRows = []; + } + + if (scoreRows.length === 0) { + /** Global score index empty or unavailable — fall back to entity scan + sort by votes (same pool as New). */ + const fbEntities = await fetchExploreEntitiesPage({ + spaceIds: baseIds, + time: args.time, + limit: scanChunk, + offset: cursorOffset, + orderBy: [EntitiesOrderBy.UpdatedAtDesc], + }); + const fbHydrated = await hydrateEntitiesForSpace(fbEntities, allowed); + const fbEnriched = await enrichItems(fbHydrated, allowed, memberOrEditorSet); + fbEnriched.sort((a, b) => b.upvotes - a.upvotes || b.updatedAtSec - a.updatedAtSec); + const fbItems = await attachMeta(fbEnriched.slice(0, pageSize)); + const fbNextOffset = cursorOffset + fbEntities.length; + const fbNextCursor = fbEntities.length < scanChunk ? null : String(fbNextOffset); + return { items: fbItems, nextCursor: fbNextCursor }; + } + + const entityIds = scoreRows.map(r => r.entityId); + const entities = await Effect.runPromise( + getAllEntities({ + filter: { id: { in: entityIds } }, + limit: entityIds.length, + }) + ); + const byId = new Map(entities.map(e => [normId(e.id), e])); + + const ordered: Entity[] = []; + for (const row of scoreRows) { + const e = byId.get(normId(row.entityId)); + if (e) ordered.push(e); + } + + const filtered: Entity[] = []; + const t = timeThresholdSec(args.time); + for (const e of ordered) { + if (!entityMatchesExploreTypes(e)) continue; + const sid = pickDisplaySpaceId(e, allowed); + if (!sid) continue; + if (t != null) { + const u = parseEntityUpdatedAtToUnixSec(e.updatedAt); + if (u < t) continue; + } + filtered.push(e); + } + + const hydrated = await hydrateEntitiesForSpace(filtered.slice(0, pageSize * 2), allowed); + const enriched = await enrichItems(hydrated, allowed, memberOrEditorSet); + enriched.sort((a, b) => b.upvotes - a.upvotes || b.updatedAtSec - a.updatedAtSec); + + const items = await attachMeta(enriched.slice(0, pageSize)); + + const nextOffset = cursorOffset + scoreRows.length; + const nextCursor = scoreRows.length < scanChunk ? null : String(nextOffset); + + return { items, nextCursor }; + } + + const entities = await fetchExploreEntitiesPage({ + spaceIds: baseIds, + time: args.time, + limit: scanChunk, + offset: cursorOffset, + orderBy: [EntitiesOrderBy.UpdatedAtDesc], + }); + + let enriched = await enrichItems(entities, allowed, memberOrEditorSet); + + if (args.sort === 'controversial') { + enriched = [...enriched].sort( + (a, b) => b.commentCount - a.commentCount || b.updatedAtSec - a.updatedAtSec + ); + } + + const items = await attachMeta(enriched.slice(0, pageSize)); + + const nextOffset = cursorOffset + entities.length; + const nextCursor = entities.length < scanChunk ? null : String(nextOffset); + + return { items, nextCursor }; +} diff --git a/apps/web/core/explore/global-scores-document.ts b/apps/web/core/explore/global-scores-document.ts new file mode 100644 index 0000000000..c51ba5f7d2 --- /dev/null +++ b/apps/web/core/explore/global-scores-document.ts @@ -0,0 +1,17 @@ +import type { TypedDocumentNode } from '@graphql-typed-document-node/core'; +import { parse } from 'graphql'; + +const GLOBAL_SCORES_EXPLORE_SOURCE = /* GraphQL */ ` + query ExploreGlobalScores($first: Int!, $offset: Int!, $filter: GlobalScoreFilter) { + globalScoresConnection(first: $first, offset: $offset, filter: $filter, orderBy: [SCORE_DESC]) { + nodes { + entityId + score + } + } + } +`; + +export const exploreGlobalScoresDocument = parse( + GLOBAL_SCORES_EXPLORE_SOURCE +) as TypedDocumentNode; diff --git a/apps/web/core/gql/gql.ts b/apps/web/core/gql/gql.ts index 26655b0341..31620501cf 100644 --- a/apps/web/core/gql/gql.ts +++ b/apps/web/core/gql/gql.ts @@ -18,7 +18,7 @@ type Documents = { "\n query AllEntities(\n $spaceId: UUID\n $spaceIds: UUIDFilter\n $typeId: UUID\n $typeIds: UUIDFilter\n $limit: Int\n $offset: Int\n $filter: EntityFilter\n $orderBy: [EntitiesOrderBy!]\n ) {\n entities(\n first: $limit\n offset: $offset\n filter: $filter\n orderBy: $orderBy\n spaceId: $spaceId\n spaceIds: $spaceIds\n typeId: $typeId\n typeIds: $typeIds\n ) {\n id\n name\n description\n spaceIds\n updatedAt\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": typeof types.AllEntitiesDocument, "\n query EntitiesOrderedByProperty(\n $propertyId: UUID\n $sortDirection: SortOrder\n $dataType: String\n $spaceId: UUID\n $limit: Int\n $offset: Int\n $filter: EntityFilter\n ) {\n entitiesOrderedByProperty(\n propertyId: $propertyId\n sortDirection: $sortDirection\n dataType: $dataType\n spaceId: $spaceId\n first: $limit\n offset: $offset\n filter: $filter\n ) {\n id\n name\n description\n spaceIds\n updatedAt\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": typeof types.EntitiesOrderedByPropertyDocument, "\n query EntitiesBatch($filter: EntityFilter, $spaceId: UUID) {\n entities(filter: $filter, spaceId: $spaceId) {\n id\n name\n description\n spaceIds\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": typeof types.EntitiesBatchDocument, - "\n query Entity($id: UUID!, $spaceId: UUID) {\n entity(id: $id) {\n id\n name\n description\n spaceIds\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": typeof types.EntityDocument, + "\n query Entity($id: UUID!, $spaceId: UUID) {\n entity(id: $id) {\n id\n name\n description\n spaceIds\n updatedAt\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": typeof types.EntityDocument, "\n fragment FullRelation on Relation {\n id\n spaceId\n position\n verified\n entityId\n entity {\n id\n name\n }\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n": typeof types.FullRelationFragmentDoc, "\n query RelationEntityRelations($id: UUID!, $spaceId: UUID) {\n relations(filter: { entityId: { is: $id }, spaceId: { is: $spaceId } }) {\n ...FullRelation\n }\n }\n": typeof types.RelationEntityRelationsDocument, "\n query RelationsByToEntityIds($toEntityIds: [UUID!]!, $typeId: UUID, $spaceId: UUID) {\n relations(filter: { toEntityId: { in: $toEntityIds }, typeId: { is: $typeId }, spaceId: { is: $spaceId } }) {\n id\n toEntityId\n spaceId\n fromEntityId\n }\n }\n": typeof types.RelationsByToEntityIdsDocument, @@ -47,7 +47,7 @@ const documents: Documents = { "\n query AllEntities(\n $spaceId: UUID\n $spaceIds: UUIDFilter\n $typeId: UUID\n $typeIds: UUIDFilter\n $limit: Int\n $offset: Int\n $filter: EntityFilter\n $orderBy: [EntitiesOrderBy!]\n ) {\n entities(\n first: $limit\n offset: $offset\n filter: $filter\n orderBy: $orderBy\n spaceId: $spaceId\n spaceIds: $spaceIds\n typeId: $typeId\n typeIds: $typeIds\n ) {\n id\n name\n description\n spaceIds\n updatedAt\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": types.AllEntitiesDocument, "\n query EntitiesOrderedByProperty(\n $propertyId: UUID\n $sortDirection: SortOrder\n $dataType: String\n $spaceId: UUID\n $limit: Int\n $offset: Int\n $filter: EntityFilter\n ) {\n entitiesOrderedByProperty(\n propertyId: $propertyId\n sortDirection: $sortDirection\n dataType: $dataType\n spaceId: $spaceId\n first: $limit\n offset: $offset\n filter: $filter\n ) {\n id\n name\n description\n spaceIds\n updatedAt\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": types.EntitiesOrderedByPropertyDocument, "\n query EntitiesBatch($filter: EntityFilter, $spaceId: UUID) {\n entities(filter: $filter, spaceId: $spaceId) {\n id\n name\n description\n spaceIds\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": types.EntitiesBatchDocument, - "\n query Entity($id: UUID!, $spaceId: UUID) {\n entity(id: $id) {\n id\n name\n description\n spaceIds\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": types.EntityDocument, + "\n query Entity($id: UUID!, $spaceId: UUID) {\n entity(id: $id) {\n id\n name\n description\n spaceIds\n updatedAt\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n": types.EntityDocument, "\n fragment FullRelation on Relation {\n id\n spaceId\n position\n verified\n entityId\n entity {\n id\n name\n }\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n": types.FullRelationFragmentDoc, "\n query RelationEntityRelations($id: UUID!, $spaceId: UUID) {\n relations(filter: { entityId: { is: $id }, spaceId: { is: $spaceId } }) {\n ...FullRelation\n }\n }\n": types.RelationEntityRelationsDocument, "\n query RelationsByToEntityIds($toEntityIds: [UUID!]!, $typeId: UUID, $spaceId: UUID) {\n relations(filter: { toEntityId: { in: $toEntityIds }, typeId: { is: $typeId }, spaceId: { is: $spaceId } }) {\n id\n toEntityId\n spaceId\n fromEntityId\n }\n }\n": types.RelationsByToEntityIdsDocument, @@ -105,7 +105,7 @@ export function graphql(source: "\n query EntitiesBatch($filter: EntityFilter, /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query Entity($id: UUID!, $spaceId: UUID) {\n entity(id: $id) {\n id\n name\n description\n spaceIds\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n"): (typeof documents)["\n query Entity($id: UUID!, $spaceId: UUID) {\n entity(id: $id) {\n id\n name\n description\n spaceIds\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n"]; +export function graphql(source: "\n query Entity($id: UUID!, $spaceId: UUID) {\n entity(id: $id) {\n id\n name\n description\n spaceIds\n updatedAt\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n"): (typeof documents)["\n query Entity($id: UUID!, $spaceId: UUID) {\n entity(id: $id) {\n id\n name\n description\n spaceIds\n updatedAt\n\n types {\n id\n name\n }\n\n valuesList(filter: { spaceId: { is: $spaceId } }) {\n spaceId\n property {\n ...PropertyFragment\n }\n text\n integer\n float\n point\n boolean\n time\n language\n unit\n datetime\n date\n decimal\n bytes\n schedule\n }\n\n relationsList(filter: { spaceId: { is: $spaceId } }) {\n id\n spaceId\n position\n verified\n entityId\n fromEntity {\n id\n name\n }\n toEntity {\n id\n name\n types {\n id\n name\n }\n valuesList {\n spaceId\n propertyId\n text\n integer\n float\n point\n boolean\n time\n datetime\n date\n decimal\n bytes\n schedule\n }\n }\n toSpaceId\n type {\n id\n name\n }\n }\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/apps/web/core/gql/graphql.ts b/apps/web/core/gql/graphql.ts index 53ef94483d..3dcc512cfe 100644 --- a/apps/web/core/gql/graphql.ts +++ b/apps/web/core/gql/graphql.ts @@ -51,6 +51,100 @@ export type Scalars = { UUID: { input: any; output: any; } }; +export type AppWebhook = Node & { + __typename?: 'AppWebhook'; + appName: Scalars['String']['output']; + createdAt: Scalars['Datetime']['output']; + id: Scalars['UUID']['output']; + /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ + nodeId: Scalars['ID']['output']; + secret: Scalars['String']['output']; + updatedAt: Scalars['Datetime']['output']; + url: Scalars['String']['output']; +}; + +/** + * A condition to be used against `AppWebhook` object types. All fields are tested + * for equality and combined with a logical ‘and.’ + */ +export type AppWebhookCondition = { + /** Checks for equality with the object’s `appName` field. */ + appName?: InputMaybe; + /** Checks for equality with the object’s `createdAt` field. */ + createdAt?: InputMaybe; + /** Checks for equality with the object’s `id` field. */ + id?: InputMaybe; + /** Checks for equality with the object’s `secret` field. */ + secret?: InputMaybe; + /** Checks for equality with the object’s `updatedAt` field. */ + updatedAt?: InputMaybe; + /** Checks for equality with the object’s `url` field. */ + url?: InputMaybe; +}; + +/** A filter to be used against `AppWebhook` object types. All fields are combined with a logical ‘and.’ */ +export type AppWebhookFilter = { + /** Checks for all expressions in this list. */ + and?: InputMaybe>; + /** Filter by the object’s `appName` field. */ + appName?: InputMaybe; + /** Filter by the object’s `createdAt` field. */ + createdAt?: InputMaybe; + /** Filter by the object’s `id` field. */ + id?: InputMaybe; + /** Negates the expression. */ + not?: InputMaybe; + /** Checks for any expressions in this list. */ + or?: InputMaybe>; + /** Filter by the object’s `secret` field. */ + secret?: InputMaybe; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: InputMaybe; + /** Filter by the object’s `url` field. */ + url?: InputMaybe; +}; + +/** A connection to a list of `AppWebhook` values. */ +export type AppWebhooksConnection = { + __typename?: 'AppWebhooksConnection'; + /** A list of edges which contains the `AppWebhook` and cursor to aid in pagination. */ + edges: Array; + /** A list of `AppWebhook` objects. */ + nodes: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The count of *all* `AppWebhook` you could get from the connection. */ + totalCount: Scalars['Int']['output']; +}; + +/** A `AppWebhook` edge in the connection. */ +export type AppWebhooksEdge = { + __typename?: 'AppWebhooksEdge'; + /** A cursor for use in pagination. */ + cursor?: Maybe; + /** The `AppWebhook` at the end of the edge. */ + node: AppWebhook; +}; + +/** Methods to use when ordering `AppWebhook`. */ +export enum AppWebhooksOrderBy { + AppNameAsc = 'APP_NAME_ASC', + AppNameDesc = 'APP_NAME_DESC', + CreatedAtAsc = 'CREATED_AT_ASC', + CreatedAtDesc = 'CREATED_AT_DESC', + IdAsc = 'ID_ASC', + IdDesc = 'ID_DESC', + Natural = 'NATURAL', + PrimaryKeyAsc = 'PRIMARY_KEY_ASC', + PrimaryKeyDesc = 'PRIMARY_KEY_DESC', + SecretAsc = 'SECRET_ASC', + SecretDesc = 'SECRET_DESC', + UpdatedAtAsc = 'UPDATED_AT_ASC', + UpdatedAtDesc = 'UPDATED_AT_DESC', + UrlAsc = 'URL_ASC', + UrlDesc = 'URL_DESC' +} + export type AtlasCheckpoint = Node & { __typename?: 'AtlasCheckpoint'; blockNumber: Scalars['BigInt']['output']; @@ -1180,6 +1274,222 @@ export type Node = { nodeId: Scalars['ID']['output']; }; +/** A connection to a list of `NotificationDelivery` values. */ +export type NotificationDeliveriesConnection = { + __typename?: 'NotificationDeliveriesConnection'; + /** A list of edges which contains the `NotificationDelivery` and cursor to aid in pagination. */ + edges: Array; + /** A list of `NotificationDelivery` objects. */ + nodes: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The count of *all* `NotificationDelivery` you could get from the connection. */ + totalCount: Scalars['Int']['output']; +}; + +/** A `NotificationDelivery` edge in the connection. */ +export type NotificationDeliveriesEdge = { + __typename?: 'NotificationDeliveriesEdge'; + /** A cursor for use in pagination. */ + cursor?: Maybe; + /** The `NotificationDelivery` at the end of the edge. */ + node: NotificationDelivery; +}; + +/** Methods to use when ordering `NotificationDelivery`. */ +export enum NotificationDeliveriesOrderBy { + AttemptsAsc = 'ATTEMPTS_ASC', + AttemptsDesc = 'ATTEMPTS_DESC', + CreatedAtAsc = 'CREATED_AT_ASC', + CreatedAtDesc = 'CREATED_AT_DESC', + DeliveredAtAsc = 'DELIVERED_AT_ASC', + DeliveredAtDesc = 'DELIVERED_AT_DESC', + IdAsc = 'ID_ASC', + IdDesc = 'ID_DESC', + LastErrorAsc = 'LAST_ERROR_ASC', + LastErrorDesc = 'LAST_ERROR_DESC', + Natural = 'NATURAL', + NextRetryAtAsc = 'NEXT_RETRY_AT_ASC', + NextRetryAtDesc = 'NEXT_RETRY_AT_DESC', + OutboxIdAsc = 'OUTBOX_ID_ASC', + OutboxIdDesc = 'OUTBOX_ID_DESC', + PrimaryKeyAsc = 'PRIMARY_KEY_ASC', + PrimaryKeyDesc = 'PRIMARY_KEY_DESC', + StatusAsc = 'STATUS_ASC', + StatusDesc = 'STATUS_DESC', + UpdatedAtAsc = 'UPDATED_AT_ASC', + UpdatedAtDesc = 'UPDATED_AT_DESC', + WebhookIdAsc = 'WEBHOOK_ID_ASC', + WebhookIdDesc = 'WEBHOOK_ID_DESC' +} + +export type NotificationDelivery = Node & { + __typename?: 'NotificationDelivery'; + attempts: Scalars['Int']['output']; + createdAt: Scalars['Datetime']['output']; + deliveredAt?: Maybe; + id: Scalars['UUID']['output']; + lastError?: Maybe; + nextRetryAt: Scalars['Datetime']['output']; + /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ + nodeId: Scalars['ID']['output']; + outboxId: Scalars['UUID']['output']; + status: Scalars['String']['output']; + updatedAt: Scalars['Datetime']['output']; + webhookId: Scalars['UUID']['output']; +}; + +/** + * A condition to be used against `NotificationDelivery` object types. All fields + * are tested for equality and combined with a logical ‘and.’ + */ +export type NotificationDeliveryCondition = { + /** Checks for equality with the object’s `attempts` field. */ + attempts?: InputMaybe; + /** Checks for equality with the object’s `createdAt` field. */ + createdAt?: InputMaybe; + /** Checks for equality with the object’s `deliveredAt` field. */ + deliveredAt?: InputMaybe; + /** Checks for equality with the object’s `id` field. */ + id?: InputMaybe; + /** Checks for equality with the object’s `lastError` field. */ + lastError?: InputMaybe; + /** Checks for equality with the object’s `nextRetryAt` field. */ + nextRetryAt?: InputMaybe; + /** Checks for equality with the object’s `outboxId` field. */ + outboxId?: InputMaybe; + /** Checks for equality with the object’s `status` field. */ + status?: InputMaybe; + /** Checks for equality with the object’s `updatedAt` field. */ + updatedAt?: InputMaybe; + /** Checks for equality with the object’s `webhookId` field. */ + webhookId?: InputMaybe; +}; + +/** A filter to be used against `NotificationDelivery` object types. All fields are combined with a logical ‘and.’ */ +export type NotificationDeliveryFilter = { + /** Checks for all expressions in this list. */ + and?: InputMaybe>; + /** Filter by the object’s `attempts` field. */ + attempts?: InputMaybe; + /** Filter by the object’s `createdAt` field. */ + createdAt?: InputMaybe; + /** Filter by the object’s `deliveredAt` field. */ + deliveredAt?: InputMaybe; + /** Filter by the object’s `id` field. */ + id?: InputMaybe; + /** Filter by the object’s `lastError` field. */ + lastError?: InputMaybe; + /** Filter by the object’s `nextRetryAt` field. */ + nextRetryAt?: InputMaybe; + /** Negates the expression. */ + not?: InputMaybe; + /** Checks for any expressions in this list. */ + or?: InputMaybe>; + /** Filter by the object’s `outboxId` field. */ + outboxId?: InputMaybe; + /** Filter by the object’s `status` field. */ + status?: InputMaybe; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: InputMaybe; + /** Filter by the object’s `webhookId` field. */ + webhookId?: InputMaybe; +}; + +export type NotificationOutbox = Node & { + __typename?: 'NotificationOutbox'; + createdAt: Scalars['Datetime']['output']; + eventType: Scalars['String']['output']; + id: Scalars['UUID']['output']; + idempotencyKey: Scalars['String']['output']; + /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ + nodeId: Scalars['ID']['output']; + payload: Scalars['JSON']['output']; + updatedAt: Scalars['Datetime']['output']; +}; + +/** + * A condition to be used against `NotificationOutbox` object types. All fields are + * tested for equality and combined with a logical ‘and.’ + */ +export type NotificationOutboxCondition = { + /** Checks for equality with the object’s `createdAt` field. */ + createdAt?: InputMaybe; + /** Checks for equality with the object’s `eventType` field. */ + eventType?: InputMaybe; + /** Checks for equality with the object’s `id` field. */ + id?: InputMaybe; + /** Checks for equality with the object’s `idempotencyKey` field. */ + idempotencyKey?: InputMaybe; + /** Checks for equality with the object’s `payload` field. */ + payload?: InputMaybe; + /** Checks for equality with the object’s `updatedAt` field. */ + updatedAt?: InputMaybe; +}; + +/** A filter to be used against `NotificationOutbox` object types. All fields are combined with a logical ‘and.’ */ +export type NotificationOutboxFilter = { + /** Checks for all expressions in this list. */ + and?: InputMaybe>; + /** Filter by the object’s `createdAt` field. */ + createdAt?: InputMaybe; + /** Filter by the object’s `eventType` field. */ + eventType?: InputMaybe; + /** Filter by the object’s `id` field. */ + id?: InputMaybe; + /** Filter by the object’s `idempotencyKey` field. */ + idempotencyKey?: InputMaybe; + /** Negates the expression. */ + not?: InputMaybe; + /** Checks for any expressions in this list. */ + or?: InputMaybe>; + /** Filter by the object’s `payload` field. */ + payload?: InputMaybe; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: InputMaybe; +}; + +/** A connection to a list of `NotificationOutbox` values. */ +export type NotificationOutboxesConnection = { + __typename?: 'NotificationOutboxesConnection'; + /** A list of edges which contains the `NotificationOutbox` and cursor to aid in pagination. */ + edges: Array; + /** A list of `NotificationOutbox` objects. */ + nodes: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The count of *all* `NotificationOutbox` you could get from the connection. */ + totalCount: Scalars['Int']['output']; +}; + +/** A `NotificationOutbox` edge in the connection. */ +export type NotificationOutboxesEdge = { + __typename?: 'NotificationOutboxesEdge'; + /** A cursor for use in pagination. */ + cursor?: Maybe; + /** The `NotificationOutbox` at the end of the edge. */ + node: NotificationOutbox; +}; + +/** Methods to use when ordering `NotificationOutbox`. */ +export enum NotificationOutboxesOrderBy { + CreatedAtAsc = 'CREATED_AT_ASC', + CreatedAtDesc = 'CREATED_AT_DESC', + EventTypeAsc = 'EVENT_TYPE_ASC', + EventTypeDesc = 'EVENT_TYPE_DESC', + IdempotencyKeyAsc = 'IDEMPOTENCY_KEY_ASC', + IdempotencyKeyDesc = 'IDEMPOTENCY_KEY_DESC', + IdAsc = 'ID_ASC', + IdDesc = 'ID_DESC', + Natural = 'NATURAL', + PayloadAsc = 'PAYLOAD_ASC', + PayloadDesc = 'PAYLOAD_DESC', + PrimaryKeyAsc = 'PRIMARY_KEY_ASC', + PrimaryKeyDesc = 'PRIMARY_KEY_DESC', + UpdatedAtAsc = 'UPDATED_AT_ASC', + UpdatedAtDesc = 'UPDATED_AT_DESC' +} + /** Information about pagination in a connection. */ export type PageInfo = { __typename?: 'PageInfo'; @@ -1268,25 +1578,8 @@ export type Proposal = Node & { noCount: Scalars['BigInt']['output']; /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ nodeId: Scalars['ID']['output']; - /** Reads and enables pagination through a set of `ProposalAction`. */ - proposalActions: Array; - /** Reads and enables pagination through a set of `ProposalAction`. */ - proposalActionsConnection: ProposalActionsConnection; - /** Reads a single `ProposalTallyQueue` that is related to this `Proposal`. */ - proposalTallyQueue?: Maybe; - /** - * Reads and enables pagination through a set of `ProposalTallyQueue`. - * @deprecated Please use proposalTallyQueue instead - */ - proposalTallyQueuesConnection: ProposalTallyQueuesConnection; - /** Reads and enables pagination through a set of `ProposalVote`. */ - proposalVotes: Array; - /** Reads and enables pagination through a set of `ProposalVote`. */ - proposalVotesConnection: ProposalVotesConnection; proposedBy: Scalars['UUID']['output']; quorum: Scalars['BigInt']['output']; - /** Reads a single `Space` that is related to this `Proposal`. */ - space?: Maybe; spaceId: Scalars['UUID']['output']; startTime: Scalars['BigInt']['output']; threshold: Scalars['BigInt']['output']; @@ -1294,60 +1587,6 @@ export type Proposal = Node & { yesCount: Scalars['BigInt']['output']; }; - -export type ProposalProposalActionsArgs = { - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type ProposalProposalActionsConnectionArgs = { - after?: InputMaybe; - before?: InputMaybe; - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type ProposalProposalTallyQueuesConnectionArgs = { - after?: InputMaybe; - before?: InputMaybe; - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type ProposalProposalVotesArgs = { - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type ProposalProposalVotesConnectionArgs = { - after?: InputMaybe; - before?: InputMaybe; - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - export type ProposalAction = Node & { __typename?: 'ProposalAction'; actionType: ProposalActionType; @@ -1359,8 +1598,6 @@ export type ProposalAction = Node & { metadata?: Maybe; /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ nodeId: Scalars['ID']['output']; - /** Reads a single `Proposal` that is related to this `ProposalAction`. */ - proposal?: Maybe; proposalId: Scalars['UUID']['output']; quorum?: Maybe; slowThreshold?: Maybe; @@ -1414,8 +1651,6 @@ export type ProposalActionFilter = { not?: InputMaybe; /** Checks for any expressions in this list. */ or?: InputMaybe>; - /** Filter by the object’s `proposal` relation. */ - proposal?: InputMaybe; /** Filter by the object’s `proposalId` field. */ proposalId?: InputMaybe; /** Filter by the object’s `quorum` field. */ @@ -1585,24 +1820,10 @@ export type ProposalFilter = { not?: InputMaybe; /** Checks for any expressions in this list. */ or?: InputMaybe>; - /** Filter by the object’s `proposalActionsConnection` relation. */ - proposalActionsConnection?: InputMaybe; - /** Some related `proposalActionsConnection` exist. */ - proposalActionsConnectionExist?: InputMaybe; - /** Filter by the object’s `proposalTallyQueue` relation. */ - proposalTallyQueue?: InputMaybe; - /** A related `proposalTallyQueue` exists. */ - proposalTallyQueueExists?: InputMaybe; - /** Filter by the object’s `proposalVotesConnection` relation. */ - proposalVotesConnection?: InputMaybe; - /** Some related `proposalVotesConnection` exist. */ - proposalVotesConnectionExist?: InputMaybe; /** Filter by the object’s `proposedBy` field. */ proposedBy?: InputMaybe; /** Filter by the object’s `quorum` field. */ quorum?: InputMaybe; - /** Filter by the object’s `space` relation. */ - space?: InputMaybe; /** Filter by the object’s `spaceId` field. */ spaceId?: InputMaybe; /** Filter by the object’s `startTime` field. */ @@ -1619,8 +1840,6 @@ export type ProposalTallyQueue = Node & { __typename?: 'ProposalTallyQueue'; /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ nodeId: Scalars['ID']['output']; - /** Reads a single `Proposal` that is related to this `ProposalTallyQueue`. */ - proposal?: Maybe; proposalId: Scalars['UUID']['output']; queuedAt: Scalars['Datetime']['output']; }; @@ -1644,8 +1863,6 @@ export type ProposalTallyQueueFilter = { not?: InputMaybe; /** Checks for any expressions in this list. */ or?: InputMaybe>; - /** Filter by the object’s `proposal` relation. */ - proposal?: InputMaybe; /** Filter by the object’s `proposalId` field. */ proposalId?: InputMaybe; /** Filter by the object’s `queuedAt` field. */ @@ -1685,37 +1902,13 @@ export enum ProposalTallyQueuesOrderBy { QueuedAtDesc = 'QUEUED_AT_DESC' } -/** A filter to be used against many `ProposalAction` object types. All fields are combined with a logical ‘and.’ */ -export type ProposalToManyProposalActionFilter = { - /** Every related `ProposalAction` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - every?: InputMaybe; - /** No related `ProposalAction` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - none?: InputMaybe; - /** Some related `ProposalAction` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - some?: InputMaybe; -}; - -/** A filter to be used against many `ProposalVote` object types. All fields are combined with a logical ‘and.’ */ -export type ProposalToManyProposalVoteFilter = { - /** Every related `ProposalVote` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - every?: InputMaybe; - /** No related `ProposalVote` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - none?: InputMaybe; - /** Some related `ProposalVote` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - some?: InputMaybe; -}; - export type ProposalVote = Node & { __typename?: 'ProposalVote'; createdAt: Scalars['String']['output']; createdAtBlock: Scalars['String']['output']; /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ nodeId: Scalars['ID']['output']; - /** Reads a single `Proposal` that is related to this `ProposalVote`. */ - proposal?: Maybe; proposalId: Scalars['UUID']['output']; - /** Reads a single `Space` that is related to this `ProposalVote`. */ - space?: Maybe; spaceId: Scalars['UUID']['output']; vote: VoteOption; voterId: Scalars['UUID']['output']; @@ -1752,12 +1945,8 @@ export type ProposalVoteFilter = { not?: InputMaybe; /** Checks for any expressions in this list. */ or?: InputMaybe>; - /** Filter by the object’s `proposal` relation. */ - proposal?: InputMaybe; /** Filter by the object’s `proposalId` field. */ proposalId?: InputMaybe; - /** Filter by the object’s `space` relation. */ - space?: InputMaybe; /** Filter by the object’s `spaceId` field. */ spaceId?: InputMaybe; /** Filter by the object’s `vote` field. */ @@ -1869,6 +2058,14 @@ export enum ProposalsOrderBy { /** The root query type which gives access points into the data universe. */ export type Query = Node & { __typename?: 'Query'; + appWebhook?: Maybe; + appWebhookByAppName?: Maybe; + /** Reads a single `AppWebhook` using its globally unique `ID`. */ + appWebhookByNodeId?: Maybe; + /** Reads a set of `AppWebhook`. */ + appWebhooks?: Maybe>; + /** Reads and enables pagination through a set of `AppWebhook`. */ + appWebhooksConnection?: Maybe; atlasCheckpoint?: Maybe; /** Reads a single `AtlasCheckpoint` using its globally unique `ID`. */ atlasCheckpointByNodeId?: Maybe; @@ -1935,6 +2132,22 @@ export type Query = Node & { node?: Maybe; /** The root query type must be a `Node` to work well with Relay 1 mutations. This just resolves to `query`. */ nodeId: Scalars['ID']['output']; + /** Reads a set of `NotificationDelivery`. */ + notificationDeliveries?: Maybe>; + /** Reads and enables pagination through a set of `NotificationDelivery`. */ + notificationDeliveriesConnection?: Maybe; + notificationDelivery?: Maybe; + /** Reads a single `NotificationDelivery` using its globally unique `ID`. */ + notificationDeliveryByNodeId?: Maybe; + notificationDeliveryByOutboxIdAndWebhookId?: Maybe; + notificationOutbox?: Maybe; + notificationOutboxByIdempotencyKey?: Maybe; + /** Reads a single `NotificationOutbox` using its globally unique `ID`. */ + notificationOutboxByNodeId?: Maybe; + /** Reads a set of `NotificationOutbox`. */ + notificationOutboxes?: Maybe>; + /** Reads and enables pagination through a set of `NotificationOutbox`. */ + notificationOutboxesConnection?: Maybe; /** Reads and enables pagination through a set of `PropertyInfo`. */ properties?: Maybe>; /** Reads and enables pagination through a set of `PropertyInfo`. */ @@ -2068,6 +2281,47 @@ export type Query = Node & { }; +/** The root query type which gives access points into the data universe. */ +export type QueryAppWebhookArgs = { + id: Scalars['UUID']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryAppWebhookByAppNameArgs = { + appName: Scalars['String']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryAppWebhookByNodeIdArgs = { + nodeId: Scalars['ID']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryAppWebhooksArgs = { + condition?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryAppWebhooksConnectionArgs = { + after?: InputMaybe; + before?: InputMaybe; + condition?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; +}; + + /** The root query type which gives access points into the data universe. */ export type QueryAtlasCheckpointArgs = { indexerId: Scalars['String']['input']; @@ -2405,6 +2659,89 @@ export type QueryNodeArgs = { }; +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationDeliveriesArgs = { + condition?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationDeliveriesConnectionArgs = { + after?: InputMaybe; + before?: InputMaybe; + condition?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationDeliveryArgs = { + id: Scalars['UUID']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationDeliveryByNodeIdArgs = { + nodeId: Scalars['ID']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationDeliveryByOutboxIdAndWebhookIdArgs = { + outboxId: Scalars['UUID']['input']; + webhookId: Scalars['UUID']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationOutboxArgs = { + id: Scalars['UUID']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationOutboxByIdempotencyKeyArgs = { + idempotencyKey: Scalars['String']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationOutboxByNodeIdArgs = { + nodeId: Scalars['ID']['input']; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationOutboxesArgs = { + condition?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** The root query type which gives access points into the data universe. */ +export type QueryNotificationOutboxesConnectionArgs = { + after?: InputMaybe; + before?: InputMaybe; + condition?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; +}; + + /** The root query type which gives access points into the data universe. */ export type QueryPropertiesArgs = { filter?: InputMaybe; @@ -3478,14 +3815,6 @@ export type Space = Node & { /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ nodeId: Scalars['ID']['output']; page?: Maybe; - /** Reads and enables pagination through a set of `ProposalVote`. */ - proposalVotes: Array; - /** Reads and enables pagination through a set of `ProposalVote`. */ - proposalVotesConnection: ProposalVotesConnection; - /** Reads and enables pagination through a set of `Proposal`. */ - proposals: Array; - /** Reads and enables pagination through a set of `Proposal`. */ - proposalsConnection: ProposalsConnection; /** Reads and enables pagination through a set of `Relation`. */ relations: Array; /** Reads and enables pagination through a set of `Relation`. */ @@ -3502,14 +3831,6 @@ export type Space = Node & { subspaceTopics: Array; /** Reads and enables pagination through a set of `SubspaceTopic`. */ subspaceTopicsConnection: SubspaceTopicsConnection; - /** Reads and enables pagination through a set of `Subspace`. */ - subspacesByChildSpaceId: Array; - /** Reads and enables pagination through a set of `Subspace`. */ - subspacesByChildSpaceIdConnection: SubspacesConnection; - /** Reads and enables pagination through a set of `Subspace`. */ - subspacesByParentSpaceId: Array; - /** Reads and enables pagination through a set of `Subspace`. */ - subspacesByParentSpaceIdConnection: SubspacesConnection; /** Reads a single `Entity` that is related to this `Space`. */ topic?: Maybe; topicId?: Maybe; @@ -3563,48 +3884,6 @@ export type SpaceMembersListArgs = { }; -export type SpaceProposalVotesArgs = { - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type SpaceProposalVotesConnectionArgs = { - after?: InputMaybe; - before?: InputMaybe; - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type SpaceProposalsArgs = { - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type SpaceProposalsConnectionArgs = { - after?: InputMaybe; - before?: InputMaybe; - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - export type SpaceRelationsArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -3689,48 +3968,6 @@ export type SpaceSubspaceTopicsConnectionArgs = { }; -export type SpaceSubspacesByChildSpaceIdArgs = { - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type SpaceSubspacesByChildSpaceIdConnectionArgs = { - after?: InputMaybe; - before?: InputMaybe; - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type SpaceSubspacesByParentSpaceIdArgs = { - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - -export type SpaceSubspacesByParentSpaceIdConnectionArgs = { - after?: InputMaybe; - before?: InputMaybe; - condition?: InputMaybe; - filter?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe>; -}; - - export type SpaceValuesArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -3783,14 +4020,6 @@ export type SpaceFilter = { not?: InputMaybe; /** Checks for any expressions in this list. */ or?: InputMaybe>; - /** Filter by the object’s `proposalVotesConnection` relation. */ - proposalVotesConnection?: InputMaybe; - /** Some related `proposalVotesConnection` exist. */ - proposalVotesConnectionExist?: InputMaybe; - /** Filter by the object’s `proposalsConnection` relation. */ - proposalsConnection?: InputMaybe; - /** Some related `proposalsConnection` exist. */ - proposalsConnectionExist?: InputMaybe; /** Filter by the object’s `relationsByFromSpaceIdConnection` relation. */ relationsByFromSpaceIdConnection?: InputMaybe; /** Some related `relationsByFromSpaceIdConnection` exist. */ @@ -3807,14 +4036,6 @@ export type SpaceFilter = { subspaceTopicsConnection?: InputMaybe; /** Some related `subspaceTopicsConnection` exist. */ subspaceTopicsConnectionExist?: InputMaybe; - /** Filter by the object’s `subspacesByChildSpaceIdConnection` relation. */ - subspacesByChildSpaceIdConnection?: InputMaybe; - /** Some related `subspacesByChildSpaceIdConnection` exist. */ - subspacesByChildSpaceIdConnectionExist?: InputMaybe; - /** Filter by the object’s `subspacesByParentSpaceIdConnection` relation. */ - subspacesByParentSpaceIdConnection?: InputMaybe; - /** Some related `subspacesByParentSpaceIdConnection` exist. */ - subspacesByParentSpaceIdConnectionExist?: InputMaybe; /** Filter by the object’s `topic` relation. */ topic?: InputMaybe; /** A related `topic` exists. */ @@ -3922,26 +4143,6 @@ export type SpaceToManyMemberFilter = { some?: InputMaybe; }; -/** A filter to be used against many `Proposal` object types. All fields are combined with a logical ‘and.’ */ -export type SpaceToManyProposalFilter = { - /** Every related `Proposal` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - every?: InputMaybe; - /** No related `Proposal` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - none?: InputMaybe; - /** Some related `Proposal` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - some?: InputMaybe; -}; - -/** A filter to be used against many `ProposalVote` object types. All fields are combined with a logical ‘and.’ */ -export type SpaceToManyProposalVoteFilter = { - /** Every related `ProposalVote` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - every?: InputMaybe; - /** No related `ProposalVote` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - none?: InputMaybe; - /** Some related `ProposalVote` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - some?: InputMaybe; -}; - /** A filter to be used against many `Relation` object types. All fields are combined with a logical ‘and.’ */ export type SpaceToManyRelationFilter = { /** Every related `Relation` matches the filter criteria. All fields are combined with a logical ‘and.’ */ @@ -3952,16 +4153,6 @@ export type SpaceToManyRelationFilter = { some?: InputMaybe; }; -/** A filter to be used against many `Subspace` object types. All fields are combined with a logical ‘and.’ */ -export type SpaceToManySubspaceFilter = { - /** Every related `Subspace` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - every?: InputMaybe; - /** No related `Subspace` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - none?: InputMaybe; - /** Some related `Subspace` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - some?: InputMaybe; -}; - /** A filter to be used against many `SubspaceTopic` object types. All fields are combined with a logical ‘and.’ */ export type SpaceToManySubspaceTopicFilter = { /** Every related `SubspaceTopic` matches the filter criteria. All fields are combined with a logical ‘and.’ */ @@ -4130,13 +4321,9 @@ export type StringFilter = { export type Subspace = Node & { __typename?: 'Subspace'; - /** Reads a single `Space` that is related to this `Subspace`. */ - childSpace?: Maybe; childSpaceId: Scalars['UUID']['output']; /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ nodeId: Scalars['ID']['output']; - /** Reads a single `Space` that is related to this `Subspace`. */ - parentSpace?: Maybe; parentSpaceId: Scalars['UUID']['output']; type: SubspaceType; }; @@ -4158,16 +4345,12 @@ export type SubspaceCondition = { export type SubspaceFilter = { /** Checks for all expressions in this list. */ and?: InputMaybe>; - /** Filter by the object’s `childSpace` relation. */ - childSpace?: InputMaybe; /** Filter by the object’s `childSpaceId` field. */ childSpaceId?: InputMaybe; /** Negates the expression. */ not?: InputMaybe; /** Checks for any expressions in this list. */ or?: InputMaybe>; - /** Filter by the object’s `parentSpace` relation. */ - parentSpace?: InputMaybe; /** Filter by the object’s `parentSpaceId` field. */ parentSpaceId?: InputMaybe; /** Filter by the object’s `type` field. */ @@ -4899,12 +5082,16 @@ export enum ValuesOrderBy { EntityIdDesc = 'ENTITY_ID_DESC', FloatAsc = 'FLOAT_ASC', FloatDesc = 'FLOAT_DESC', + GlobalScoreAsc = 'GLOBAL_SCORE_ASC', + GlobalScoreDesc = 'GLOBAL_SCORE_DESC', IdAsc = 'ID_ASC', IdDesc = 'ID_DESC', IntegerAsc = 'INTEGER_ASC', IntegerDesc = 'INTEGER_DESC', LanguageAsc = 'LANGUAGE_ASC', LanguageDesc = 'LANGUAGE_DESC', + LocalScoreAsc = 'LOCAL_SCORE_ASC', + LocalScoreDesc = 'LOCAL_SCORE_DESC', Natural = 'NATURAL', PointAsc = 'POINT_ASC', PointDesc = 'POINT_DESC', @@ -4912,6 +5099,8 @@ export enum ValuesOrderBy { PrimaryKeyDesc = 'PRIMARY_KEY_DESC', PropertyIdAsc = 'PROPERTY_ID_ASC', PropertyIdDesc = 'PROPERTY_ID_DESC', + RawScoreAsc = 'RAW_SCORE_ASC', + RawScoreDesc = 'RAW_SCORE_DESC', RectAsc = 'RECT_ASC', RectDesc = 'RECT_DESC', ScheduleAsc = 'SCHEDULE_ASC', @@ -5252,7 +5441,7 @@ export type EntityQueryVariables = Exact<{ }>; -export type EntityQuery = { __typename?: 'Query', entity?: { __typename?: 'Entity', id: any, name?: string | null, description?: string | null, spaceIds?: Array | null, types?: Array<{ __typename?: 'Entity', id: any, name?: string | null }> | null, valuesList: Array<{ __typename?: 'Value', spaceId: any, text?: string | null, integer?: any | null, float?: number | null, point?: any | null, boolean?: boolean | null, time?: any | null, language?: any | null, unit?: string | null, datetime?: any | null, date?: any | null, decimal?: any | null, bytes?: any | null, schedule?: any | null, property?: ( +export type EntityQuery = { __typename?: 'Query', entity?: { __typename?: 'Entity', id: any, name?: string | null, description?: string | null, spaceIds?: Array | null, updatedAt: string, types?: Array<{ __typename?: 'Entity', id: any, name?: string | null }> | null, valuesList: Array<{ __typename?: 'Value', spaceId: any, text?: string | null, integer?: any | null, float?: number | null, point?: any | null, boolean?: boolean | null, time?: any | null, language?: any | null, unit?: string | null, datetime?: any | null, date?: any | null, decimal?: any | null, bytes?: any | null, schedule?: any | null, property?: ( { __typename?: 'PropertyInfo' } & { ' $fragmentRefs'?: { 'PropertyFragmentFragment': PropertyFragmentFragment } } ) | null }>, relationsList: Array<{ __typename?: 'Relation', id: any, spaceId: any, position?: string | null, verified?: boolean | null, entityId: any, toSpaceId?: any | null, fromEntity?: { __typename?: 'Entity', id: any, name?: string | null } | null, toEntity?: { __typename?: 'Entity', id: any, name?: string | null, types?: Array<{ __typename?: 'Entity', id: any, name?: string | null }> | null, valuesList: Array<{ __typename?: 'Value', spaceId: any, propertyId: any, text?: string | null, integer?: any | null, float?: number | null, point?: any | null, boolean?: boolean | null, time?: any | null, datetime?: any | null, date?: any | null, decimal?: any | null, bytes?: any | null, schedule?: any | null }> } | null, type?: { __typename?: 'PropertyInfo', id?: any | null, name?: string | null } | null }> } | null }; @@ -5455,7 +5644,7 @@ export const FullSpaceFragmentDoc = {"kind":"Document","definitions":[{"kind":"F export const AllEntitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AllEntities"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceIds"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUIDFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"typeId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"typeIds"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUIDFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"EntityFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"EntitiesOrderBy"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"spaceIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"typeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"typeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"typeIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"typeIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"spaceIds"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"property"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"language"}},{"kind":"Field","name":{"kind":"Name","value":"unit"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relationsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"fromEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"toSpaceId"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"format"}},{"kind":"Field","name":{"kind":"Name","value":"isType"}}]}}]} as unknown as DocumentNode; export const EntitiesOrderedByPropertyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"EntitiesOrderedByProperty"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"propertyId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sortDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SortOrder"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dataType"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"EntityFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entitiesOrderedByProperty"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"propertyId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"propertyId"}}},{"kind":"Argument","name":{"kind":"Name","value":"sortDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sortDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"dataType"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dataType"}}},{"kind":"Argument","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"spaceIds"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"property"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"language"}},{"kind":"Field","name":{"kind":"Name","value":"unit"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relationsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"fromEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"toSpaceId"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"format"}},{"kind":"Field","name":{"kind":"Name","value":"isType"}}]}}]} as unknown as DocumentNode; export const EntitiesBatchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"EntitiesBatch"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"EntityFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}},{"kind":"Argument","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"spaceIds"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"property"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"language"}},{"kind":"Field","name":{"kind":"Name","value":"unit"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relationsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"fromEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"toSpaceId"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"format"}},{"kind":"Field","name":{"kind":"Name","value":"isType"}}]}}]} as unknown as DocumentNode; -export const EntityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Entity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"spaceIds"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"property"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"language"}},{"kind":"Field","name":{"kind":"Name","value":"unit"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relationsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"fromEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"toSpaceId"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"format"}},{"kind":"Field","name":{"kind":"Name","value":"isType"}}]}}]} as unknown as DocumentNode; +export const EntityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Entity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"spaceIds"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"property"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"language"}},{"kind":"Field","name":{"kind":"Name","value":"unit"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relationsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"fromEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"toSpaceId"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"format"}},{"kind":"Field","name":{"kind":"Name","value":"isType"}}]}}]} as unknown as DocumentNode; export const RelationEntityRelationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RelationEntityRelations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"relations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"entityId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullRelation"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullRelation"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Relation"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fromEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"toSpaceId"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const RelationsByToEntityIdsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RelationsByToEntityIds"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"toEntityIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"typeId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"relations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"toEntityId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"in"},"value":{"kind":"Variable","name":{"kind":"Name","value":"toEntityIds"}}}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"typeId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"typeId"}}}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"toEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"fromEntityId"}}]}}]}}]} as unknown as DocumentNode; export const EntityPageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"EntityPage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"spaceIds"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"property"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PropertyFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"language"}},{"kind":"Field","name":{"kind":"Name","value":"unit"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relationsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"fromEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"toSpaceId"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"relations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"entityId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"spaceId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"is"},"value":{"kind":"Variable","name":{"kind":"Name","value":"spaceId"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullRelation"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PropertyFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PropertyInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"dataTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeId"}},{"kind":"Field","name":{"kind":"Name","value":"renderableTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"format"}},{"kind":"Field","name":{"kind":"Name","value":"isType"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullRelation"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Relation"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fromEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"valuesList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spaceId"}},{"kind":"Field","name":{"kind":"Name","value":"propertyId"}},{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"integer"}},{"kind":"Field","name":{"kind":"Name","value":"float"}},{"kind":"Field","name":{"kind":"Name","value":"point"}},{"kind":"Field","name":{"kind":"Name","value":"boolean"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"datetime"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"bytes"}},{"kind":"Field","name":{"kind":"Name","value":"schedule"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"toSpaceId"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; diff --git a/apps/web/core/io/graphql-client.ts b/apps/web/core/io/graphql-client.ts index 4fa677a570..c6aceb38f7 100644 --- a/apps/web/core/io/graphql-client.ts +++ b/apps/web/core/io/graphql-client.ts @@ -53,7 +53,10 @@ function transformVariables>(variables: T | un } function getOperationName(document: TypedDocumentNode): string | undefined { - const op = document.definitions.find(def => def.kind === 'OperationDefinition'); + /** `~/core/gql` returns `{}` when the query string is missing from the codegen map (e.g. after editing query-fragments without `bun run gql:codegen`). */ + const defs = document?.definitions; + if (!Array.isArray(defs)) return undefined; + const op = defs.find(def => def.kind === 'OperationDefinition'); if (!op || op.kind !== 'OperationDefinition') { return undefined; } diff --git a/apps/web/core/io/query-fragments.tsx b/apps/web/core/io/query-fragments.tsx index d65ece52df..b6094b4607 100644 --- a/apps/web/core/io/query-fragments.tsx +++ b/apps/web/core/io/query-fragments.tsx @@ -346,6 +346,7 @@ export const entityQuery = graphql(/* GraphQL */ ` name description spaceIds + updatedAt types { id diff --git a/apps/web/core/utils/utils.ts b/apps/web/core/utils/utils.ts index 7c162d4a44..205826b7b7 100644 --- a/apps/web/core/utils/utils.ts +++ b/apps/web/core/utils/utils.ts @@ -15,6 +15,7 @@ import { Entities } from './entity'; export const NavUtils = { toRoot: () => '/root', + toExplore: () => '/explore', toHome: () => `/home`, toAdmin: (spaceId: string) => `/space/${spaceId}/access-control`, toSpace: (spaceId: string) => (spaceId === ROOT_SPACE ? `/root` : `/space/${spaceId}`), diff --git a/apps/web/core/wallet/privy.tsx b/apps/web/core/wallet/privy.tsx index 85bac25a32..6d2bc6cab9 100644 --- a/apps/web/core/wallet/privy.tsx +++ b/apps/web/core/wallet/privy.tsx @@ -7,6 +7,8 @@ import * as React from 'react'; import { GEOGENESIS } from './geo-chain'; const config: PrivyClientConfig = { + // Session refresh calls auth.privy.io; TimeoutError usually means the host cannot reach Privy + // (firewall/VPN/DNS). Not configurable here—fix network or use Privy dashboard allowed origins. defaultChain: GEOGENESIS, supportedChains: [GEOGENESIS], loginMethods: ['email'], diff --git a/apps/web/design-system/dropdown.tsx b/apps/web/design-system/dropdown.tsx index 9d576502c5..ddf657197a 100644 --- a/apps/web/design-system/dropdown.tsx +++ b/apps/web/design-system/dropdown.tsx @@ -6,6 +6,7 @@ import * as React from 'react'; import { useState } from 'react'; import { cva } from 'class-variance-authority'; +import cx from 'classnames'; import { ChevronDownSmall } from './icons/chevron-down-small'; import { Spacer } from './spacer'; @@ -14,20 +15,32 @@ import { Text } from './text'; interface Props { trigger: React.ReactNode; align?: 'end' | 'center' | 'start'; + /** When true, the menu scrolls vertically after ~22rem / 65vh so long option lists stay usable. */ + scrollableList?: boolean; options: { label: React.ReactNode; sublabel?: string; value: string; disabled: boolean; onClick: () => void }[]; } -const contentStyles = cva('z-10 w-[273px] overflow-hidden rounded border border-grey-02 bg-white shadow-lg', { - variants: { - align: { - start: 'origin-top-left', - center: 'origin-top', - end: 'origin-top-right', +const contentStyles = cva( + 'z-10 w-[273px] rounded border border-grey-02 bg-white shadow-lg', + { + variants: { + align: { + start: 'origin-top-left', + center: 'origin-top', + end: 'origin-top-right', + }, + scroll: { + true: 'max-h-[min(22rem,65vh)] overflow-y-auto overflow-x-hidden', + false: 'overflow-hidden', + }, }, - }, -}); + defaultVariants: { + scroll: false, + }, + } +); -export const Dropdown = ({ trigger, align = 'end', options }: Props) => { +export const Dropdown = ({ trigger, align = 'end', scrollableList = false, options }: Props) => { // Using a controlled state to enable exit animations with framer-motion const [open, setOpen] = useState(false); @@ -40,8 +53,12 @@ export const Dropdown = ({ trigger, align = 'end', options }: Props) => { - - + + {options.map((option, index) => ( Root + + + Explore + {personalSpaceId ? ( diff --git a/apps/web/partials/browse-sidebar/load-browse-sidebar-data.ts b/apps/web/partials/browse-sidebar/load-browse-sidebar-data.ts index 26a003fa6b..9f3de252e9 100644 --- a/apps/web/partials/browse-sidebar/load-browse-sidebar-data.ts +++ b/apps/web/partials/browse-sidebar/load-browse-sidebar-data.ts @@ -1,26 +1,10 @@ 'use server'; -import { Effect } from 'effect'; import { cookies } from 'next/headers'; import { WALLET_ADDRESS } from '~/core/cookie'; +import { resolveMemberSpaceFromWallet } from '~/core/browse/resolve-member-space-from-wallet'; import { fetchBrowseSidebarData, type BrowseSidebarData } from '~/core/browse/fetch-browse-sidebar-data'; -import { getSpaceByAddress } from '~/core/io/queries'; -import { fetchProfile } from '~/core/io/subgraph'; -import { validateSpaceId } from '~/core/utils/utils'; - -/** - * REST profile sometimes falls back to `spaceId === wallet` when the request fails. - * Subgraph membership/editor filters need the real personal space id (bytes16 / UUID). - */ -async function resolveMemberSpaceId(walletAddress: string): Promise { - const profile = await Effect.runPromise(fetchProfile(walletAddress)); - if (validateSpaceId(profile.spaceId)) { - return profile.spaceId; - } - const space = await Effect.runPromise(getSpaceByAddress(walletAddress)); - return space && validateSpaceId(space.id) ? space.id : null; -} /** * @param walletAddressHint — Smart account address from the client when the session cookie @@ -32,6 +16,6 @@ export async function loadBrowseSidebarData(walletAddressHint?: string | null): if (!wallet) { return fetchBrowseSidebarData(null); } - const memberSpaceId = await resolveMemberSpaceId(wallet); + const memberSpaceId = await resolveMemberSpaceFromWallet(wallet); return fetchBrowseSidebarData(memberSpaceId); } diff --git a/apps/web/partials/comments/comments-section.tsx b/apps/web/partials/comments/comments-section.tsx index 6c39869e9c..14deb2815b 100644 --- a/apps/web/partials/comments/comments-section.tsx +++ b/apps/web/partials/comments/comments-section.tsx @@ -41,6 +41,15 @@ export function CommentSection({ entityId, spaceId }: CommentSectionProps) { const [sortOrder, setSortOrder] = useState('newest'); const [filter, setFilter] = useState('all'); + React.useEffect(() => { + if (typeof window === 'undefined') return; + if (window.location.hash !== '#entity-comments') return; + const el = document.getElementById('entity-comments'); + if (el) { + requestAnimationFrame(() => el.scrollIntoView({ behavior: 'smooth', block: 'start' })); + } + }, [entityId, spaceId]); + const handleCreateComment = (text: string, ancestorComments?: Array<{ id: string; spaceId: string }>) => { createComment({ text, @@ -71,7 +80,7 @@ export function CommentSection({ entityId, spaceId }: CommentSectionProps) { }, [comments, sortOrder, filter, editorSpaceIds]); return ( -
+
Comments ({totalCount})
diff --git a/apps/web/partials/explore/explore-comments-icon.tsx b/apps/web/partials/explore/explore-comments-icon.tsx new file mode 100644 index 0000000000..c4ffb78d7e --- /dev/null +++ b/apps/web/partials/explore/explore-comments-icon.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; + +/** Compact speech-bubble icon for explore feed comment counts. */ +export function ExploreCommentsIcon({ className }: { className?: string }) { + return ( + + + + ); +} diff --git a/apps/web/partials/explore/explore-feed-card.tsx b/apps/web/partials/explore/explore-feed-card.tsx new file mode 100644 index 0000000000..a9368d43c0 --- /dev/null +++ b/apps/web/partials/explore/explore-feed-card.tsx @@ -0,0 +1,104 @@ +'use client'; + +import * as React from 'react'; + +import type { ExploreFeedItem } from '~/core/explore/fetch-explore-feed'; +import { formatExploreRelativeTime } from '~/core/explore/explore-relative-time'; +import { NavUtils } from '~/core/utils/utils'; + +import { ThumbGeoImage } from '~/design-system/geo-image'; +import { PrefetchLink as Link } from '~/design-system/prefetch-link'; +import { Text } from '~/design-system/text'; + +import { EntityVoteButtons } from '~/partials/entity-page/entity-vote-buttons'; + +import { ExploreCommentsIcon } from './explore-comments-icon'; +import { ExploreJoinSpaceButton } from './explore-join-space-button'; + +type ExploreFeedCardProps = { + item: ExploreFeedItem; +}; + +function SpaceThumb({ image, name }: { image: string | null; name: string }) { + if (!image) { + const initial = name.trim().slice(0, 1).toUpperCase() || '?'; + return ( + + {initial} + + ); + } + return ( + + + + ); +} + +export function ExploreFeedCard({ item }: ExploreFeedCardProps) { + const typeLabel = item.types + .filter(t => t.name) + .map(t => t.name) + .join(' · '); + const edited = formatExploreRelativeTime(item.updatedAtSec); + + const entityHref = `${NavUtils.toEntity(item.spaceId, item.entityId)}#entity-comments`; + + return ( +
+
+
+ + + {item.spaceName} + + {typeLabel ? · {typeLabel} : null} + {item.isNewPost ? ( + + New post + + ) : null} + {edited} +
+ {!item.isMemberOrEditor ? ( + + ) : null} +
+ +
+
+ + + {item.title} + + + {item.description ? ( +

{item.description}

+ ) : null} +
+ {item.imageUrl ? ( + + + + ) : null} +
+ +
+ + + + {item.commentCount} + +
+
+ ); +} diff --git a/apps/web/partials/explore/explore-join-space-button.tsx b/apps/web/partials/explore/explore-join-space-button.tsx new file mode 100644 index 0000000000..0ea9b29357 --- /dev/null +++ b/apps/web/partials/explore/explore-join-space-button.tsx @@ -0,0 +1,46 @@ +'use client'; + +import * as React from 'react'; + +import { useOnboardGuard } from '~/core/hooks/use-onboard-guard'; +import { useRequestToBeMember } from '~/core/hooks/use-request-to-be-member'; + +import { Pending } from '~/design-system/pending'; + +type ExploreJoinSpaceButtonProps = { + spaceId: string; + hasRequestedSpaceMembership: boolean; +}; + +export function ExploreJoinSpaceButton({ spaceId, hasRequestedSpaceMembership }: ExploreJoinSpaceButtonProps) { + const { requestToBeMember, status } = useRequestToBeMember({ spaceId }); + const { shouldShowElement } = useOnboardGuard(); + const [localSuccess, setLocalSuccess] = React.useState(false); + + React.useEffect(() => { + if (status === 'success') setLocalSuccess(true); + }, [status]); + + if (!shouldShowElement) { + return null; + } + + const showPendingLabel = hasRequestedSpaceMembership || localSuccess; + + return ( + + {showPendingLabel ? ( + Membership pending + ) : ( + + )} + + ); +} diff --git a/apps/web/partials/explore/explore-page.tsx b/apps/web/partials/explore/explore-page.tsx new file mode 100644 index 0000000000..ef0333d9aa --- /dev/null +++ b/apps/web/partials/explore/explore-page.tsx @@ -0,0 +1,166 @@ +'use client'; + +import { useInfiniteQuery } from '@tanstack/react-query'; +import * as React from 'react'; + +import type { ExploreFeedItem, ExploreFeedResult, ExploreSort, ExploreTime } from '~/core/explore/fetch-explore-feed'; + +import { Dropdown } from '~/design-system/dropdown'; +import { Text } from '~/design-system/text'; + +import { ExploreFeedCard } from './explore-feed-card'; + +const SORT_OPTIONS: { value: ExploreSort; label: string }[] = [ + { value: 'new', label: 'New' }, + { value: 'top', label: 'Top' }, + { value: 'controversial', label: 'Controversial' }, +]; + +const TIME_OPTIONS: { value: ExploreTime; label: string }[] = [ + { value: 'today', label: 'Today' }, + { value: 'week', label: 'This week' }, + { value: 'month', label: 'Last month' }, + { value: 'year', label: 'Last year' }, + { value: 'all', label: 'All time' }, +]; + +type SpaceOption = { value: string; label: string }; + +async function fetchExplorePage(params: { + sort: ExploreSort; + time: ExploreTime; + spaceId: string; + cursor: string | undefined; +}): Promise { + const sp = new URLSearchParams(); + sp.set('sort', params.sort); + sp.set('time', params.time); + sp.set('spaceId', params.spaceId); + if (params.cursor) sp.set('cursor', params.cursor); + const res = await fetch(`/api/explore/feed?${sp.toString()}`, { credentials: 'include' }); + if (!res.ok) { + throw new Error('Explore feed failed'); + } + return res.json() as Promise; +} + +export function ExplorePage({ + initialSpaceOptions, +}: { + initialSpaceOptions: SpaceOption[]; +}) { + const [sort, setSort] = React.useState('top'); + const [time, setTime] = React.useState('week'); + const [spaceId, setSpaceId] = React.useState('all'); + + const { data, isLoading, isFetchingNextPage, fetchNextPage, hasNextPage, error } = useInfiniteQuery({ + queryKey: ['explore-feed', sort, time, spaceId], + queryFn: ({ pageParam }) => + fetchExplorePage({ sort, time, spaceId, cursor: pageParam as string | undefined }), + initialPageParam: undefined as string | undefined, + getNextPageParam: last => last.nextCursor ?? undefined, + retry: 2, + retryDelay: attemptIndex => Math.min(1000 * 2 ** attemptIndex, 8000), + }); + + const sentinelRef = React.useRef(null); + + React.useEffect(() => { + const el = sentinelRef.current; + if (!el || !hasNextPage) return; + const io = new IntersectionObserver( + entries => { + if (entries[0]?.isIntersecting && !isFetchingNextPage) { + void fetchNextPage(); + } + }, + { rootMargin: '400px' } + ); + io.observe(el); + return () => io.disconnect(); + }, [fetchNextPage, hasNextPage, isFetchingNextPage]); + + const items = React.useMemo(() => { + const pages = data?.pages ?? []; + const flat: ExploreFeedItem[] = []; + for (const p of pages) flat.push(...p.items); + if (sort === 'controversial') { + return [...flat].sort((a, b) => b.commentCount - a.commentCount); + } + return flat; + }, [data?.pages, sort]); + + const sortLabel = SORT_OPTIONS.find(o => o.value === sort)?.label ?? sort; + const timeLabel = TIME_OPTIONS.find(o => o.value === time)?.label ?? time; + const spaceLabel = + spaceId === 'all' ? 'Any space' : initialSpaceOptions.find(o => o.value === spaceId)?.label ?? 'Any space'; + + return ( +
+ + Explore + +

+ Discover entities from featured spaces and spaces you belong to. Vote, comment, and join the graph. +

+ +
+ {sortLabel}} + options={SORT_OPTIONS.map(o => ({ + label: o.label, + value: o.value, + disabled: false, + onClick: () => setSort(o.value), + }))} + /> + {timeLabel}} + options={TIME_OPTIONS.map(o => ({ + label: o.label, + value: o.value, + disabled: false, + onClick: () => setTime(o.value), + }))} + /> +
+ {spaceLabel}} + options={[ + { + label: 'Any space', + value: 'all', + disabled: false, + onClick: () => setSpaceId('all'), + }, + ...initialSpaceOptions.map(o => ({ + label: o.label, + value: o.value, + disabled: false, + onClick: () => setSpaceId(o.value), + })), + ]} + /> +
+
+ +
+ {error ? ( +

Could not load the explore feed.

+ ) : isLoading ? ( +

Loading…

+ ) : items.length === 0 ? ( +

No entities match these filters yet.

+ ) : ( + items.map(item => ) + )} +
+ {isFetchingNextPage ?

Loading more…

: null} +
+
+ ); +} diff --git a/apps/web/public/browse-nav/explore.svg b/apps/web/public/browse-nav/explore.svg new file mode 100644 index 0000000000..8795533df7 --- /dev/null +++ b/apps/web/public/browse-nav/explore.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + From 19f8b15a553f22bf5c2ecee960a0a46057b541a9 Mon Sep 17 00:00:00 2001 From: Juan Mardikian Date: Thu, 16 Apr 2026 12:51:19 -0400 Subject: [PATCH 2/2] feat: fix deployment issue --- apps/web/core/explore/fetch-explore-feed.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/core/explore/fetch-explore-feed.ts b/apps/web/core/explore/fetch-explore-feed.ts index 104288536a..5136a94abc 100644 --- a/apps/web/core/explore/fetch-explore-feed.ts +++ b/apps/web/core/explore/fetch-explore-feed.ts @@ -237,7 +237,6 @@ async function enrichItems( downvotes: v!.downvotes, commentCount: cc, isMemberOrEditor: memberOrEditorSpaceIds.has(normId(spaceId)), - hasPendingMembershipRequest: false, isNewPost: isExploreNewPost(updatedAtSec), }); }