Throw when a resolver method is missing a parameter for an argument in 15.0.0
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- graphql, kotlin
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start in SchemaClassScanner#warnIfParameterMissing and read the existing warning path, then inspect MethodFieldResolverTest for the named test and the 15.0.0 release notes. Replace the warning with a FieldResolverError that preserves its message and verify it is thrown even when either resolver fallback option is enabled. Done when the test asserts the error and the release notes describe the change.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up to #418 and #890. Tools now warns at build when a resolver method is missing the parameter for an argument and has a DataFetchingEnvironment, GraphQLContext or contextClass parameter instead. The parameter count still matches, so the scanner accepts it and maps the arguments by position:
type Query {
users(first: Int): UserConnection
}
fun users(env: DataFetchingEnvironment): Connection<User>
Every query of users then fails, with Parameter specified as non-null is null: ... parameter env when first is omitted and Cannot construct instance of graphql.schema.DataFetchingEnvironment when it's sent. The build logs:
Field 'Query.users' has no parameter for its argument 'first: Int' in scenarios.ContextMisboundQuery.users, so the DataFetchingEnvironment parameter gets the argument instead. Add a parameter for each argument, in order, before the DataFetchingEnvironment parameter.
For the contextClass it only warns when the argument is a spec scalar, since the context class can also be a real argument type (e.g. contextClass(Map) with an input object mapped to a Map).
A resolver like this can't work, so it should fail the build. But a schema whose broken field is never queried builds and runs fine today, so throwing has to wait for a major release.
What to change
- replace the warning in
SchemaClassScanner#warnIfParameterMissingwith aFieldResolverErrorthat keeps the same message - throw it even with
allowUnimplementedResolversormissingResolverDataFetcherset, since the resolver exists but can't be called - turn
MethodFieldResolverTest."should warn when a resolver method is missing a parameter for an argument"into a test for the error - mention it in the 15.0.0 release notes
- Ngôn ngữ chính
- Kotlin
- Star
- 824
- Fork
- 175
- Merge trung bình
- 2 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 52
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 graphql-java-kickstart/graphql-java-tools
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0Đang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
graphql-java-kickstart/graphql-java-tools#881 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Directive wirings see a type reference on recursive input fieldsCó thể đã có người làm @oryan-block đã nhận hôm nay. Đang mởbug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
graphql-java-kickstart/graphql-java-tools#875 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của graphql-java-kickstart/graphql-java-tools
Issue tương tự
-
area/kotlin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
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 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
dafonton77-tech/Cadreenf#11 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Hy4ri/hermes-mobile#1647 ·
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 66/100
supabase-community/supabase-kt#1429 ·
Maintainer thường phản hồi trong vòng 5 ngày