-
-
Notifications
You must be signed in to change notification settings - Fork 228
Add ability to specify local mock file #13
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
Comments
Great idea 👍
// Imagine this function does something more exciting
export const jiraIssue = (prefix, min, max) => prefix + '-' + randomInt(min, max) However, I would treat this feature only as the last resort for the cases when you have something very specific to you project. |
Specific metadata from git, jira, jenkins currently. I've actually got functions that already generate this sort of data for my tests anyway, so all I'd need to do is hook it up. I agree with your recommended changes. My try my hand at a PR tonight. |
@zephraph Would be great ❤️, just create PR when you will have proof of concept. |
Yeah I see the use case where you need a constant predicted result, this might be useful for writing unit tests. Any progress on that @zephraph ? |
@kuncevic If you interested in just having predictable results for existing |
@IvanGoncharov I am just not sure if having specifying the seed will cover all the use cases or does it? |
@kuncevic As I wrote before I totally for this feature, but I would like this feature to be used only as the last resort for the cases when you have something very specific to your project.
If you just want to get the same result for the same query than having the ability to provide seed for the entire query could be a better solution. But if you want to have different queries to return subselections from the same data then it's a completely different story. |
Any news on this? It would be really interesting to be able to call a custom function to generate mock data for |
First off, this project is amazing. It's extremely useful for bootstrapping an app before the graphql server exists.
The faker methods are extremely useful, but I'm finding myself wishing I could run custom code to generate what I need in certain scenarios.
What if there was something like this
schema.faker.graphql
graphql-faker-mocks.js
The semantics here might not be great. It could be a separate directive or the parameters could be different. Ultimately the idea is just to be able to custom mocks.
The text was updated successfully, but these errors were encountered: