Values from @example should be used as exact values
See original GitHub issueReported by @sepehr500 in #25
Currently, if want to fake a string, I do the following
type CourtCase {
jurisdiction: String @examples(values: ["DFT", "FUR"])
}
This makes the think that values
expects it’s value to be an array of whatever the property type is. So it would follow, that if the type was the following,
type CourtCase {
jurisdiction: [String] @examples(values: [["DFT", "FUR"],["DFS","DNA"])
}
Since the property type is now an array of strings, it would make sense to pass in an array of strings into the array to match the return type. So if we take this same logic an apply it to Objects, then we would expect a property that has a type that is an array of objects, to look like the following,
type Query {
allCourtCases: [CourtCase!]!
@examples(values: [[{state: "WASH", capital: "SEA"},{state: "VA", capital: "RMD"}], [{state:"VA"}]])
}
This way, you have a consistent rule that values
always expects an array of whatever type the return type of the property is.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Values from @example should be used as exact values #26
@sepehr500 Problem is that there are two types of scenarios I want to mock. Field that returns: exact array. random array consisting from ......
Read more >4.2 - Finding Exact Values (Examples) - YouTube
4.2 - Finding Exact Values ( Examples ) · Key moments. View all · Key moments · Description · Key moments. View all...
Read more >Lesson Explainer: Exact Values of Trigonometric Ratios - Nagwa
In this explainer, we will learn how to find the exact value of a trigonometric function for radian angles.
Read more >EXACT Function - Formula, Examples, How To Use EXACT
The function helps to test if two or more than two supplied text strings or values are exactly equal and, if so, returns...
Read more >CH 9 - 1 Flashcards - Quizlet
An appraisal is defined as an estimate or an opinion of value. Real estate appraisals are needed to do the following: 1. Set...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I was just wondering if this was something you still plan to add as part of the version
2.0.0
release? It would be great to specify an exact array to return, for example:Then running the query:
always returns the array [“A”, “B”, “C”] in that order. Thanks!
@sepehr500 Thank you for suggestions 👍 Right now working on a new GraphQL project, so will put this issue on hold. But after releasing it I will try to iterate on this and other issues and release version
2.0.0
.