Mark Drew talks about “Let’s get GraphQL! (Smart API access from CFML) ” in this episode of ColdFusion Alive podcast with host Michaela Light.
- History of API use: SOAP, REST, GraphQL, oh my!
- Why GraphQL?
- Why Facebook invented it 2012
- Open source version released in 2015 + spec released
- What exactly is GraphQL
- A query language for APIs
- For example, if you look at a single tweet, obtained from Twitter's API, you will so a stack of information that you don't need! If only there was a way to query this data to get just what you need.
- GraphQL – A language specification that solves the same problem that SQL did for Relational Databases.
- Fundamentals of GraphQL
- Parse the graph of data – parents → children → grandchildren
- Client-specified Queries
- The API is self-documented
- Language Concepts
- Fields and subfields
- types and fields, not endpoints. Access the full capabilities of your data from a single endpoint. GraphQL uses types to ensure Apps only ask for what’s possible and provide clear and helpful errors
- CRUD operations
- Add new fields and types to your GraphQL API without impacting existing queries. Aging fields can be deprecated and hidden from tools. By using a single evolving version, GraphQL APIs give apps continuous access to new features and encourage cleaner, more maintainable server code.
- Fields and subfields
- How about in CFML?
- Client libs
- Java Server Libs
- IDL based on the GraphQL apec
- Must strip extra whitespace from the query you submit
- Who are actually using it and why?
- Sky TV
- Faster to run
- Good for mobile apps
- Apollo tools and server
- How was cf.Objective for you?
- What are you looking forward to at CFCAMP and NCDevCon?
Mentioned in this episode
The GraphicQL swapi demo
Listen to the Audio
Mark Drew has been programming CFML since 1996, and even though he has had forays into Perl, ASP and PHP he is still loving every line of code he has crafted with CFML. His career has concentrated on eCommerce, Content Management and Application Scalability for various well-known brands in the UK market such as Jaeger, Hackett, Hobbs, Dyson, B&W, Diesel amongst others. He founded CMD, a London based web development consultancy.
Michael: Welcome back to the show. I'm here with Mark Drew from Command MD, a web development consultancy in London, he's the founder. That's a bit like George Washington founded United States except it's a little bit smaller.
Mark: Just a tad, just a tad, we'll soon be quite as … you know give me 400 years and …
Michael: There we go yeah.
Mark: And I'm sure we'll be quite as big as the United State.
Michael: Exactly, so we're going to be looking at getting graphical with GQraphQL. We’ll look at the history of A.P.I. use, and where GraphQL fits into that. Why you should use it, who's using it, what exactly is the fundamentals of it, some of the subtle language concepts, and mutations that we can look at in there. And also, how you'd use it from ColdFusion, and how to get started on that. We'll have a quick demo in the middle of the episode, so you can see that.
Mark: And we [inaudible] [00:58] demo gods that everything goes well.
Michael: Always praise the demo gods. And we'll also check in on how C.F. objective was, and what's coming up at the C.F. camp for Mark. So, welcome Mark.
Mark: Well, thank you nice to see you again I should say. Are these in order?
Michael: Yes, they probably are moderately in order. We do shuffle randomly sometimes, but you know you're not alone because otherwise you're going to be like but we have not seen him before yes. So, thank you, thank you for having me on.
And to continue learning how to make your ColdFusion apps more modern and alive, I encourage you to download our free ColdFusion Alive Best Practices Checklist.
Because… perhaps you are responsible for a mission-critical or revenue-generating CF application that you don’t trust 100%, where implementing new features is a painful ad-hoc process with slow turnaround even for simple requests.
What if you have no contingency plan for a sudden developer departure or a server outage? Perhaps every time a new freelancer works on your site, something breaks. Or your application availability, security, and reliability are poor.
And if you are depending on ColdFusion for your job, then you can’t afford to let your CF development methods die on the vine.
You’re making a high-stakes bet that everything is going to be OK using the same old app creation ways in that one language — forever.
All it would take is for your fellow CF developer to quit or for your CIO to decide to leave the (falsely) perceived sinking ship of CFML and you could lose everything—your project, your hard-won CF skills, and possibly even your job.
Luckily, there are a number of simple, logical steps you can take now to protect yourself from these obvious risks.
No Brainer ColdFusion Best Practices to Ensure You Thrive No Matter What Happens Next
Modern ColdFusion development best practices that reduce stress, inefficiency, project lifecycle costs while simultaneously increasing project velocity and innovation.
√ Easily create a consistent server architecture across development, testing, and production
√ A modern test environment to prevent bugs from spreading
√ Automated continuous integration tools that work well with CF
√ A portable development environment baked into your codebase… for free!
Learn about these and many more strategies in our free ColdFusion Alive Best Practices Checklist.