graphql-kit / graphql-faker

🎲 Mock or extend your GraphQL API with faked data. No coding required.
MIT License
2.68k stars 225 forks source link

How to fake simple number with a static prefix? #157

Open dguay opened 2 years ago

dguay commented 2 years ago

What would be the best way to generate random number but with a certain prefix?

Example: I want to generate id with "P" prefix like "P123", "P4123", etc...

Is there a clever way to do this?

I'd think something could have worked:

id:String! @fake(type: number, options: {prefix: "P"})