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

How to get a random value from an ENUM? #56

Closed
sneko opened this issue Oct 3, 2018 · 1 comment
Closed

How to get a random value from an ENUM? #56

sneko opened this issue Oct 3, 2018 · 1 comment
Labels

Comments

@sneko
Copy link

sneko commented Oct 3, 2018

Hi!

I would like to fake the following type field:

type Phone {
  type: PhoneType @fake(???????????????)
  ...
}

enum PhoneType {
  HOME
  MOBILE
}

And I was wondering if your library is able to randomly choose one value of the ENUM without me writing anything? Or should I have to write:

  type: PhoneType @examples(values: ["HOME", "MOBILE"])

Thank you,

@IvanGoncharov
Copy link
Member

And I was wondering if your library is able to randomly choose one value of the ENUM without me writing anything?

@sneko You don't need to specify @fake or @example everything should work by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants