optional field in array is generated as not undefined but nullable
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hi maintainers,
When I designate optional field in array on graphql like below,
```typescript
import { graphql } from 'relay-runtime';
export const getDataQuery = graphql`
query GetDataQuery() {
data() {
users {
id // String!
name // String
}
flag // Boolean
}
}
`;
```
generated type of it is not undefined but nullable.
On the other hand, when I designate optional field not in array, generated type is optional like below.
```typescript
export type GetDataQuery$data = {
readonly data: {
readonly users?: ReadonlyArray<{
readonly id: string;
readonly name: string | null;
}>;
readonly flag?: boolean;
};
```
Is this by design or bug?
Contributor guide
Assessment
This issue has not been assessed yet.