prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add extension support to make_executable_schema issue #95
  This addresses issue #95 
  
  I have ported the logic from graphql-tools [buildSchemaFromTypeDefs](https://github.com/apollographql/graphql-tools/blob/master/src/generate/buildSchemaFromTypeDefinitions.ts#L48), which parse an ast document node then checks if there is any extension type included in the type defs. Those are pulled out and added to a new document that then uses the 'extend_schema' to extend the existing schema. 
  
  Not exactly sure how you want to organize this but this is a working first pass.
  
  Thanks!
  
  --- 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/executable_schema.py`
  Content:
  ```
  1 from typing import List, Union
  2 
  3 from graphql import GraphQLSchema, build_schema
  4 
  5 from .types import SchemaBindable
  6 
  7 
  8 def make_executable_schema(
  9     type_defs: Union[str, List[str]],
  10     bindables: Union[SchemaBindable, List[SchemaBindable], None] = None,
  11 ) -> GraphQLSchema:
  12     if isinstance(type_defs, list):
  13         type_defs = join_type_defs(type_defs)
  14 
  15     schema = build_schema(type_defs)
  16 
  17     if isinstance(bindables, list):
  18         for obj in bindables:
  19             obj.bind_to_schema(schema)
  20     elif bindables:
  21         bindables.bind_to_schema(schema)
  22 
  23     return schema
  24 
  25 
  26 def join_type_defs(type_defs: List[str]) -> str:
  27     return "\n\n".join(t.strip() for t in type_defs)
  28
  ```
  --- 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/executable_schema.py b/ariadne/executable_schema.py
  --- a/ariadne/executable_schema.py
  +++ b/ariadne/executable_schema.py
  @@ -1,6 +1,6 @@
   from typing import List, Union
   
  -from graphql import GraphQLSchema, build_schema
  +from graphql import DocumentNode, GraphQLSchema, build_ast_schema, extend_schema, parse
   
   from .types import SchemaBindable
   
  @@ -12,7 +12,8 @@
       if isinstance(type_defs, list):
           type_defs = join_type_defs(type_defs)
   
  -    schema = build_schema(type_defs)
  +    ast_document = parse(type_defs)
  +    schema = build_and_extend_schema(ast_document)
   
       if isinstance(bindables, list):
           for obj in bindables:
  @@ -25,3 +26,28 @@
   
   def join_type_defs(type_defs: List[str]) -> str:
       return "\n\n".join(t.strip() for t in type_defs)
  +
  +
  +def build_and_extend_schema(ast: DocumentNode) -> GraphQLSchema:
  +    schema = build_ast_schema(ast)
  +    extension_ast = extract_extensions(ast)
  +
  +    if extension_ast.definitions:
  +        schema = extend_schema(schema, extension_ast)
  +
  +    return schema
  +
  +
  +EXTENSION_KINDS = [
  +    "scalar_type_extension",
  +    "object_type_extension",
  +    "interface_type_extension",
  +    "union_type_extension",
  +    "enum_type_extension",
  +    "input_object_type_extension",
  +]
  +
  +
  +def extract_extensions(ast: DocumentNode) -> DocumentNode:
  +    extensions = [node for node in ast.definitions if node.kind in EXTENSION_KINDS]
  +    return DocumentNode(definitions=extensions)
  
verification_info: {"golden_diff": "diff --git a/ariadne/executable_schema.py b/ariadne/executable_schema.py\n--- a/ariadne/executable_schema.py\n+++ b/ariadne/executable_schema.py\n@@ -1,6 +1,6 @@\n from typing import List, Union\n \n-from graphql import GraphQLSchema, build_schema\n+from graphql import DocumentNode, GraphQLSchema, build_ast_schema, extend_schema, parse\n \n from .types import SchemaBindable\n \n@@ -12,7 +12,8 @@\n     if isinstance(type_defs, list):\n         type_defs = join_type_defs(type_defs)\n \n-    schema = build_schema(type_defs)\n+    ast_document = parse(type_defs)\n+    schema = build_and_extend_schema(ast_document)\n \n     if isinstance(bindables, list):\n         for obj in bindables:\n@@ -25,3 +26,28 @@\n \n def join_type_defs(type_defs: List[str]) -> str:\n     return \"\\n\\n\".join(t.strip() for t in type_defs)\n+\n+\n+def build_and_extend_schema(ast: DocumentNode) -> GraphQLSchema:\n+    schema = build_ast_schema(ast)\n+    extension_ast = extract_extensions(ast)\n+\n+    if extension_ast.definitions:\n+        schema = extend_schema(schema, extension_ast)\n+\n+    return schema\n+\n+\n+EXTENSION_KINDS = [\n+    \"scalar_type_extension\",\n+    \"object_type_extension\",\n+    \"interface_type_extension\",\n+    \"union_type_extension\",\n+    \"enum_type_extension\",\n+    \"input_object_type_extension\",\n+]\n+\n+\n+def extract_extensions(ast: DocumentNode) -> DocumentNode:\n+    extensions = [node for node in ast.definitions if node.kind in EXTENSION_KINDS]\n+    return DocumentNode(definitions=extensions)\n", "issue": "Add extension support to make_executable_schema issue #95\nThis addresses issue #95 \r\n\r\nI have ported the logic from graphql-tools [buildSchemaFromTypeDefs](https://github.com/apollographql/graphql-tools/blob/master/src/generate/buildSchemaFromTypeDefinitions.ts#L48), which parse an ast document node then checks if there is any extension type included in the type defs. Those are pulled out and added to a new document that then uses the 'extend_schema' to extend the existing schema. \r\n\r\nNot exactly sure how you want to organize this but this is a working first pass.\r\n\r\nThanks!\n", "before_files": [{"content": "from typing import List, Union\n\nfrom graphql import GraphQLSchema, build_schema\n\nfrom .types import SchemaBindable\n\n\ndef make_executable_schema(\n    type_defs: Union[str, List[str]],\n    bindables: Union[SchemaBindable, List[SchemaBindable], None] = None,\n) -> GraphQLSchema:\n    if isinstance(type_defs, list):\n        type_defs = join_type_defs(type_defs)\n\n    schema = build_schema(type_defs)\n\n    if isinstance(bindables, list):\n        for obj in bindables:\n            obj.bind_to_schema(schema)\n    elif bindables:\n        bindables.bind_to_schema(schema)\n\n    return schema\n\n\ndef join_type_defs(type_defs: List[str]) -> str:\n    return \"\\n\\n\".join(t.strip() for t in type_defs)\n", "path": "ariadne/executable_schema.py"}], "after_files": [{"content": "from typing import List, Union\n\nfrom graphql import DocumentNode, GraphQLSchema, build_ast_schema, extend_schema, parse\n\nfrom .types import SchemaBindable\n\n\ndef make_executable_schema(\n    type_defs: Union[str, List[str]],\n    bindables: Union[SchemaBindable, List[SchemaBindable], None] = None,\n) -> GraphQLSchema:\n    if isinstance(type_defs, list):\n        type_defs = join_type_defs(type_defs)\n\n    ast_document = parse(type_defs)\n    schema = build_and_extend_schema(ast_document)\n\n    if isinstance(bindables, list):\n        for obj in bindables:\n            obj.bind_to_schema(schema)\n    elif bindables:\n        bindables.bind_to_schema(schema)\n\n    return schema\n\n\ndef join_type_defs(type_defs: List[str]) -> str:\n    return \"\\n\\n\".join(t.strip() for t in type_defs)\n\n\ndef build_and_extend_schema(ast: DocumentNode) -> GraphQLSchema:\n    schema = build_ast_schema(ast)\n    extension_ast = extract_extensions(ast)\n\n    if extension_ast.definitions:\n        schema = extend_schema(schema, extension_ast)\n\n    return schema\n\n\nEXTENSION_KINDS = [\n    \"scalar_type_extension\",\n    \"object_type_extension\",\n    \"interface_type_extension\",\n    \"union_type_extension\",\n    \"enum_type_extension\",\n    \"input_object_type_extension\",\n]\n\n\ndef extract_extensions(ast: DocumentNode) -> DocumentNode:\n    extensions = [node for node in ast.definitions if node.kind in EXTENSION_KINDS]\n    return DocumentNode(definitions=extensions)\n", "path": "ariadne/executable_schema.py"}]}