Tuffnells GraphQL POD
This serverless function returns a GraphQL resolver for consuming the Tuffnells XML endpoint.
Installation
git clone https://github.com/notrab/tuffnells-graphql-pod.git
cd tuffnells-graphql-pod
yarn
Configuration
Tuffnells uses IP based authentication. In production, it is recommended you use a Proxy with a fixed IP to relay requests. I use QuotaGuard.
The QUOTAGUARDSTATIC_URL
must be available to the current process
.
export QUOTAGUARDSTATIC_URL=
Development
To start the development server, you must run:
yarn dev
Example Query
{
Pod(AccountCode: 123456, Reference:"N123456", Postcode: "NE42 6PX") {
Authorised
DeliveryAddress {
CompanyName
Postcode
}
ConsignmentInformation {
Pieces
Pallets
Weight
Service
DeliveryDate
ItemsDelivered
ConsignmentRef
SpecialInstructions
URN
}
MovementInformation{
MovementDate
Round
DeliveryDepot
}
TimedInformation {
Signature
SignatureDate
SignatureTime
}
ScanInformation{
PieceID
}
ImageInformation {
PODImage {
URL
}
}
}
}
Deploy
In production the process variable QUOTAGUARDSTATIC_URL
must be present.
If you're deploying for the first time, you must store the ENV variable.
now secret add quotaguardstatic_url value-here
If QUOTAGUARDSTATIC_URL
is already set, you must deploy and expose the ENV
variable.
now -e QUOTAGUARDSTATIC_URL=@quotaguardstatic_url