Not fully understanding the purpose of this project

オープン
#245 コメント 3 件 リアクション 12 件 担当者 1 名 GitHub で見る

@nikithauc がすでに取り組んでいます。

2021年4月7日 から。

評価

この issue はまだ評価されていません。

説明

question

Hi there.
I've been using the microsoft graph client and the types in this repo.

The thing I don't fully understand, is why the types are separate from the microsoft graph client project, and why I need to explicitly typecast. It relies on me, the consumer, knowing the types ahead of time. I don't know the request or response data schema for all the endpoints, so how am I supposed to typecast? This approach seems a little risky to me, I could be typecasting wrong and could be using the wrong data structures.

Can someone clarify the situation and explain the microsoft graph client doesn't just use the types in this repo? It would make consumers's lives a lot better!

The client should provide the types for every endpoint. In the example below, as i consumer, I expect the client to tell me the types it expects:

// `user` should be typed by default
// the return type should be typed by default
client.api(`/users/${id}`).patch(user);

If the types cannot be combined with the client, can i suggest a slightly better approach (imo) for handling types. Instead of typecasting we can use generics:

client.api(`/users/${id}`).patch<RequestType, ResponseType>(user);

AB#8842

主要言語
PowerShell
スター
129
フォーク
35
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoftgraph/msgraph-typescript-typings のほかの issue

microsoftgraph/msgraph-typescript-typings の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。