prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Unbound enum values are None when used in arguments
  When used as a mutation input, enum parameter should be `str`, but actually is `None`.
  
  ```python
  def test_executing_mutation_takes_enum():
      type_defs = """
          type Query {
              _: String
          }
  
          type Mutation {
              eat(meal: Meal!): Int!
          }
  
          enum Meal {
              SPAM
          }
      """
  
      mutation = MutationType()
  
      @mutation.field("eat")
      def resolve_eat(*_, meal):  # pylint: disable=unused-variable
          assert meal == "SPAM"
          return 42
  
      schema = make_executable_schema(type_defs, mutation)
  
      result = graphql_sync(schema, 'mutation { eat(meal: SPAM) }')
      assert result.errors is None
      assert result.data == {"eat": 42}
  ```
  
  </issue>
  <code>
  [start of ariadne/enums.py]
  1 import enum
  2 
  3 from typing import Any, Dict, Optional, Union, cast
  4 
  5 from graphql.type import GraphQLEnumType, GraphQLNamedType, GraphQLSchema
  6 
  7 from .types import SchemaBindable
  8 
  9 
  10 class EnumType(SchemaBindable):
  11     def __init__(
  12         self, name: str, values=Union[Dict[str, Any], enum.Enum, enum.IntEnum]
  13     ) -> None:
  14         self.name = name
  15         try:
  16             self.values = values.__members__  # pylint: disable=no-member
  17         except AttributeError:
  18             self.values = values
  19 
  20     def bind_to_schema(self, schema: GraphQLSchema) -> None:
  21         graphql_type = schema.type_map.get(self.name)
  22         self.validate_graphql_type(graphql_type)
  23         graphql_type = cast(GraphQLEnumType, graphql_type)
  24 
  25         for key, value in self.values.items():
  26             if key not in graphql_type.values:
  27                 raise ValueError(
  28                     "Value %s is not defined on enum %s" % (key, self.name)
  29                 )
  30             graphql_type.values[key].value = value
  31 
  32     def validate_graphql_type(self, graphql_type: Optional[GraphQLNamedType]) -> None:
  33         if not graphql_type:
  34             raise ValueError("Enum %s is not defined in the schema" % self.name)
  35         if not isinstance(graphql_type, GraphQLEnumType):
  36             raise ValueError(
  37                 "%s is defined in the schema, but it is instance of %s (expected %s)"
  38                 % (self.name, type(graphql_type).__name__, GraphQLEnumType.__name__)
  39             )
  40
  [end of ariadne/enums.py]
  [start of ariadne/executable_schema.py]
  1 from typing import List, Union
  2 
  3 from graphql import DocumentNode, GraphQLSchema, build_ast_schema, extend_schema, parse
  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     ast_document = parse(type_defs)
  16     schema = build_and_extend_schema(ast_document)
  17 
  18     if isinstance(bindables, list):
  19         for obj in bindables:
  20             obj.bind_to_schema(schema)
  21     elif bindables:
  22         bindables.bind_to_schema(schema)
  23 
  24     return schema
  25 
  26 
  27 def join_type_defs(type_defs: List[str]) -> str:
  28     return "\n\n".join(t.strip() for t in type_defs)
  29 
  30 
  31 def build_and_extend_schema(ast: DocumentNode) -> GraphQLSchema:
  32     schema = build_ast_schema(ast)
  33     extension_ast = extract_extensions(ast)
  34 
  35     if extension_ast.definitions:
  36         schema = extend_schema(schema, extension_ast)
  37 
  38     return schema
  39 
  40 
  41 EXTENSION_KINDS = [
  42     "scalar_type_extension",
  43     "object_type_extension",
  44     "interface_type_extension",
  45     "union_type_extension",
  46     "enum_type_extension",
  47     "input_object_type_extension",
  48 ]
  49 
  50 
  51 def extract_extensions(ast: DocumentNode) -> DocumentNode:
  52     extensions = [node for node in ast.definitions if node.kind in EXTENSION_KINDS]
  53     return DocumentNode(definitions=extensions)
  54
  [end of ariadne/executable_schema.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/ariadne/enums.py b/ariadne/enums.py
  --- a/ariadne/enums.py
  +++ b/ariadne/enums.py
  @@ -37,3 +37,15 @@
                   "%s is defined in the schema, but it is instance of %s (expected %s)"
                   % (self.name, type(graphql_type).__name__, GraphQLEnumType.__name__)
               )
  +
  +
  +def set_default_enum_values_on_schema(schema: GraphQLSchema):
  +    for type_object in schema.type_map.values():
  +        if isinstance(type_object, GraphQLEnumType):
  +            set_default_enum_values(type_object)
  +
  +
  +def set_default_enum_values(graphql_type: GraphQLEnumType):
  +    for key in graphql_type.values:
  +        if graphql_type.values[key].value is None:
  +            graphql_type.values[key].value = key
  diff --git a/ariadne/executable_schema.py b/ariadne/executable_schema.py
  --- a/ariadne/executable_schema.py
  +++ b/ariadne/executable_schema.py
  @@ -2,6 +2,7 @@
   
   from graphql import DocumentNode, GraphQLSchema, build_ast_schema, extend_schema, parse
   
  +from .enums import set_default_enum_values_on_schema
   from .types import SchemaBindable
   
   
  @@ -21,6 +22,8 @@
       elif bindables:
           bindables.bind_to_schema(schema)
   
  +    set_default_enum_values_on_schema(schema)
  +
       return schema
  
