facebook / facebook/relay

required directive on inline fragment

Open
#3,910 3 comments 4 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

I feel like most common use case for required directive will be in Node Queries

but relay compiler throws error when using required on INLINE FRAGMENT

Directive "@required" may not be used on INLINE_FRAGMENT.

```graphql
node(id: $id) {
id
__typename
... on Spoke @required(action: THROW) {
id
}
}
```

Any way to make relay generate type such that all elements on inline fragments are not nullable?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.