import { gql } from "graphql-tag";

// TODO: Confirm backend schema for notes table. Assumed fields:
// id (uuid), jobid (uuid), text (String!), critical (Boolean), private (Boolean), pinned (Boolean), type (String), created_at (timestamptz), created_by (String)
// relatedros is assumed handled via separate linking if required.

export const INSERT_NEW_NOTE = gql`
  mutation INSERT_NEW_NOTE($note: [notes_insert_input!]!) {
    insert_notes(objects: $note) {
      returning {
        id
        text
        critical
        private
        pinned
        type
        created_at
        created_by
      }
    }
  }
`;
