Skip to content

Commit

Permalink
Fix query filter in ENUM types (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
emiacc authored Jun 1, 2021
1 parent f73c3c8 commit 600c1d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,9 @@ const buildQueryTerms = async (filterField, qlField, fieldName) => {
fieldType = qlField.type.ofType;
}
if (fieldType instanceof GraphQLScalarType
|| isNonNullOfType(fieldType, GraphQLScalarType)) {
|| isNonNullOfType(fieldType, GraphQLScalarType)
|| fieldType instanceof GraphQLEnumType
|| isNonNullOfType(fieldType, GraphQLEnumType)) {
if (fieldType.name === 'DateTime') {
if (Array.isArray(filterField.value)) {
filterField.value = filterField.value.map((value) => value && new Date(value));
Expand Down

0 comments on commit 600c1d1

Please sign in to comment.