import { gql, useQuery } from '@apollo/client';

const QUERY_WORKGROUP = gql`
  query workgroups($filter: WorkgroupsFilter) {
    workgroups(filter: $filter) {
      id,
      name,
      createdAt,
      closedAt,
      members {
        id,
        email,
        name
      }
    }
  }
`;

export function useWorkgroupsQuery(options = {}) {
  return useQuery(QUERY_WORKGROUP, options);
}