# Setting\Channel Related APIs
extend type Query {
    channels(input: FilterChannelInput @builder(method: "Webkul\\GraphQLAPI\\Queries\\Setting\\FilterChannel")) : [Channel!] @paginate(type: "paginator" defaultCount:10 model: "Webkul\\Core\\Models\\Channel")

    channel(id: ID @eq): Channel @find(model: "Webkul\\Core\\Models\\Channel")
}

extend type Mutation {
    createChannel(
        input: CreateChannelInput!
    ): Channel @field(resolver: "Webkul\\GraphQLAPI\\Mutations\\Setting\\ChannelMutation@store")

    updateChannel(
        id: ID!,
        input: CreateChannelInput!
    ): Channel @field(resolver: "Webkul\\GraphQLAPI\\Mutations\\Setting\\ChannelMutation@update")
    
    deleteChannel(id: ID!): Channel  @field(resolver: "Webkul\\GraphQLAPI\\Mutations\\Setting\\ChannelMutation@delete")
}

input CreateChannelInput {
    code: String!
    name: String!
    description: String
    theme: String!
    homePageContent: String @rename(attribute: "home_page_content")
    footerContent: String @rename(attribute: "footer_content")
    hostname: String
    defaultLocaleId: Int! @rename(attribute: "default_locale_id")
    baseCurrencyId: Int! @rename(attribute: "base_currency_id")
    rootCategoryId: Int! @rename(attribute: "root_category_id")
    locales: [Int!]!
    currencies: [Int!]!
    inventorySources: [Int!] @rename(attribute: "inventory_sources")
    logo: String
    favicon: String
    seoTitle: String! @rename(attribute: "seo_title")
    seoDescription: String! @rename(attribute: "seo_description")
    seoKeywords: String! @rename(attribute: "seo_keywords")
}

input FilterChannelInput {
    id: Int
    code: String
    name: String
    hostname: String
}

type Channel {
    id: ID!
    code: String!
    name: String!
    description: String
    theme: String!
    homePageContent: String @rename(attribute: "home_page_content")
    footerContent: String @rename(attribute: "footer_content")
    hostname: String
    defaultLocaleId: Int! @rename(attribute: "default_locale_id")
    baseCurrencyId: Int! @rename(attribute: "base_currency_id")
    rootCategoryId: Int! @rename(attribute: "root_category_id")
    homeSeo: String! @rename(attribute: "home_seo")
    locales: [Locale!] @belongsTo(relation: "locales")
    defaultLocale: String! @rename(attribute: "default_locale")
    currencies: [Currency!] @belongsTo(relation: "currencies")
    inventorySources: [InventorySource!] @belongsTo(relation: "inventory_sources")
    baseCurrency: String! @rename(attribute: "base_currency")
    rootCategory: String! @rename(attribute: "root_category")
    logoUrl: String @rename(attribute: "logo_url")
    faviconUrl: String @rename(attribute: "favicon_url")
    success: String
}