src/graphQL/Mutations.js

mail@pastecode.io avatar
unknown
typescript
a month ago
2.7 kB
2
Indexable
Never
import { gql } from '@apollo/client'

export const END_SIMPLE_TRAIN_CONSIST_TRIP = gql`
  mutation EndSimpleTrainConsistTrip(
    $createdBy: String!
    $endDateUtc: DateTime!
    $simpleTrainConsistId: String!
  ) {
    end_simple_train_consist_trip(
      end_simple_train_consist_trip: {
        created_by: $createdBy
        end_date_utc: $endDateUtc
        simple_train_consist_complete_id: $simpleTrainConsistId
      }
    ) {
      end_simple_train_consist_trip
    }
  }
`

export const REPROCESS_TRIP = gql`
  mutation ReprocessTrip(
    $requestedBy: String!
    $simpleTrainConsistId: String!
  ) {
    reprocess_trip(
      requested_by: $requestedBy
      simple_train_consist_id: $simpleTrainConsistId
    ) {
      reprocess_fuel_savings_dag_run_id
      fuel_savings_dag_run_id
    }
  }
`

export const EDIT_USER_PERMISSION = gql`
  mutation EditUserPermission(
    $userId: String!
    $railroadId: String!
    $newRoleBitmask: Int = null
    $newIsTest: Boolean = null
  ) {
    edit_user_permission(
      user_id: $userId
      railroad_id: $railroadId
      new_role_bitmask: $newRoleBitmask
      new_is_test: $newIsTest
    ) {
      user_id
      railroad_id
      role_bitmask
      is_test
      created_at_utc
      updated_at_utc
    }
  }
`

export const DELETE_USER_PERMISSION = gql`
  mutation DeleteUserPermission($user_id: String!, $railroad_id: String!) {
    delete_user_permission(user_id: $user_id, railroad_id: $railroad_id) {
      success
    }
  }
`

export const ADD_NEW_USER = gql`
  mutation AddNewUser(
    $email: String!
    $password: String!
    $railroad_id: String!
    $role_bitmask: Int!
    $is_test: Boolean!
  ) {
    add_new_user(
      user: {
        email: $email
        password: $password
        railroad_id: $railroad_id
        role_bitmask: $role_bitmask
        is_test: $is_test
      }
    ) {
      user_id
      email
      err_msg
    }
  }
`

export const SOFT_DELETE_TRIP = gql`
  mutation SoftDeleteTrip($tripId: String!, $softDelete: Boolean!) {
    soft_delete_trip(trip_id: $tripId, soft_delete: $softDelete) {
      success
    }
  }
`

// export const ADD_ZONE_SPEED_LIMIT = gql`
//   mutation AddNewZoneSpeedLimit(
//   ) {
//     add_new_speed_limit(
//     ) {

//     }
//   }
// `

// export const EDIT_ZONE_SPEED_LIMIT = gql`
//   mutation EditZoneSpeedLimit(
//   ) {
//     edit_speed_limit(
//     ) {
//     }
//   }
// `
// export const DELETE_ZONE_SPEED_LIMIT = gql`
// mutation DeleteZoneSpeedLimit(

// ) {
//   delete_speed_limit(

//   ) {

//   }
// }
// `
Leave a Comment