Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests?
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 42/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- javascript, typescript
研究方向
Start with the JavaScript tab in the linked Microsoft Graph search-query documentation and inspect the client.api('/search/query') request and response behavior. Compare that with the typed C# sample; done means establishing whether typed request and response support exists in this SDK and documenting or scoping the gap clearly.
由索引模型根據 Issue 內容生成。
描述
I'm coming from a C# background so forgive me if I'm wrong on this, but from the documentation it seems for example that doing a graph search in C# is fully typed, e.g:
var requestBody = new QueryPostRequestBody
{
Requests = new List<SearchRequest>
{
new SearchRequest
{
EntityTypes = new List<EntityType?>
{
EntityType.ExternalItem,
},
ContentSources = new List<string>
{
"/external/connections/connectionfriendlyname",
},
Region = "US",
Query = new SearchQuery
{
QueryString = "contoso product",
},
From = 0,
Size = 25,
Fields = new List<string>
{
"title",
"description",
},
},
},
};
var result = await graphClient.Search.Query.PostAsQueryPostResponseAsync(requestBody);
Which is fine, give you a SearchResponse object.
whereas in javascript you need to use the "magic string" /search/query for example:
const searchResponse = {
requests: [
{
entityTypes: [
'externalItem'
],
contentSources: [
'/external/connections/connectionfriendlyname'
],
region: 'US',
query: {
queryString: 'contoso product'
},
from: 0,
size: 25,
fields: [
'title',
'description'
]
}
]
};
await client.api('/search/query')
.post(searchResponse);
And this returns an any type, so you have to know/guess the response?
Both samples taken from https://learn.microsoft.com/en-us/graph/api/search-query?view=graph-rest-1.0&utm_source=chatgpt.com&tabs=javascript
Is this actually correct?
- 主要語言
- TypeScript
- 星號
- 833
- 分支
- 240
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoftgraph/msgraph-sdk-javascript 的其他 Issue
-
status:waiting-for-triage
難度 1/5 1 小時以內 新手友好度 62/100
-
Is anyone here? 未關閉
難度 4/5 3-5 天 新手友好度 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 個 reaction ·
-
status:waiting-for-triage type:bug
難度 3/5 1-2 天 新手友好度 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 則留言 · 1 個 reaction ·
-
status:waiting-for-triage type:bug
難度 4/5 3-5 天 新手友好度 45/100
-
難度 3/5 1-2 天 新手友好度 35/100
查看 microsoftgraph/msgraph-sdk-javascript 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 82/100
-
area:tools bug good first issue help wanted priority:P2
難度 2/5 1-3 小時 新手友好度 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
newrelic-experimental/preflight#793 · 1 則留言 ·