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 handle multiple types #161

Open
aliceclv opened this issue Mar 22, 2022 · 1 comment
Open

How to handle multiple types #161

aliceclv opened this issue Mar 22, 2022 · 1 comment

Comments

@aliceclv
Copy link

How would you normally handle a parameter that has multiple types?
I have a hash, containing a key channel_id that can be either string or integer.

Thanks a lot for your help 🙏 !

hash :setup do
  integer :channel_id
  string :channel_id
end
@MyklClason
Copy link

If it's an integer in a stringformat just use integer. Otherwise take a look at this page:
https://github.com/cypriss/mutations/wiki/Filtering-Input

Alternatively, you may need to add your own custom type, would be nice if the docs included how to go about that though without digging into the codebase.

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

No branches or pull requests

2 participants