from typing import Optional

from api_graphql.abc.filter_abc import FilterABC


class StringFilter(FilterABC):
    def __init__(
        self,
        obj: Optional[dict],  # {'equal': value}
    ):
        FilterABC.__init__(self, obj)

        self.add_field("equal", str)
        self.add_field("notEqual", str)
        self.add_field("contains", str)
        self.add_field("notContains", str)
        self.add_field("startsWith", str)
        self.add_field("endsWith", str)
        self.add_field("isNull", str)
        self.add_field("isNotNull", str)
        self.add_field("in", list)
        self.add_field("notIn", list)
