prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Exception in default_literal_parser() when ValueNode has no "value" member
  The [default_literal_parser() function](https://github.com/mirumee/ariadne/blob/master/ariadne/scalars.py#L90) in ariadne.scalars expects nodes to have a "value" member.  However, this is not the case with, for example, `ObjectValueNode` or `ListValueNode`.  This causes an exception when trying to pass such nodes.
  
  My suggestion is to use `graphql.utilities.value_from_ast_untyped` instead:
  ```
  return value_parser(value_from_ast_untyped(ast))
  ``` 
  
  I'm happy to do a PR if you guys like this change.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `ariadne/scalars.py`
  Content:
  ```
  1 from typing import Optional, cast
  2 
  3 from graphql.language.ast import (
  4     BooleanValueNode,
  5     FloatValueNode,
  6     IntValueNode,
  7     StringValueNode,
  8 )
  9 from graphql.type import (
  10     GraphQLNamedType,
  11     GraphQLScalarLiteralParser,
  12     GraphQLScalarSerializer,
  13     GraphQLScalarType,
  14     GraphQLScalarValueParser,
  15     GraphQLSchema,
  16 )
  17 
  18 from .types import SchemaBindable
  19 
  20 
  21 class ScalarType(SchemaBindable):
  22     _serialize: Optional[GraphQLScalarSerializer]
  23     _parse_value: Optional[GraphQLScalarValueParser]
  24     _parse_literal: Optional[GraphQLScalarLiteralParser]
  25 
  26     def __init__(
  27         self,
  28         name: str,
  29         *,
  30         serializer: GraphQLScalarSerializer = None,
  31         value_parser: GraphQLScalarValueParser = None,
  32         literal_parser: GraphQLScalarLiteralParser = None,
  33     ) -> None:
  34         self.name = name
  35         self._serialize = serializer
  36         self._parse_value = value_parser
  37         self._parse_literal = literal_parser
  38 
  39     def set_serializer(self, f: GraphQLScalarSerializer) -> GraphQLScalarSerializer:
  40         self._serialize = f
  41         return f
  42 
  43     def set_value_parser(self, f: GraphQLScalarValueParser) -> GraphQLScalarValueParser:
  44         self._parse_value = f
  45         if not self._parse_literal:
  46             self._parse_literal = create_default_literal_parser(f)
  47         return f
  48 
  49     def set_literal_parser(
  50         self, f: GraphQLScalarLiteralParser
  51     ) -> GraphQLScalarLiteralParser:
  52         self._parse_literal = f
  53         return f
  54 
  55     # Alias above setters for consistent decorator API
  56     serializer = set_serializer
  57     value_parser = set_value_parser
  58     literal_parser = set_literal_parser
  59 
  60     def bind_to_schema(self, schema: GraphQLSchema) -> None:
  61         graphql_type = schema.type_map.get(self.name)
  62         self.validate_graphql_type(graphql_type)
  63         graphql_type = cast(GraphQLScalarType, graphql_type)
  64 
  65         if self._serialize:
  66             # See mypy bug https://github.com/python/mypy/issues/2427
  67             graphql_type.serialize = self._serialize  # type: ignore
  68         if self._parse_value:
  69             graphql_type.parse_value = self._parse_value  # type: ignore
  70         if self._parse_literal:
  71             graphql_type.parse_literal = self._parse_literal  # type: ignore
  72 
  73     def validate_graphql_type(self, graphql_type: Optional[GraphQLNamedType]) -> None:
  74         if not graphql_type:
  75             raise ValueError("Scalar %s is not defined in the schema" % self.name)
  76         if not isinstance(graphql_type, GraphQLScalarType):
  77             raise ValueError(
  78                 "%s is defined in the schema, but it is instance of %s (expected %s)"
  79                 % (self.name, type(graphql_type).__name__, GraphQLScalarType.__name__)
  80             )
  81 
  82 
  83 SCALAR_AST_NODES = (BooleanValueNode, FloatValueNode, IntValueNode, StringValueNode)
  84 
  85 
  86 def create_default_literal_parser(
  87     value_parser: GraphQLScalarValueParser,
  88 ) -> GraphQLScalarLiteralParser:
  89     def default_literal_parser(ast):
  90         return value_parser(ast.value)
  91 
  92     return default_literal_parser
  93
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/ariadne/scalars.py b/ariadne/scalars.py
  --- a/ariadne/scalars.py
  +++ b/ariadne/scalars.py
  @@ -14,6 +14,7 @@
       GraphQLScalarValueParser,
       GraphQLSchema,
   )
  +from graphql.utilities import value_from_ast_untyped
   
   from .types import SchemaBindable
   
  @@ -87,6 +88,6 @@
       value_parser: GraphQLScalarValueParser,
   ) -> GraphQLScalarLiteralParser:
       def default_literal_parser(ast):
  -        return value_parser(ast.value)
  +        return value_parser(value_from_ast_untyped(ast))
   
       return default_literal_parser
  
verification_info: {"golden_diff": "diff --git a/ariadne/scalars.py b/ariadne/scalars.py\n--- a/ariadne/scalars.py\n+++ b/ariadne/scalars.py\n@@ -14,6 +14,7 @@\n     GraphQLScalarValueParser,\n     GraphQLSchema,\n )\n+from graphql.utilities import value_from_ast_untyped\n \n from .types import SchemaBindable\n \n@@ -87,6 +88,6 @@\n     value_parser: GraphQLScalarValueParser,\n ) -> GraphQLScalarLiteralParser:\n     def default_literal_parser(ast):\n-        return value_parser(ast.value)\n+        return value_parser(value_from_ast_untyped(ast))\n \n     return default_literal_parser\n", "issue": "Exception in default_literal_parser() when ValueNode has no \"value\" member\nThe [default_literal_parser() function](https://github.com/mirumee/ariadne/blob/master/ariadne/scalars.py#L90) in ariadne.scalars expects nodes to have a \"value\" member.  However, this is not the case with, for example, `ObjectValueNode` or `ListValueNode`.  This causes an exception when trying to pass such nodes.\r\n\r\nMy suggestion is to use `graphql.utilities.value_from_ast_untyped` instead:\r\n```\r\nreturn value_parser(value_from_ast_untyped(ast))\r\n``` \r\n\r\nI'm happy to do a PR if you guys like this change.\n", "before_files": [{"content": "from typing import Optional, cast\n\nfrom graphql.language.ast import (\n    BooleanValueNode,\n    FloatValueNode,\n    IntValueNode,\n    StringValueNode,\n)\nfrom graphql.type import (\n    GraphQLNamedType,\n    GraphQLScalarLiteralParser,\n    GraphQLScalarSerializer,\n    GraphQLScalarType,\n    GraphQLScalarValueParser,\n    GraphQLSchema,\n)\n\nfrom .types import SchemaBindable\n\n\nclass ScalarType(SchemaBindable):\n    _serialize: Optional[GraphQLScalarSerializer]\n    _parse_value: Optional[GraphQLScalarValueParser]\n    _parse_literal: Optional[GraphQLScalarLiteralParser]\n\n    def __init__(\n        self,\n        name: str,\n        *,\n        serializer: GraphQLScalarSerializer = None,\n        value_parser: GraphQLScalarValueParser = None,\n        literal_parser: GraphQLScalarLiteralParser = None,\n    ) -> None:\n        self.name = name\n        self._serialize = serializer\n        self._parse_value = value_parser\n        self._parse_literal = literal_parser\n\n    def set_serializer(self, f: GraphQLScalarSerializer) -> GraphQLScalarSerializer:\n        self._serialize = f\n        return f\n\n    def set_value_parser(self, f: GraphQLScalarValueParser) -> GraphQLScalarValueParser:\n        self._parse_value = f\n        if not self._parse_literal:\n            self._parse_literal = create_default_literal_parser(f)\n        return f\n\n    def set_literal_parser(\n        self, f: GraphQLScalarLiteralParser\n    ) -> GraphQLScalarLiteralParser:\n        self._parse_literal = f\n        return f\n\n    # Alias above setters for consistent decorator API\n    serializer = set_serializer\n    value_parser = set_value_parser\n    literal_parser = set_literal_parser\n\n    def bind_to_schema(self, schema: GraphQLSchema) -> None:\n        graphql_type = schema.type_map.get(self.name)\n        self.validate_graphql_type(graphql_type)\n        graphql_type = cast(GraphQLScalarType, graphql_type)\n\n        if self._serialize:\n            # See mypy bug https://github.com/python/mypy/issues/2427\n            graphql_type.serialize = self._serialize  # type: ignore\n        if self._parse_value:\n            graphql_type.parse_value = self._parse_value  # type: ignore\n        if self._parse_literal:\n            graphql_type.parse_literal = self._parse_literal  # type: ignore\n\n    def validate_graphql_type(self, graphql_type: Optional[GraphQLNamedType]) -> None:\n        if not graphql_type:\n            raise ValueError(\"Scalar %s is not defined in the schema\" % self.name)\n        if not isinstance(graphql_type, GraphQLScalarType):\n            raise ValueError(\n                \"%s is defined in the schema, but it is instance of %s (expected %s)\"\n                % (self.name, type(graphql_type).__name__, GraphQLScalarType.__name__)\n            )\n\n\nSCALAR_AST_NODES = (BooleanValueNode, FloatValueNode, IntValueNode, StringValueNode)\n\n\ndef create_default_literal_parser(\n    value_parser: GraphQLScalarValueParser,\n) -> GraphQLScalarLiteralParser:\n    def default_literal_parser(ast):\n        return value_parser(ast.value)\n\n    return default_literal_parser\n", "path": "ariadne/scalars.py"}], "after_files": [{"content": "from typing import Optional, cast\n\nfrom graphql.language.ast import (\n    BooleanValueNode,\n    FloatValueNode,\n    IntValueNode,\n    StringValueNode,\n)\nfrom graphql.type import (\n    GraphQLNamedType,\n    GraphQLScalarLiteralParser,\n    GraphQLScalarSerializer,\n    GraphQLScalarType,\n    GraphQLScalarValueParser,\n    GraphQLSchema,\n)\nfrom graphql.utilities import value_from_ast_untyped\n\nfrom .types import SchemaBindable\n\n\nclass ScalarType(SchemaBindable):\n    _serialize: Optional[GraphQLScalarSerializer]\n    _parse_value: Optional[GraphQLScalarValueParser]\n    _parse_literal: Optional[GraphQLScalarLiteralParser]\n\n    def __init__(\n        self,\n        name: str,\n        *,\n        serializer: GraphQLScalarSerializer = None,\n        value_parser: GraphQLScalarValueParser = None,\n        literal_parser: GraphQLScalarLiteralParser = None,\n    ) -> None:\n        self.name = name\n        self._serialize = serializer\n        self._parse_value = value_parser\n        self._parse_literal = literal_parser\n\n    def set_serializer(self, f: GraphQLScalarSerializer) -> GraphQLScalarSerializer:\n        self._serialize = f\n        return f\n\n    def set_value_parser(self, f: GraphQLScalarValueParser) -> GraphQLScalarValueParser:\n        self._parse_value = f\n        if not self._parse_literal:\n            self._parse_literal = create_default_literal_parser(f)\n        return f\n\n    def set_literal_parser(\n        self, f: GraphQLScalarLiteralParser\n    ) -> GraphQLScalarLiteralParser:\n        self._parse_literal = f\n        return f\n\n    # Alias above setters for consistent decorator API\n    serializer = set_serializer\n    value_parser = set_value_parser\n    literal_parser = set_literal_parser\n\n    def bind_to_schema(self, schema: GraphQLSchema) -> None:\n        graphql_type = schema.type_map.get(self.name)\n        self.validate_graphql_type(graphql_type)\n        graphql_type = cast(GraphQLScalarType, graphql_type)\n\n        if self._serialize:\n            # See mypy bug https://github.com/python/mypy/issues/2427\n            graphql_type.serialize = self._serialize  # type: ignore\n        if self._parse_value:\n            graphql_type.parse_value = self._parse_value  # type: ignore\n        if self._parse_literal:\n            graphql_type.parse_literal = self._parse_literal  # type: ignore\n\n    def validate_graphql_type(self, graphql_type: Optional[GraphQLNamedType]) -> None:\n        if not graphql_type:\n            raise ValueError(\"Scalar %s is not defined in the schema\" % self.name)\n        if not isinstance(graphql_type, GraphQLScalarType):\n            raise ValueError(\n                \"%s is defined in the schema, but it is instance of %s (expected %s)\"\n                % (self.name, type(graphql_type).__name__, GraphQLScalarType.__name__)\n            )\n\n\nSCALAR_AST_NODES = (BooleanValueNode, FloatValueNode, IntValueNode, StringValueNode)\n\n\ndef create_default_literal_parser(\n    value_parser: GraphQLScalarValueParser,\n) -> GraphQLScalarLiteralParser:\n    def default_literal_parser(ast):\n        return value_parser(value_from_ast_untyped(ast))\n\n    return default_literal_parser\n", "path": "ariadne/scalars.py"}]}