File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def test_uuidstring_invalid_argument():
47
47
assert len (result .errors ) == 1
48
48
assert (
49
49
result .errors [0 ].message
50
- == "Variable '$uuid' got invalid value {'not': 'a string'}; UUID must be a string"
50
+ == "Variable '$uuid' got invalid value {'not': 'a string'}; UUID cannot represent value: {'not': ' a string'} "
51
51
)
52
52
53
53
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ def parse_literal(node, _variables=None):
29
29
30
30
@staticmethod
31
31
def parse_value (value ):
32
- if not isinstance (value , (str , _UUID )):
33
- raise GraphQLError ("UUID must be a string" )
34
- return _UUID (value )
32
+ if isinstance (value , _UUID ):
33
+ return value
34
+ try :
35
+ return _UUID (value )
36
+ except (ValueError , AttributeError ):
37
+ raise GraphQLError (f"UUID cannot represent value: { repr (value )} " )
You can’t perform that action at this time.
0 commit comments