下面是我的apollo angular设置代码:
providers: [
{
provide: APOLLO_OPTIONS,
useFactory: (httpLink: HttpLink) => {
return {
cache: new InMemoryCache(),
link: httpLink.create({
uri: AppSettings.API_ENDPOINT
})
}
},
deps: [HttpLink]
}
],
Run Code Online (Sandbox Code Playgroud)
我想在下面使用:
const link = onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors)
graphQLErrors.map(({ message, locations, path }) =>
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,
),
);
if (networkError) console.log(`[Network error]: ${networkError}`);
});
Run Code Online (Sandbox Code Playgroud)
如何链接它以便我能够在控制台中收到错误?
我正在调用 slack API(conversations.history) 来获取频道消息。我想在消息响应中检索发件人姓名。我怎么才能得到它?
以下是我的留言回复:
{ "client_msg_id": "0e19ca7d-1072-4f73-a932-9ec7fa9956de",
"type": "message",
"text": "Yeah good edge case, I would agree, just mentioning \" no data found\"",
"user": "U01JW9D10PQ",
"ts": "1642216920.001100",
"team": "T01K38V9Q7M", blocks:[]}
Run Code Online (Sandbox Code Playgroud)