99designs / 99designs/gqlgen

Omit chan element pointers

Đang mở
#1,302 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

### What happened?
Defined a simple subscription.
```graphql
type Subscription {
todoAdded: Todo!
}
```

### What did you expect?
I expected the generated code to use a channel of my `Todo` struct, but not pointers.
```diff
-- <-chan *model.Todo
++ <-chan model.Todo
```

I get that gqlgen uses pointers on query resolvers, because on GraphQL you can return `null`, but it doesn't make much sense for a subscription. Maybe this can be configurable the same way that slices are `omit_slice_element_pointers: true` 🤔

### Minimal graphql.schema and models to reproduce

### versions
- `gqlgen version`? v0.12.2-dev
- `go version`? go version go1.15 linux/amd64
- dep or go modules? go modules

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.