dotansimha / dotansimha/graphql-code-generator

Comment in the beginning of generated files

Open
#5,063 3 comments 5 reactions 2 assignees Claimed by @saihaj View on GitHub
core kind/enhancement
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

**Is your feature request related to a problem? Please describe.**
No indication is given that a file is generated inside the file itself with default settings. I think that this should be the standard to clearly indicate to all developers that a file is generated.

**Describe the solution you'd like**
Always prepend generated files with a block comment describing that the file has been generated by graphql-code-generator, maybe even which plugins and what config that were used (This might be a security issue, since it might expose version/plugin-related vulnerabilities?).

Something like:
```typescript
/*
Generated by @graphql-codegen/cli@1.19.1
Plugins:
@graphql-codegen/typescript@1.17.11
@graphql-codegen/typescript-resolvers@1.17.10
Config:
federation: true
useIndexSignature: true
*/
```

**Describe alternatives you've considered**
At the moment it is possible, with the help of the add-plugin, to prepend comments describing that the file is generated. This isn't optimal though.

**Additional context**

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.