mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 09:36:44 +03:00
Use Undefined instead of the now deprecated INVALID (#1143)
This commit is contained in:
parent
ba5b7dd3d7
commit
ac98be7836
|
@ -3,7 +3,7 @@ from __future__ import absolute_import
|
|||
import datetime
|
||||
|
||||
from aniso8601 import parse_date, parse_datetime, parse_time
|
||||
from graphql.error import INVALID
|
||||
from graphql import Undefined
|
||||
from graphql.language import StringValueNode
|
||||
|
||||
from .scalars import Scalar
|
||||
|
@ -38,7 +38,7 @@ class Date(Scalar):
|
|||
elif isinstance(value, str):
|
||||
return parse_date(value)
|
||||
except ValueError:
|
||||
return INVALID
|
||||
return Undefined
|
||||
|
||||
|
||||
class DateTime(Scalar):
|
||||
|
@ -68,7 +68,7 @@ class DateTime(Scalar):
|
|||
elif isinstance(value, str):
|
||||
return parse_datetime(value)
|
||||
except ValueError:
|
||||
return INVALID
|
||||
return Undefined
|
||||
|
||||
|
||||
class Time(Scalar):
|
||||
|
@ -98,4 +98,4 @@ class Time(Scalar):
|
|||
elif isinstance(value, str):
|
||||
return parse_time(value)
|
||||
except ValueError:
|
||||
return INVALID
|
||||
return Undefined
|
||||
|
|
Loading…
Reference in New Issue
Block a user