Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amplify codegen Ignores @deprecated Directive In GraphQL Schema #863

Open
2 tasks
tsuyuni opened this issue Aug 13, 2024 · 2 comments
Open
2 tasks

amplify codegen Ignores @deprecated Directive In GraphQL Schema #863

tsuyuni opened this issue Aug 13, 2024 · 2 comments
Labels
feature-request New feature or request transferred Issue has been transferred from another Amplify repository

Comments

@tsuyuni
Copy link

tsuyuni commented Aug 13, 2024

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
@tsuyuni tsuyuni added the pending-triage Issues that need further discussion to determine label Aug 13, 2024
@ykethan
Copy link
Member

ykethan commented Aug 13, 2024

Hey👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂

@ykethan ykethan transferred this issue from aws-amplify/amplify-cli Aug 13, 2024
@ykethan ykethan added the transferred Issue has been transferred from another Amplify repository label Aug 13, 2024
@AnilMaktala AnilMaktala transferred this issue from aws-amplify/amplify-category-api Aug 13, 2024
@phani-srikar
Copy link
Contributor

Hi @tsuyuni, we do not support @deprecated directive. Marking this as a feature request.

@phani-srikar phani-srikar added feature-request New feature or request and removed pending-triage Issues that need further discussion to determine labels Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request transferred Issue has been transferred from another Amplify repository
Projects
None yet
Development

No branches or pull requests

3 participants