# 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,
)
    "ReviewInput",
    lambda: {
        "stars": GraphQLInputField(GraphQLInt, description="0-5 stars"),
        "commentary": GraphQLInputField(
            GraphQLString, description="Comment about the movie, optional"
        ),
    },
    description="The input object sent when someone is creating a new review",
)

query_type = GraphQLObjectType(
    "Query",
    lambda: {
        "hero": GraphQLField(
            character_interface,
            args={
                "episode": GraphQLArgument(
                    episode_enum,
                    description="If omitted, returns the hero of the whole saga. If "
                    "provided, returns the hero of that particular episode.",
                )
            },
            resolve=lambda _souce, _info, episode=None: get_hero_async(episode),
        ),
        "human": GraphQLField(
            human_type,
            args={
                "id": GraphQLArgument(
                    description="id of the human", type_=GraphQLNonNull(GraphQLString),
                )

# 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,
)

    "ReviewInput",
    lambda: {
        "stars": GraphQLInputField(GraphQLInt, description="0-5 stars"),
        "commentary": GraphQLInputField(
            GraphQLString, description="Comment about the movie, optional"
        ),
    },
    description="The input object sent when someone is creating a new review",
)

query_type = GraphQLObjectType(
    "Query",
    lambda: {
        "hero": GraphQLField(
            character_interface,
            args={
                "episode": GraphQLArgument(
                    episode_enum,
                    description="If omitted, returns the hero of the whole saga. If "
                    "provided, returns the hero of that particular episode.",
                )
            },
            resolve=lambda _souce, _info, episode=None: get_hero_async(episode),
        ),
        "human": GraphQLField(
            human_type,
            args={
                "id": GraphQLArgument(
                    description="id of the human", type_=GraphQLNonNull(GraphQLString),
                )

            },