import { gql } from "apollo-boost";

export const QUERY_ALL_ASSOCIATIONS = gql`
  query QUERY_ALL_ASSOCIATIONS {
    associations {
      id
      active
      bodyshop {
        shopname
      }
    }
  }
`;

export const UPDATE_ASSOCIATION = gql`
  mutation UPDATE_ASSOCIATION($assocId: uuid, $assocActive: Boolean) {
    update_associations(
      where: { id: { _eq: $assocId } }
      _set: { active: $assocActive }
    ) {
      returning {
        id
        active
      }
    }
  }
`;
