type Query {
    facets(options: FacetListOptions): FacetList!
    facet(id: ID!): Facet
    facetValues(options: FacetValueListOptions): FacetValueList!
}

type Mutation {
    "Create a new Facet"
    createFacet(input: CreateFacetInput!): Facet!

    "Update an existing Facet"
    updateFacet(input: UpdateFacetInput!): Facet!

    "Delete an existing Facet"
    deleteFacet(id: ID!, force: Boolean): DeletionResponse!

    "Delete multiple existing Facets"
    deleteFacets(ids: [ID!]!, force: Boolean): [DeletionResponse!]!

    "Create one or more FacetValues"
    createFacetValues(input: [CreateFacetValueInput!]!): [FacetValue!]!

    "Update one or more FacetValues"
    updateFacetValues(input: [UpdateFacetValueInput!]!): [FacetValue!]!

    "Delete one or more FacetValues"
    deleteFacetValues(ids: [ID!]!, force: Boolean): [DeletionResponse!]!

    "Assigns Facets to the specified Channel"
    assignFacetsToChannel(input: AssignFacetsToChannelInput!): [Facet!]!

    "Removes Facets from the specified Channel"
    removeFacetsFromChannel(input: RemoveFacetsFromChannelInput!): [RemoveFacetFromChannelResult!]!
}

# generated by generateListOptions function
input FacetListOptions

input FacetTranslationInput {
    id: ID
    languageCode: LanguageCode!
    name: String
}

input CreateFacetInput {
    code: String!
    isPrivate: Boolean!
    translations: [FacetTranslationInput!]!
    values: [CreateFacetValueWithFacetInput!]
}

input UpdateFacetInput {
    id: ID!
    isPrivate: Boolean
    code: String
    translations: [FacetTranslationInput!]
}
input FacetValueTranslationInput {
    id: ID
    languageCode: LanguageCode!
    name: String
}

input CreateFacetValueWithFacetInput {
    code: String!
    translations: [FacetValueTranslationInput!]!
}

input CreateFacetValueInput {
    facetId: ID!
    code: String!
    translations: [FacetValueTranslationInput!]!
}

input UpdateFacetValueInput {
    id: ID!
    code: String
    translations: [FacetValueTranslationInput!]
}

input AssignFacetsToChannelInput {
    facetIds: [ID!]!
    channelId: ID!
}

input RemoveFacetsFromChannelInput {
    facetIds: [ID!]!
    channelId: ID!
    force: Boolean
}

type FacetInUseError implements ErrorResult {
    errorCode: ErrorCode!
    message: String!
    facetCode: String!
    productCount: Int!
    variantCount: Int!
}

union RemoveFacetFromChannelResult = Facet | FacetInUseError
