dotansimha / dotansimha/graphql-code-generator-community

Flow plugin, does not take useFlowReadOnlyTypes into consideration when parsing __typename + array field

Open
#347 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
137
Forks
195
Avg merge
6h 20m
Merged PRs (30d)
16

Description

### Which packages are impacted by your issue?

@graphql-codegen/flow

### Describe the bug

i did a code patch in my repo, [ref](https://github.com/kencanak/graphql-code-generator-community/commit/51c586508755185a01897acf1f6ada3f767fc88e). seems to resolve the issue. however, I am not sure if this is the best approach

### Your Example Website or App

n/a

### Steps to Reproduce the Bug or Issue

with the following config:

```
plugins: ["flow"],
config: {
nonOptionalTypename: true,
preResolveTypes: false,
namingConvention: "keep",
useFlowReadOnlyTypes: true,
useFlowExactObjects: true,
},
```

Sample output:
```
export type GuffType = {|
__typename: 'GuffType',
+absolute_url?: ?$ElementType,
+compliance?: ?Array,
|};
```

### Expected behavior

expected output:
```
export type GuffType = {|
+__typename: 'GuffType',
+absolute_url?: ?$ElementType,
+compliance?: ?ReadOnlyArray,
|};

### Screenshots or Videos

_No response_

### Platform

- OS: [e.g. macOS, Windows, Linux]
- NodeJS: [e.g. 18.5.0]
- `graphql` version: [e.g. 16.3.0]
- `@graphql-codegen/*` version(s): [e.g. 2.6.2]

### Codegen Config File

_No response_

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.