# Path: tests/starwars/fixtures.py
# class Character:
# class Human(Character):
# class Droid(Character):
#     def __init__(self, id, name, friends, appearsIn, homePlanet):
#     def __init__(self, id, name, friends, appearsIn, primaryFunction):
# def get_character(id):
# def get_characters(ids):
# def get_friends(character):
# def get_hero(episode):
# async def get_hero_async(episode):
# def get_human(id):
# def get_droid(id):
# def create_review(episode, review):


import asyncio
from graphql import (
    GraphQLArgument,
    GraphQLEnumType,
    GraphQLEnumValue,
    GraphQLField,
    GraphQLInputField,
    GraphQLInputObjectType,
    GraphQLInt,
    GraphQLInterfaceType,
    GraphQLList,
    GraphQLNonNull,
    GraphQLObjectType,
    GraphQLSchema,
    GraphQLString,
    get_introspection_query,
    graphql_sync,
    print_schema,
)
from .fixtures import (
    create_review,
    get_characters,
    get_droid,
    get_friends,
    get_hero_async,
    get_human,
    reviews,
)
    lambda: {
        "id": GraphQLField(
            GraphQLNonNull(GraphQLString), description="The id of the character."
        ),
        "name": GraphQLField(GraphQLString, description="The name of the character."),
        "friends": GraphQLField(
            GraphQLList(character_interface),  # type: ignore
            description="The friends of the character,"
            " or an empty list if they have none.",
        ),
        "appearsIn": GraphQLField(
            GraphQLList(episode_enum), description="Which movies they appear in."
        ),
    },
    resolve_type=lambda character, _info, _type: {
        "Human": human_type.name,
        "Droid": droid_type.name,
    }[character.type],
    description="A character in the Star Wars Trilogy",
)

human_type = GraphQLObjectType(
    "Human",
    lambda: {
        "id": GraphQLField(
            GraphQLNonNull(GraphQLString), description="The id of the human.",
        ),
        "name": GraphQLField(GraphQLString, description="The name of the human.",),
        "friends": GraphQLField(
            GraphQLList(character_interface),

# Path: tests/starwars/fixtures.py
# class Character:
# class Human(Character):
# class Droid(Character):
#     def __init__(self, id, name, friends, appearsIn, homePlanet):
#     def __init__(self, id, name, friends, appearsIn, primaryFunction):
# def get_character(id):
# def get_characters(ids):
# def get_friends(character):
# def get_hero(episode):
# async def get_hero_async(episode):
# def get_human(id):
# def get_droid(id):
# def create_review(episode, review):


# Path: tests/starwars/schema.py
import asyncio
from graphql import (
    GraphQLArgument,
    GraphQLEnumType,
    GraphQLEnumValue,
    GraphQLField,
    GraphQLInputField,
    GraphQLInputObjectType,
    GraphQLInt,
    GraphQLInterfaceType,
    GraphQLList,
    GraphQLNonNull,
    GraphQLObjectType,
    GraphQLSchema,
    GraphQLString,
    get_introspection_query,
    graphql_sync,
    print_schema,
)
from .fixtures import (
    create_review,
    get_characters,
    get_droid,
    get_friends,
    get_hero_async,
    get_human,
    reviews,
)

    lambda: {
        "id": GraphQLField(
            GraphQLNonNull(GraphQLString), description="The id of the character."
        ),
        "name": GraphQLField(GraphQLString, description="The name of the character."),
        "friends": GraphQLField(
            GraphQLList(character_interface),  # type: ignore
            description="The friends of the character,"
            " or an empty list if they have none.",
        ),
        "appearsIn": GraphQLField(
            GraphQLList(episode_enum), description="Which movies they appear in."
        ),
    },
    resolve_type=lambda character, _info, _type: {
        "Human": human_type.name,
        "Droid": droid_type.name,
    }[character.type],
    description="A character in the Star Wars Trilogy",
)

human_type = GraphQLObjectType(
    "Human",
    lambda: {
        "id": GraphQLField(
            GraphQLNonNull(GraphQLString), description="The id of the human.",
        ),
        "name": GraphQLField(GraphQLString, description="The name of the human.",),
        "friends": GraphQLField(
            GraphQLList(character_interface),

            description="The friends of the human, or an empty list if they have none.",