#W0661: unused imports lint
#C0301: line too long
#pylint: disable=W0611,C0301

from graphql import (
    GraphQLSchema,
    GraphQLObjectType,
    GraphQLField,
    GraphQLString,
    GraphQLArgument,
    GraphQLList,
    GraphQLInt,
    GraphQLInputObjectType,
    GraphQLInputObjectField,
    GraphQLNonNull,
    GraphQLID,
    GraphQLEnumType,
)

from graphql.type import GraphQLEnumValue

from graphscale.grapple import (
    GrappleType,
    id_field,
    req,
    list_of,
    define_top_level_getter,
    GraphQLDate,
)

class GraphQLProvider(GrappleType):
    @staticmethod
    def create_type():
        return GraphQLObjectType(
            name='Provider',
            fields=lambda: {
                'id': GraphQLField(
                    type=req(GraphQLID),
                    resolver=lambda obj, args, *_: obj.obj_id(*args),
                ),
                'name': GraphQLField(type=req(GraphQLString)),
                'providerNumber': GraphQLField(
                    type=req(GraphQLInt),
                    resolver=lambda obj, args, *_: obj.provider_number(*args),
                ),
                'fiscalYearBegin': GraphQLField(
                    type=req(GraphQLDate.type()),
                    resolver=lambda obj, args, *_: obj.fiscal_year_begin(*args),
                ),
                'fiscalYearEnd': GraphQLField(
                    type=req(GraphQLDate.type()),
                    resolver=lambda obj, args, *_: obj.fiscal_year_end(*args),
                ),
                'status': GraphQLField(
                    type=req(GraphQLProviderStatus.type()),
                    resolver=lambda obj, args, *_: obj.status(*args).name if obj.status(*args) else None,
                ),
                'streetAddress': GraphQLField(
                    type=req(GraphQLString),
                    resolver=lambda obj, args, *_: obj.street_address(*args),
                ),
                'poBox': GraphQLField(