a Discussion of GraphQL
A Conversation Series Event
March 2018, Sydney
Tools to create a LIXI API in under 30 Minutes
A LIXI API - A Common Requirement
We have had the need to create various APIs to accept an inbound LIXI XML or JSON file, execute some logic and return a response. Examples include:
- an XML to JSON converter;
- a version transformation tool, transforming a message from one version of LIXI2 to another;
- an adaptor to take a non-LIXI message and convert to a LIXI conformant message.
This is a very similar requirement to that which many of our members and licensees have when they need to be able to accept input in the form of a LIXI message for any reason.
Many ways to do the same thing
While the payload of the API might be a LIXI message, other aspects of the API implementation can vary widely leading to many design choices:
- Does the service expect a file object, or a raw string?
- Which MIME type is used: application/xml, text/xml, text/plain etc?
- Do I wrap the message in a SOAP envelope?
- Should the API key be included in the header or URL?
- What response type should I expect?
Not just an API
On top of the technical aspects of designing and building the API, there are practical issues to consider including:
- Code Management and Branching Strategies
- Continuous Integration, Automated Deployment & Automated Testing
- Encryption, Scaling, Resilience etc.
Using cloud computing and serverless technologies, we have produced a template project in LIXILab (LIXI's private GitLab Implementation) that any member can utilise to implement the entire architecture of a secure, scalable LIXI API interface in 30 minutes or less. This includes the source code control tools, testing framework, and automated deployment of various branches into different environments, including the management of signed certificates. Modification of any logic (for example mappings) can be made and redeployed in a matter of seconds.
With this methodology and toolset (with appropriate due diligence to satisfy your needs of course) provides an extremely rapid way to get up and running with an inbound LIXI API.
We will demonstrate the creation of an API to accept an incoming message using
- AWS Lambda
- Amazon API Gateway
- Python 3.6
- Chalice (a Python Serverless Microframework for AWS)
- Docker Containers for Testing
Discussion of GraphQL
As early as the 1960's, computers have interacted using Remote Procedure Calls (RPC) that could be described as an API Pattern. Since then SOAP (Simple Object Access Protocol) became prevalent in the 90's and still remains common. REST (REpresentational State Transfer) has now become the standard for the development of microservices. GraphQL is often touted as the technology that is about to replace REST, or at the very least, drastically change the manner in which APIs are designed and presented.
In this discussion, we'll introduce GraphQL, separate the hype from the reality, and explore how GraphQL may play a role in the messaging transactions that use LIXI standards.
To get the most out of this event, LIXI recommends some pre-reading of high level background information to Serverless technologies such as AWS Lambda or Azure Functions as well as GraphQL.
Since our demonstration uses AWS Lamda, we recommend the documentation on the Amazon site here.