Kotlin2 codegen implementation is eager
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Payload nêu GraphQLQueryRequest, DgsClient.buildQuery và phần triển khai projection của Kotlin2 là các điểm vào liên quan; trước tiên, hãy lần theo cách các projection được tạo và tuần tự hóa trong những đường dẫn này. So sánh hành vi của field-map trong Java với Kotlin2, sau đó xác minh rằng các field được chọn lặp lại được loại bỏ trùng lặp trong khi vẫn giữ nguyên sự phân tách giữa Query và Projection.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hey all,
Thanks for this amazing library. In our current setup I ran into the following. When building the query with Kotlin projections (love the feature) it's eager. When you select a field or create a projection, the string is build eagerly.
Compared to the Java implementation the fields are stored to a map and serialised when you call the .serialize() function. The result is, when you are selecting the same field multiple times it's only included once.
We try to split our projection selection which might result in duplication of selecting a field (for example a name or id property) and this is now included in the query. GraphQL does accept it but it adds extra noise to the query which is not needed.
Proposed solution
Instead of moving to the DgsClient.buildQuery still support the split between Query and Projection which is done by using the GraphQLQueryRequest. This then can use the same underlying builder pattern that is now for the Projections but instead of calling functions it's done with the same solution that is being used for the Kotlin2 implementation.
Example
Current java result
public XProjectionRoot y() {
getFields().put("y", null);
return this;
}
Current kotlin2 implementation
public val y: XProjection
get() {
field("y")
return this
}
Proposed kotlin2 implementation
public val y: XProjection
get() {
getFields().put("y", null);
return this
}
And instead of using the DgsClient.buildQuery function we can provide the projection to the current GraphQLQueryRequest
- Ngôn ngữ chính
- Kotlin
- Star
- 220
- Fork
- 123
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 23
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 Netflix/dgs-codegen
-
Integer default values on `Float` input fields generate code that does not compile (Java and Kotlin)Có thể đã có người làm @0z5a đã nhận 9 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Netflix/dgs-codegen#1015 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
Netflix/dgs-codegen#1002 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Object literal default value on a custom scalar fails with NoSuchElementExceptionCó thể đã có người làm @nboisnea đã nhận 49 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Netflix/dgs-codegen#982 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HV000271: Using @Valid on a container (java.util.List) is deprecated. You should apply the annotation on the type argument(s).Có thể đã có người làm @jiholee17 đã nhận 73 ngày trước. Đang mởenhancement
Netflix/dgs-codegen#954 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support Immutable java Data TypesCó thể làm lại được @jiholee17 đã nhận 184 ngày trước và không có pull request nào đang mở. Đang mởenhancement
Netflix/dgs-codegen#944 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Netflix/dgs-codegen
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
DojoCodingLabs/hermit#23 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
signalapp/Signal-Android#15148 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
PranshulGG/WeatherMaster#1266 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày