import gql from "graphql-tag";

export const QUERY_BODYSHOP = gql`
  query QUERY_BODYSHOP {
    bodyshops(where: { associations: { active: { _eq: true } } }) {
      id
      jobsizelimit
      md_ro_statuses
      uselocalmediaserver
      localmediaserverhttp
      shopname
      features
      localmediatoken
      imexshopid
      md_ro_statuses
    }
  }
`;

export const QUERY_SHOP_ID = gql`
  query QUERY_SHOP_ID {
    bodyshops(where: { associations: { active: { _eq: true } } }) {
      id
    }
  }
`;


export const UPDATE_FCM_TOKEN = gql`
mutation UPDATE_FCM_TOKEN($email: String!, $token: jsonb!) {
  update_users(where: {email: {_eq: $email}}, _append: {fcmtokens: $token}) {
    affected_rows
  }
}`;