Commit
-Hard code field name that can return null -Added hardcoded CORS
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
logs | ||
*.log | ||
npm-debug.log* | ||
.idea | ||
|
||
# Runtime data | ||
pids | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,9 @@ export function fakeSchema(schema) { | |
} | ||
|
||
function getResolver(type:GraphQLOutputType, field) { | ||
if (field.name === 'currentOpenEnrollment' && getRandomInt(0, 10) < 5) { | ||
return () => null | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
williamcabrera4
Author
Owner
|
||
if (type instanceof GraphQLNonNull) | ||
return getResolver(type.ofType, field); | ||
if (type instanceof GraphQLList) | ||
|
Hi @williamcabrera4
I'm the author of
graphql-faker
and I just saw your fork.And I'm trying to understand your use-case and how to better incorporate it in
graphql-faker
.Do you need such functionality for every non-null field or only
currentOpenEnrollment
?