Skip to content

Using enums in our graphql schema #24

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

Closed
blairtaylor opened this issue Sep 25, 2019 · 3 comments
Closed

Using enums in our graphql schema #24

blairtaylor opened this issue Sep 25, 2019 · 3 comments
Labels
doc-gen Issues on graphql-doc-generator feature-request New feature or request

Comments

@blairtaylor
Copy link

We are using enums in our graphql schema in Amplify/AppSync.

We are confused as to what Amplify enforces and how to use the enums. Simply saving the string values works fine but we'd really like to limit available options to enums to add integrity to the code.

What is the best way to save an enum using a mutator and to compare queried values using the enum. The generated /src/graphql files don't seem to expose the enum values.

@manueliglesias manueliglesias transferred this issue from aws-amplify/amplify-js Sep 26, 2019
@nikhname nikhname assigned nikhname and yuth and unassigned nikhname Sep 26, 2019
@yuth
Copy link
Contributor

yuth commented Sep 26, 2019

Codegen does not expose the enums. I am adding this to our back log and we will work on this once the product team prioritize this.

@yuth yuth removed their assignment Sep 26, 2019
@lukeramsden
Copy link

Is there an update on this? Haven't got round to using my enums on the client side but I just checked my generated TypeScript definitions and they seem to be there:

export enum Platform {
  IOS = "IOS",
  ANDROID = "ANDROID",
}

Has this been implemented and the issue just not closed, or is there still an issue with using enums that I haven't yet encountered?

@AaronZyLee AaronZyLee transferred this issue from aws-amplify/amplify-cli Jan 27, 2021
@AaronZyLee AaronZyLee added doc-gen Issues on graphql-doc-generator feature-request New feature or request labels Jan 27, 2021
@phani-srikar
Copy link
Contributor

This is possibly a duplicate of #35. Closing this in favor of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-gen Issues on graphql-doc-generator feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants