aws-amplify / aws-amplify/amplify-codegen
`amplify codegen` Ignores `@deprecated` Directive In GraphQL Schema
- Dominant language
- TypeScript
- Stars
- 59
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
### Is this feature request related to a new or existing Amplify category?
api
### Is this related to another service?
AppSync
### Describe the feature you'd like to request
When I made some fields deprecated by adding `@deprecated` directive in `schema.graphql`, these deprecations are ignored in autogenerated `src/API.ts` file.
For example,
```graphql
type ToDo @model {
id: ID!
name: String!
due: String! @deprecated(reason: "use dueDate instead")
dueDate: AWSDateTime!
}
```
turns into this
```typescript
export type ToDo = {
__typeName: "ToDo";
id: string;
name: string;
due: string;
dueDate: string;
createdAt: string;
updatedAt: string;
};
```
though I hope like this.
```typescript
export type ToDo = {
__typeName: "ToDo";
id: string;
name: string;
/** @deprecated use dueDate instead */
due: string;
dueDate: string;
createdAt: string;
updatedAt: string;
};
```
In the current situation, we can't notice the use of deprecated fields so that unexpected deletion of field might occur. Are there any alternative solution for this? If not, I strongly hope the implementation of this feature.
### Describe the solution you'd like
Explicit marker of deprecated fields.
### Describe alternatives you've considered
Nothing especially.
### Additional context
_No response_
### Is this something that you'd be interested in working on?
- [ ] 👋 I may be able to implement this feature request
### Would this feature include a breaking change?
- [ ] ⚠️ This feature might incur a breaking change
Contributor guide
Assessment
This issue has not been assessed yet.