anvilco/spectaql

Feature request - don't randomly choose between scalars when generating examples

peniqliotuv opened this issue · 2 comments

First off, thanks for creating such a great tool. spectaql is a core part of our doc generation pipeline.
We're making a lot of changes to our API, and we're finding that there's a lot of noise generated by the constant flip-flopping between scalars that are automatically generated (see:

const SCALAR_TO_EXAMPLE = {
String: ['abc123', 'xyz789'],
Int: [123, 987],
Float: [123.45, 987.65],
Boolean: [true, false],
Date: [
new Date(),
new Date(new Date().setMonth(new Date().getMonth() - 6).valueOf()),
].map((date) => date.toISOString()),
DateTime: [
new Date(),
new Date(new Date().setMonth(new Date().getMonth() - 6).valueOf()),
].map((date) => date.toISOString()),
JSON: SPECIAL_TAG + '{}' + SPECIAL_TAG,
ID: [4, '4'],
}
).

Would it be possible to enable a configuration flag on the spectaql config that ensures stable example generation?

duplicate of #646

This will be the first thing I work on next, most likely...