docs: Correct the module name of custom scalar example in documentation (#1486)

This commit is contained in:
Pei-Lun H 2022-12-23 14:57:45 +08:00 committed by GitHub
parent 340d5ed12f
commit 8eb2807ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,7 @@ The following is an example for creating a DateTime scalar:
@staticmethod @staticmethod
def parse_literal(node, _variables=None): def parse_literal(node, _variables=None):
if isinstance(node, ast.StringValue): if isinstance(node, ast.StringValueNode):
return datetime.datetime.strptime( return datetime.datetime.strptime(
node.value, "%Y-%m-%dT%H:%M:%S.%f") node.value, "%Y-%m-%dT%H:%M:%S.%f")