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

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

Open
peniqliotuv opened this issue Mar 1, 2023 · 2 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@peniqliotuv
Copy link

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?

@newhouse
Copy link
Collaborator

newhouse commented Mar 2, 2023

duplicate of #646

@newhouse newhouse self-assigned this Mar 2, 2023
@newhouse newhouse added the duplicate This issue or pull request already exists label Mar 2, 2023
@newhouse
Copy link
Collaborator

newhouse commented May 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants