`amplify codegen` Ignores `@deprecated` Directive In GraphQL Schema
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,
type ToDo @model {
id: ID!
name: String!
due: String! @deprecated(reason: "use dueDate instead")
dueDate: AWSDateTime!
}
turns into this
export type ToDo = {
__typeName: "ToDo";
id: string;
name: string;
due: string;
dueDate: string;
createdAt: string;
updatedAt: string;
};
though I hope like this.
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
Heyπ thanks for raising this! I'm going to transfer this over to our API repository for better assistance π
Hi @tsuyuni, we do not support @deprecated directive. Marking this as a feature request.