Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Better detection for when items were scoped?

Đang mở
#4,848 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

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
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
graphql, ruby
Lĩnh vực
api, authorization

Hướng nghiên cứu

Start with lib/graphql/schema/field/scope_extension.rb at the linked lines 14-18, then examine how runtime metadata is handled. Define a more robust way to distinguish authorized, unchanged external-service lists from lists that were actually scoped; the work is done when this no longer requires a shallow copy and the behavior is covered by the relevant tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Currently, this library checks for whether or not items were scoped by using object equality:

https://github.com/rmosolgo/graphql-ruby/blob/b0d289ebd3ce0f8131d5c04708ece69585d1fad8/lib/graphql/schema/field/scope_extension.rb#L14-L18

This works when scope_items really did something, but not if you want to skip authorization altogether. For example, if you've got a list of items from an external service, and you want to return them as-is, without scoping or authorization, you'd have to do this:

def self.scope_items(items, ctx)
  items.dup # Make a shallow copy so GraphQL-Ruby will know that we authorized this list
end 

I bet there's a more robust way to implement this check (and maybe to implement the runtime metadata, too). I'm going to consider it for 3.0.

Ngôn ngữ chính
Ruby
Star
5.4k
Fork
1.4k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
74

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rmosolgo/graphql-ruby

Tất cả issue của rmosolgo/graphql-ruby

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.