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

Support faker for custom scalars

Open ardeois opened this issue 2 years ago • 1 comments

scalars option allows to use custom generator function from casual

Now we have generateLibrary supporting faker, we should allow custom generator functions from faker as well

ardeois avatar Sep 29 '22 19:09 ardeois

memo:

  • casual is only one level with property calls, like this: country => casual["country"] // 'United Kingdom'
    • Some generators may be function calls that specify arguments: integer => integer(from = -1000, to = 1000) // 632
  • faker is a nested and method chain: faker.address.country() // 'Greece'

This is an interface similar to casual 🤔 : address.country => faker["address"]["country"]()

MH4GF avatar Sep 30 '22 03:09 MH4GF

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 30 '22 07:10 stale[bot]