dotansimha / dotansimha/graphql-code-generator
Decorator auto accessors syntax is not supported
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
### Which packages are impacted by your issue?
@graphql-codegen/cli
### Describe the bug
The codegen CLI does not seem to be compatible with the `accessor` syntax:
```
@observable.ref
accessor data: Workspace;
```
Output:
```
✔ Parse Configuration
⚠ Generate outputs
❯ Generate to ./gen/
✔ Load GraphQL schemas
✖ This experimental syntax requires enabling the parser plugin: "decoratorAutoAccessors". (42:11)
◼ Generate
```
Configuration:
```
import { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "http://localhost:3000/graphql",
// this assumes that all your source files are in a top-level `src/` directory - you might need to adjust this to your file structure
documents: [
"src/**/*.{ts,tsx}",
],
generates: {
"./gen/": {
preset: "client",
plugins: [],
presetConfig: {
gqlTagName: "gql",
},
},
},
// ignoreNoDocuments: true,
};
export default config;
```
### Your Example Website or App
No
### Steps to Reproduce the Bug or Issue
No
### Expected behavior
Syntax supported
### Screenshots or Videos
_No response_
### Platform
"@graphql-codegen/cli": "^5.0.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.