verification_info: {"golden_diff": "diff --git a/ariadne/enums.py b/ariadne/enums.py\n--- a/ariadne/enums.py\n+++ b/ariadne/enums.py\n@@ -37,3 +37,15 @@\n                 \"%s is defined in the schema, but it is instance of %s (expected %s)\"\n                 % (self.name, type(graphql_type).__name__, GraphQLEnumType.__name__)\n             )\n+\n+\n+def set_default_enum_values_on_schema(schema: GraphQLSchema):\n+    for type_object in schema.type_map.values():\n+        if isinstance(type_object, GraphQLEnumType):\n+            set_default_enum_values(type_object)\n+\n+\n+def set_default_enum_values(graphql_type: GraphQLEnumType):\n+    for key in graphql_type.values:\n+        if graphql_type.values[key].value is None:\n+            graphql_type.values[key].value = key\ndiff --git a/ariadne/executable_schema.py b/ariadne/executable_schema.py\n--- a/ariadne/executable_schema.py\n+++ b/ariadne/executable_schema.py\n@@ -2,6 +2,7 @@\n \n from graphql import DocumentNode, GraphQLSchema, build_ast_schema, extend_schema, parse\n \n+from .enums import set_default_enum_values_on_schema\n from .types import SchemaBindable\n \n \n@@ -21,6 +22,8 @@\n     elif bindables:\n         bindables.bind_to_schema(schema)\n \n+    set_default_enum_values_on_schema(schema)\n+\n     return schema\n", "issue": "Unbound enum values are None when used in arguments\nWhen used as a mutation input, enum parameter should be `str`, but actually is `None`.\r\n\r\n```python\r\ndef test_executing_mutation_takes_enum():\r\n    type_defs = \"\"\"\r\n        type Query {\r\n            _: String\r\n        }\r\n\r\n        type Mutation {\r\n            eat(meal: Meal!): Int!\r\n        }\r\n\r\n        enum Meal {\r\n            SPAM\r\n        }\r\n    \"\"\"\r\n\r\n    mutation = MutationType()\r\n\r\n    @mutation.field(\"eat\")\r\n    def resolve_eat(*_, meal):  # pylint: disable=unused-variable\r\n        assert meal == \"SPAM\"\r\n        return 42\r\n\r\n    schema = make_executable_schema(type_defs, mutation)\r\n\r\n    result = graphql_sync(schema, 'mutation { eat(meal: SPAM) }')\r\n    assert result.errors is None\r\n    assert result.data == {\"eat\": 42}\r\n```\n", "before_files": [{"content": "import enum\n\nfrom typing import Any, Dict, Optional, Union, cast\n\nfrom graphql.type import GraphQLEnumType, GraphQLNamedType, GraphQLSchema\n\nfrom .types import SchemaBindable\n\n\nclass EnumType(SchemaBindable):\n    def __init__(\n        self, name: str, values=Union[Dict[str, Any], enum.Enum, enum.IntEnum]\n    ) -> None:\n        self.name = name\n        try:\n            self.values = values.__members__  # pylint: disable=no-member\n        except AttributeError:\n            self.values = values\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(GraphQLEnumType, graphql_type)\n\n        for key, value in self.values.items():\n            if key not in graphql_type.values:\n                raise ValueError(\n                    \"Value %s is not defined on enum %s\" % (key, self.name)\n                )\n            graphql_type.values[key].value = value\n\n    def validate_graphql_type(self, graphql_type: Optional[GraphQLNamedType]) -> None:\n        if not graphql_type:\n            raise ValueError(\"Enum %s is not defined in the schema\" % self.name)\n        if not isinstance(graphql_type, GraphQLEnumType):\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__, GraphQLEnumType.__name__)\n            )\n", "path": "ariadne/enums.py"}, {"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"}]}