graphql-codegen-typescript-mock-data icon indicating copy to clipboard operation
graphql-codegen-typescript-mock-data copied to clipboard

Create a value based on the key name

Open liorpevzner opened this issue 1 year ago • 0 comments

Hi got a question. Is it possible or maybe a future feature to add GeneratorOptions based on the key name? for example if I have an type type User { userId: String! }

when the mock will be generated for the User, userId will be mapped to a random string. Is it possible to check if the key has a certain regex inside of it and generate a faker based response? I understand that userId should be defined as an ID and that can solve my problems, buy maybe thats a useful feature anyway.

liorpevzner avatar Jan 25 '24 12:01 liorpevzner