RecordProxy: how to access fields with complex arguments?
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
_This is somehow similar to https://github.com/facebook/relay/issues/3065 but it's not really the same._
Hi, we have a `count` field on a connection which accepts complex arguments like so:
```graphql
count(legacyFilter: LeadsLegacyFilter): Int
# input LeadsLegacyFilter {
# labels: [ID!]
# owners: [ID!]
# sources: [ID!]
# status: ALL | ARCHIVED | ...
# }
```
Now, let's say we want to update the `count` number for status `ALL` no matter what labels or other parts of the filter are set (notice the filter fields are all optional). A typical use-case would be a deletion of the record(s) => decrease counter. Here is the issue - the count field is internally stored like so:
```text
count(legacyFilter:{"status":"ALL"})
count(legacyFilter:{"labels":[],"owners":[],"sources":[],"status":"ALL"})
count(legacyFilter:{"labels":["abcdef"],"owners":[],"sources":[],"status":"ALL"})
// ... any other possible combination ∞
```
❓How can I access these fields easily considering `RecordProxy.(get|set)Value` works with explicit arguments and doesn't return the fields unless I know the args in advance?
I'd like to acknowledge that this is a poorly designed GraphQL schema and we have to fix it, however, this issue directly translates to any other field with complex args.
Contributor guide
Assessment
This issue has not been assessed yet.