createPetPrescription
Creates a pet prescription prescription.
CreatePetPrescriptionMutationInput
Autogenerated input type of CreatePetPrescriptionMutation
- clientMutationId: String
A unique identifier for the client performing the mutation.
- userId: ID!required
ID of user
- createdById: ID!required
ID of user
- locationId: ID
ID of location
- vetId: ID!required
ID of vet
- validityPeriod: PrescriptionValidityPeriodInput!required
The validity period of the prescription, including start and end dates
- petName: String!required
Pet name
- species: String
Pet species
- yearOfBirth: Int!required
Pet's year of birth
- weight: Int!required
Pet's weight
- prescriptionItems: [PetPrescriptionItemInput!]!required
Pet prescription items
CreatePetPrescriptionMutationPayload
Autogenerated return type of CreatePetPrescriptionMutation.
- clientMutationId: String
A unique identifier for the client performing the mutation.
- errors: [InputError!]!
Validation errors
- prescription: PetPrescription
Query
mutation($input: CreatePetPrescriptionMutationInput!) {
createPetPrescription(input: $input) {
prescription {
id
location {
id
}
vet {
id
}
user {
id
}
prescriptionItems {
product {
id
}
directions
quantity
frequency
}
petName
species
weight
weightUnit
yearOfBirth
status
validityPeriod {
expiryDate
startDate
}
createdBy {
id
}
}
}
}Variables
{
"input": {
"userId": "AccountHolder-XL3FBMGL86",
"locationId": "Location-N89TML7EMEO",
"vetId": "StaffMember-42QFNM9EBQ",
"validityPeriod": {
"startDate": "2021-05-19",
"expiryDate": "2021-11-19"
},
"petName": "Fenton",
"species": "dog",
"yearOfBirth": 2002,
"weight": 23,
"prescriptionItems": [
{
"productId": "Product-KL6SMBMZ8JW",
"directions": "apply to dog",
"quantity": 2,
"frequency": "P1M"
}
],
"createdById": "StaffMember-42QFNM9EBQ"
}
}Response
{
"data": {
"createPetPrescription": {
"prescription": {
"id": "PetPrescription-2Q4SJXK8OPV",
"location": {
"id": "Location-N89TML7EMEO"
},
"vet": {
"id": "StaffMember-42QFNM9EBQ"
},
"user": {
"id": "AccountHolder-XL3FBMGL86"
},
"prescriptionItems": [
{
"product": {
"id": "Product-KL6SMBMZ8JW"
},
"directions": "apply to dog",
"quantity": 2,
"frequency": "P1M"
}
],
"petName": "Fenton",
"species": "dog",
"weight": 23,
"weightUnit": "lbs",
"yearOfBirth": 2002,
"status": "approved",
"validityPeriod": {
"expiryDate": "2021-11-19",
"startDate": "2021-05-19"
},
"createdBy": {
"id": "StaffMember-42QFNM9EBQ"
}
}
}
}
}