code: def get_field_def(
      schema: GraphQLSchema, parent_type: GraphQLType, field_node: FieldNode
  ) -> Optional[GraphQLField]:
      
      name = field_node.name.value
      if name == "__schema" and schema.query_type is parent_type:
          return SchemaMetaFieldDef
      if name == "__type" and schema.query_type is parent_type:
          return TypeMetaFieldDef
      if name == "__typename" and is_composite_type(parent_type):
          return TypeNameMetaFieldDef
      if is_object_type(parent_type) or is_interface_type(parent_type):
          parent_type = cast(Union[GraphQLObjectType, GraphQLInterfaceType], parent_type)
          return parent_type.fields.get(name)
      return None
docs: Get field definition.
  
      Not exactly the same as the executor's definition of `get_field_def()`, in this
      statically evaluated environment we do not always have an Object type, and need
      to handle Interface and Union types.