refactor: rename to get_store_listed_graphs

Clearer name indicating these are store-listed public graphs
that don't require permission checks.
This commit is contained in:
Otto
2026-01-31 14:52:21 +00:00
parent 1b34c871d7
commit 5cecaf0f58
2 changed files with 7 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ from backend.data.graph import (
create_graph,
get_graph,
get_graph_all_versions,
get_graphs_by_ids,
get_store_listed_graphs,
)
from backend.util.exceptions import DatabaseError, NotFoundError
@@ -295,7 +295,7 @@ async def search_marketplace_agents_for_generation(
return []
graph_ids = [agent.agent_graph_id for agent in agents_with_graphs]
graphs = await get_graphs_by_ids(*graph_ids)
graphs = await get_store_listed_graphs(*graph_ids)
results: list[LibraryAgentSummary] = []
for agent in agents_with_graphs:

View File

@@ -1028,18 +1028,17 @@ async def get_graph(
return GraphModel.from_db(graph, for_export)
async def get_graphs_by_ids(*graph_ids: str) -> dict[str, GraphModel]:
"""Batch-fetch multiple public/marketplace graphs by their IDs.
async def get_store_listed_graphs(*graph_ids: str) -> dict[str, GraphModel]:
"""Batch-fetch multiple store-listed graphs by their IDs.
This fetches graphs that are publicly available via approved store listings.
Used for marketplace agent schema lookups where we need multiple graphs
in a single query.
Only returns graphs that have approved store listings (publicly available).
Does not require permission checks since store-listed graphs are public.
Args:
*graph_ids: Variable number of graph IDs to fetch
Returns:
Dict mapping graph_id to GraphModel for successfully fetched graphs
Dict mapping graph_id to GraphModel for graphs with approved store listings
"""
if not graph_ids:
return {}