Skip to content

Notice GraphQL

SELECT_NOTICE

Example

ts
const SELECT_NOTICE = gql`
    query selectNotice(
        $limit: Int = 10
        $offset: Int = 0
        $where: notice_notices_bool_exp = {}
        $order_by: [notice_notices_order_by!]
    ) {
        notice_notices(
            where: $where
            limit: $limit
            offset: $offset
            order_by: $order_by
        ) {
            id
            title
            content
            created_at
            updated_at
        }
    }
`;

GET_NOTICE_BY_PK

Example

ts
const GET_NOTICE_BY_PK = gql`
    query getNoticeByPK($id: uuid!) {
        notice_notices_by_pk(id: $id) {
            id
            lang
            title
            content
            start_date
            end_date
            state
            created_at
        }
    }
`;

INSERT_NOTICE

Example

ts
const INSERT_NOTICE = gql`
    mutation insertNotice(
        $object: notice_notices_insert_input!
    ) {
        insert_notice_notices_one (
            object: $object
        ) {
            id
        }
    }
`;

UPDATE_NOTICE_BY_PK

Example

ts
const UPDATE_NOTICE_BY_PK = gql`
    mutation updateNoticeByPk(
        $id: uuid!
        $set: notice_notices_set_input!
    ) {
        update_notice_notices_by_pk(
            pk_columns: {
                id: $id
            }
            _set: $set
        ) {
            id
            updated_at
            deleted_at
        }
    }
`;