MCPcopy Create free account
hub / github.com/emwalker/digraph / query_info

Method query_info

backend/src/graphql/view.rs:103–132  ·  view source on GitHub ↗
(&self, ctx: &Context<'_>)

Source from the content-addressed store, hash-verified

101 }
102
103 async fn query_info(&self, ctx: &Context<'_>) -> Result<QueryInfoPayload> {
104 if let Some(search_string) = &self.search_string {
105 let git::Search {
106 topic_specs,
107 tokens: phrases,
108 ..
109 } = git::Search::parse(search_string)?;
110
111 let topics = ctx
112 .data_unchecked::<Store>()
113 .fetch_topics(topic_specs.into_iter().map(|spec| spec.id).collect(), 10)
114 .await?
115 .into_iter()
116 .map(|topic| topic.into())
117 .collect();
118
119 return Ok(QueryInfoPayload {
120 topics,
121 phrases: phrases
122 .into_iter()
123 .map(|phrase| phrase.to_string())
124 .collect(),
125 });
126 }
127
128 Ok(QueryInfoPayload {
129 topics: vec![],
130 phrases: vec![],
131 })
132 }
133
134 async fn viewer(&self, ctx: &Context<'_>) -> Result<User> {
135 let user = match self.viewer_id.to_string().as_str() {

Callers

nothing calls this directly

Calls 2

parseFunction · 0.85
fetch_topicsMethod · 0.80

Tested by

no test coverage detected