prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  `add_resolve_functions_to_schema` should support Scalars parse_value and parse_literal
  Currently Ariadne Scalar support is limited to serializing python types to JSON before returning them to client, but we also want to support using custom scalars for input.
  
  Our `add_resolve_functions_to_scalar` utility could support following use-cases:
  
  Code below results in one-way only scalar:
  
  - `type_defs = {'Scalar': {'serialize': callable}}`
  
  And this code results in two-way scalar:
  
  - `type_defs = {'Scalar': {'serialize': callable, 'parse_value': callable, 'parse_literal': callable}}` - explicit syntax for two-directional scalar.
  
  
  --- 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/resolvers.py`
  Content:
  ```
  1 from graphql import GraphQLObjectType, GraphQLScalarType, GraphQLSchema
  2 from graphql.execution.base import ResolveInfo
  3 
  4 
  5 def resolve_parent_field(parent, name: str):
  6     if isinstance(parent, dict):
  7         return parent.get(name)
  8     return getattr(parent, name, None)
  9 
  10 
  11 def default_resolver(parent, info: ResolveInfo):
  12     return resolve_parent_field(parent, info.field_name)
  13 
  14 
  15 def resolve_to(name: str):
  16     def resolver(parent, *_):
  17         return resolve_parent_field(parent, name)
  18 
  19     return resolver
  20 
  21 
  22 def add_resolve_functions_to_schema(schema: GraphQLSchema, resolvers: dict):
  23     for type_name, type_object in schema.get_type_map().items():
  24         if isinstance(type_object, GraphQLObjectType):
  25             add_resolve_functions_to_object(type_name, type_object, resolvers)
  26         if isinstance(type_object, GraphQLScalarType):
  27             add_resolve_function_to_scalar(type_name, type_object, resolvers)
  28 
  29 
  30 def add_resolve_functions_to_object(name: str, obj: GraphQLObjectType, resolvers: dict):
  31     type_resolver = resolvers.get(name, {})
  32     for field_name, field_object in obj.fields.items():
  33         field_resolver = type_resolver.get(field_name, default_resolver)
  34         field_object.resolver = field_resolver
  35 
  36 
  37 def add_resolve_function_to_scalar(name: str, obj: GraphQLObjectType, resolvers: dict):
  38     serializer = resolvers.get(name, obj.serialize)
  39     obj.serialize = serializer
  40
  ```
  --- 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/resolvers.py b/ariadne/resolvers.py
  --- a/ariadne/resolvers.py
  +++ b/ariadne/resolvers.py
  @@ -24,16 +24,24 @@
           if isinstance(type_object, GraphQLObjectType):
               add_resolve_functions_to_object(type_name, type_object, resolvers)
           if isinstance(type_object, GraphQLScalarType):
  -            add_resolve_function_to_scalar(type_name, type_object, resolvers)
  +            add_resolve_functions_to_scalar(type_name, type_object, resolvers)
   
   
   def add_resolve_functions_to_object(name: str, obj: GraphQLObjectType, resolvers: dict):
  -    type_resolver = resolvers.get(name, {})
  +    type_resolvers = resolvers.get(name, {})
       for field_name, field_object in obj.fields.items():
  -        field_resolver = type_resolver.get(field_name, default_resolver)
  +        field_resolver = type_resolvers.get(field_name, default_resolver)
           field_object.resolver = field_resolver
   
   
  -def add_resolve_function_to_scalar(name: str, obj: GraphQLObjectType, resolvers: dict):
  -    serializer = resolvers.get(name, obj.serialize)
  -    obj.serialize = serializer
  +def add_resolve_functions_to_scalar(name: str, obj: GraphQLObjectType, resolvers: dict):
  +    scalar_resolvers = resolvers.get(name, {})
  +
  +    serialize = scalar_resolvers.get("serialize", obj.serialize)
  +    obj.serialize = serialize
  +
  +    parse_literal = scalar_resolvers.get("parse_literal", obj.parse_literal)
  +    obj.parse_literal = parse_literal
  +
  +    parse_value = scalar_resolvers.get("parse_value", obj.parse_value)
  +    obj.parse_value = parse_value
  
verification_info: {"golden_diff": "diff --git a/ariadne/resolvers.py b/ariadne/resolvers.py\n--- a/ariadne/resolvers.py\n+++ b/ariadne/resolvers.py\n@@ -24,16 +24,24 @@\n         if isinstance(type_object, GraphQLObjectType):\n             add_resolve_functions_to_object(type_name, type_object, resolvers)\n         if isinstance(type_object, GraphQLScalarType):\n-            add_resolve_function_to_scalar(type_name, type_object, resolvers)\n+            add_resolve_functions_to_scalar(type_name, type_object, resolvers)\n \n \n def add_resolve_functions_to_object(name: str, obj: GraphQLObjectType, resolvers: dict):\n-    type_resolver = resolvers.get(name, {})\n+    type_resolvers = resolvers.get(name, {})\n     for field_name, field_object in obj.fields.items():\n-        field_resolver = type_resolver.get(field_name, default_resolver)\n+        field_resolver = type_resolvers.get(field_name, default_resolver)\n         field_object.resolver = field_resolver\n \n \n-def add_resolve_function_to_scalar(name: str, obj: GraphQLObjectType, resolvers: dict):\n-    serializer = resolvers.get(name, obj.serialize)\n-    obj.serialize = serializer\n+def add_resolve_functions_to_scalar(name: str, obj: GraphQLObjectType, resolvers: dict):\n+    scalar_resolvers = resolvers.get(name, {})\n+\n+    serialize = scalar_resolvers.get(\"serialize\", obj.serialize)\n+    obj.serialize = serialize\n+\n+    parse_literal = scalar_resolvers.get(\"parse_literal\", obj.parse_literal)\n+    obj.parse_literal = parse_literal\n+\n+    parse_value = scalar_resolvers.get(\"parse_value\", obj.parse_value)\n+    obj.parse_value = parse_value\n", "issue": "`add_resolve_functions_to_schema` should support Scalars parse_value and parse_literal\nCurrently Ariadne Scalar support is limited to serializing python types to JSON before returning them to client, but we also want to support using custom scalars for input.\r\n\r\nOur `add_resolve_functions_to_scalar` utility could support following use-cases:\r\n\r\nCode below results in one-way only scalar:\r\n\r\n- `type_defs = {'Scalar': {'serialize': callable}}`\r\n\r\nAnd this code results in two-way scalar:\r\n\r\n- `type_defs = {'Scalar': {'serialize': callable, 'parse_value': callable, 'parse_literal': callable}}` - explicit syntax for two-directional scalar.\r\n\n", "before_files": [{"content": "from graphql import GraphQLObjectType, GraphQLScalarType, GraphQLSchema\nfrom graphql.execution.base import ResolveInfo\n\n\ndef resolve_parent_field(parent, name: str):\n    if isinstance(parent, dict):\n        return parent.get(name)\n    return getattr(parent, name, None)\n\n\ndef default_resolver(parent, info: ResolveInfo):\n    return resolve_parent_field(parent, info.field_name)\n\n\ndef resolve_to(name: str):\n    def resolver(parent, *_):\n        return resolve_parent_field(parent, name)\n\n    return resolver\n\n\ndef add_resolve_functions_to_schema(schema: GraphQLSchema, resolvers: dict):\n    for type_name, type_object in schema.get_type_map().items():\n        if isinstance(type_object, GraphQLObjectType):\n            add_resolve_functions_to_object(type_name, type_object, resolvers)\n        if isinstance(type_object, GraphQLScalarType):\n            add_resolve_function_to_scalar(type_name, type_object, resolvers)\n\n\ndef add_resolve_functions_to_object(name: str, obj: GraphQLObjectType, resolvers: dict):\n    type_resolver = resolvers.get(name, {})\n    for field_name, field_object in obj.fields.items():\n        field_resolver = type_resolver.get(field_name, default_resolver)\n        field_object.resolver = field_resolver\n\n\ndef add_resolve_function_to_scalar(name: str, obj: GraphQLObjectType, resolvers: dict):\n    serializer = resolvers.get(name, obj.serialize)\n    obj.serialize = serializer\n", "path": "ariadne/resolvers.py"}], "after_files": [{"content": "from graphql import GraphQLObjectType, GraphQLScalarType, GraphQLSchema\nfrom graphql.execution.base import ResolveInfo\n\n\ndef resolve_parent_field(parent, name: str):\n    if isinstance(parent, dict):\n        return parent.get(name)\n    return getattr(parent, name, None)\n\n\ndef default_resolver(parent, info: ResolveInfo):\n    return resolve_parent_field(parent, info.field_name)\n\n\ndef resolve_to(name: str):\n    def resolver(parent, *_):\n        return resolve_parent_field(parent, name)\n\n    return resolver\n\n\ndef add_resolve_functions_to_schema(schema: GraphQLSchema, resolvers: dict):\n    for type_name, type_object in schema.get_type_map().items():\n        if isinstance(type_object, GraphQLObjectType):\n            add_resolve_functions_to_object(type_name, type_object, resolvers)\n        if isinstance(type_object, GraphQLScalarType):\n            add_resolve_functions_to_scalar(type_name, type_object, resolvers)\n\n\ndef add_resolve_functions_to_object(name: str, obj: GraphQLObjectType, resolvers: dict):\n    type_resolvers = resolvers.get(name, {})\n    for field_name, field_object in obj.fields.items():\n        field_resolver = type_resolvers.get(field_name, default_resolver)\n        field_object.resolver = field_resolver\n\n\ndef add_resolve_functions_to_scalar(name: str, obj: GraphQLObjectType, resolvers: dict):\n    scalar_resolvers = resolvers.get(name, {})\n\n    serialize = scalar_resolvers.get(\"serialize\", obj.serialize)\n    obj.serialize = serialize\n\n    parse_literal = scalar_resolvers.get(\"parse_literal\", obj.parse_literal)\n    obj.parse_literal = parse_literal\n\n    parse_value = scalar_resolvers.get(\"parse_value\", obj.parse_value)\n    obj.parse_value = parse_value\n", "path": "ariadne/resolvers.py"}]}