Not fully understanding the purpose of this project
@nikithauc đang làm issue này rồi.
Từ ngày 7/4/2021.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- PowerShell
- Star
- 129
- Fork
- 35
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-typescript-typings
-
status:waiting-for-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
microsoftgraph/msgraph-typescript-typings#756 · 1 reaction ·
-
status:waiting-for-triage type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-typescript-typings#748 · 2 reaction ·
-
status:waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
-
status:waiting-for-triage type:feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-typescript-typings#530 · 1 reaction ·