prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  If value from resolver is callable, call it with **kwargs.
  [Apollo doc](https://www.apollographql.com/docs/graphql-tools/resolvers) for default resolver says that if `field_name` resolves to function, it will be called with query arguments:
  
  > Calls a function on obj with the relevant field name and passes the query arguments into that function
  
  This can be useful for situations when parent resolver returned an object with getter functions.
  
  --- 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_functions_to_scalar(type_name, type_object, resolvers)
  28 
  29 
  30 def add_resolve_functions_to_object(name: str, obj: GraphQLObjectType, resolvers: dict):
  31     type_resolvers = resolvers.get(name, {})
  32     for field_name, field_object in obj.fields.items():
  33         field_resolver = type_resolvers.get(field_name)
  34         if field_resolver:
  35             field_object.resolver = field_resolver
  36         elif field_object.resolver is None:
  37             field_object.resolver = default_resolver
  38 
  39 
  40 def add_resolve_functions_to_scalar(name: str, obj: GraphQLObjectType, resolvers: dict):
  41     scalar_resolvers = resolvers.get(name, {})
  42 
  43     serialize = scalar_resolvers.get("serialize", obj.serialize)
  44     obj.serialize = serialize
  45 
  46     parse_literal = scalar_resolvers.get("parse_literal", obj.parse_literal)
  47     obj.parse_literal = parse_literal
  48 
  49     parse_value = scalar_resolvers.get("parse_value", obj.parse_value)
  50     obj.parse_value = parse_value
  51
  ```
  --- 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
  @@ -2,19 +2,23 @@
   from graphql.execution.base import ResolveInfo
   
   
  -def resolve_parent_field(parent, name: str):
  +def resolve_parent_field(parent, name: str, **kwargs: dict):
       if isinstance(parent, dict):
  -        return parent.get(name)
  -    return getattr(parent, name, None)
  +        value = parent.get(name)
  +    else:
  +        value = getattr(parent, name, None)
  +    if callable(value):
  +        return value(**kwargs)
  +    return value
   
   
  -def default_resolver(parent, info: ResolveInfo):
  -    return resolve_parent_field(parent, info.field_name)
  +def default_resolver(parent, info: ResolveInfo, **kwargs):
  +    return resolve_parent_field(parent, info.field_name, **kwargs)
   
   
   def resolve_to(name: str):
  -    def resolver(parent, *_):
  -        return resolve_parent_field(parent, name)
  +    def resolver(parent, *_, **kwargs):
  +        return resolve_parent_field(parent, name, **kwargs)
   
       return resolver
  
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@@ -2,19 +2,23 @@\n from graphql.execution.base import ResolveInfo\n \n \n-def resolve_parent_field(parent, name: str):\n+def resolve_parent_field(parent, name: str, **kwargs: dict):\n     if isinstance(parent, dict):\n-        return parent.get(name)\n-    return getattr(parent, name, None)\n+        value = parent.get(name)\n+    else:\n+        value = getattr(parent, name, None)\n+    if callable(value):\n+        return value(**kwargs)\n+    return value\n \n \n-def default_resolver(parent, info: ResolveInfo):\n-    return resolve_parent_field(parent, info.field_name)\n+def default_resolver(parent, info: ResolveInfo, **kwargs):\n+    return resolve_parent_field(parent, info.field_name, **kwargs)\n \n \n def resolve_to(name: str):\n-    def resolver(parent, *_):\n-        return resolve_parent_field(parent, name)\n+    def resolver(parent, *_, **kwargs):\n+        return resolve_parent_field(parent, name, **kwargs)\n \n     return resolver\n", "issue": "If value from resolver is callable, call it with **kwargs.\n[Apollo doc](https://www.apollographql.com/docs/graphql-tools/resolvers) for default resolver says that if `field_name` resolves to function, it will be called with query arguments:\r\n\r\n> Calls a function on obj with the relevant field name and passes the query arguments into that function\r\n\r\nThis can be useful for situations when parent resolver returned an object with getter functions.\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_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)\n        if field_resolver:\n            field_object.resolver = field_resolver\n        elif field_object.resolver is None:\n            field_object.resolver = default_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"}], "after_files": [{"content": "from graphql import GraphQLObjectType, GraphQLScalarType, GraphQLSchema\nfrom graphql.execution.base import ResolveInfo\n\n\ndef resolve_parent_field(parent, name: str, **kwargs: dict):\n    if isinstance(parent, dict):\n        value = parent.get(name)\n    else:\n        value = getattr(parent, name, None)\n    if callable(value):\n        return value(**kwargs)\n    return value\n\n\ndef default_resolver(parent, info: ResolveInfo, **kwargs):\n    return resolve_parent_field(parent, info.field_name, **kwargs)\n\n\ndef resolve_to(name: str):\n    def resolver(parent, *_, **kwargs):\n        return resolve_parent_field(parent, name, **kwargs)\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)\n        if field_resolver:\n            field_object.resolver = field_resolver\n        elif field_object.resolver is None:\n            field_object.resolver = default_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"}]}