Introduction to GraphQL and Relay. Presenter: Eric W. Greene

Similar documents
Web Development for Dinosaurs An Introduction to Modern Web Development

React(.js) the Domino Way High-Performance Client for Domino. Knut Herrmann

Modern SharePoint and Office 365 Development

The EHRI GraphQL API IEEE Big Data Workshop on Computational Archival Science

The Great SharePoint 2016/2013 Adventure for Developers

Full Stack boot camp

Web Frameworks MMIS 2 VU SS Denis Helic. March 10, KMI, TU Graz. Denis Helic (KMI, TU Graz) Web Frameworks March 10, / 18

GraphQL in Python and Django. Patrick

(p t y) lt d. 1995/04149/07. Course List 2018

Build Mobile Cloud Apps Effectively Using Oracle Mobile Cloud Services (MCS)

SHAREPOINT DEVELOPMENT FOR 2016/2013

THE GREAT SHAREPOINT ADVENTURE 2016

GraphQL - when REST API is not

Modern Web Application Development. Sam Hogarth

Advance Mobile& Web Application development using Angular and Native Script

The Future of the Realtime Web BETTER APIS WITH GRAPHQL. Josh

LOG8430: Architecture logicielle et conception avancée

CSC 443: Web Programming

JavaScript Fundamentals_

Windows Azure Mobile Services

Templates and Databinding. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Introduction. Introduction to OOP with Java. Lecture 01: Introduction to OOP with Java - AKF Sep AbuKhleiF -

"Charting the Course... MOC A: Developing with the SharePoint Framework. Course Summary

What is Node.js? Tim Davis Director, The Turtle Partnership Ltd

Microservices. SWE 432, Fall 2017 Design and Implementation of Software for the Web

JavaScript: Getting Started

IBMi in the IT infrastructure of tomorrow

Oracle Service Cloud Integration for Developers Ed 1

Erlang and Node.JS or, better, Criteria for evaluating technology. Lev Walkin, CTO

Connecting Angular and CFML

Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

Java with Eclipse: Setup & Getting Started

Ten interesting features of Google s Angular Project

com.walmartlabs/lacinia-pedestal Documentation

Discover GraphQL with Python, Graphene and Odoo. FOSDEM Stéphane Bidoul Version 1.0.4

THE PRAGMATIC INTRO TO REACT. Clayton Anderson thebhwgroup.com WEB AND MOBILE APP DEVELOPMENT AUSTIN, TX

REST Easy with Infrared360

Angular 2 Programming

Oracle Service Cloud Integration for Develope

Simple AngularJS thanks to Best Practices

Frontend UI Training. Whats App :

Accessing the Progress OpenEdge AppServer. From Progress Rollbase. Using Object Script

JavaScript and MVC Frameworks FRONT-END ENGINEERING

FULL STACK FLEX PROGRAM

Session 12. RESTful Services. Lecture Objectives

,

Tuesday, January 13, Backend III: Node.js with Databases

Arjen de Blok. Senior Technical Consultant bij ICT Groep ( sinds 1995 Programmeren sinds 1990 Technologiën. Links

OSSW ICOSST 2009, Al-Khawarizmi Institute of Computer Science University of Engineering and Technology, Lahore

Oracle Service Cloud Integration for Developers Ed 1

5/19/2015. Objectives. JavaScript, Sixth Edition. Introduction to the World Wide Web (cont d.) Introduction to the World Wide Web

Information Brochure Information Brochure. An ISO 9001:2015 Institute. ADMEC Multimedia Institute. Web Master Plus. Designing Development Promotion

P a g e 1. Danish Technological Institute. Scripting and Web Languages Online Course k Scripting and Web Languages

Writing your first Web Data Connector

GraphQL: Mind Your Ps and QLs

Hands On, Instructor-Led IT Courses Across Colorado

JVA-563. Developing RESTful Services in Java

Learn Ruby On Rails For Web Development Learn Rails The Fast And Easy Way

Approaches to wrapping React. Thursday 3 September 15

Here(is(the(XML(Schema(that(describes(the(format:

Comprehensive AngularJS Programming (5 Days)

Develop Mobile Front Ends Using Mobile Application Framework A - 2

Creating a REST API which exposes an existing SOAP Service with IBM API Management

Cisco Unified Application Designer 2.4

Setting Up the Development Environment

IN4MATX 133: User Interface Software

Unveiling Zend Studio 8.0

Building modern enterprise applications from scratch: lessons learned DOAG 2014 Dr. Clemens Wrzodek

The decoupled CMS in financial services. Preston So 8 Nov 2017 Open Source Strategy Forum 2017

Uber Push and Subscribe Database

LIVE WEBINAR: MOBILE TESTING WITH APPIUM HOW TO MODIFY YOUR TESTS TO RUN ON ios10?

WELCOME TO JQUERY PROGRAMMING LANGUAGE ONLINE TUTORIAL

OData: What s New with REST APIs for Your Database. Sanjeev Mohan, Gartner Nishanth Kadiyala, Progress Mark Biamonte, OData TC Member, Progress

But before understanding the Selenium WebDriver concept, we need to know about the Selenium first.

Tools to Develop New Linux Applications

Creating a REST API which exposes an existing SOAP Service with IBM API Management

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

GraphQL. Concepts & Challenges. - I m Robert Mosolgo - Work from home Ruby developer - From Charlottesville VA - For GitHub

Relevancy Workbench Module. 1.0 Documentation

Welcome. Quick Introductions

2014 IBM Corporation IBM Advanced Technical Skills ZCONN1. WebSphere Application Server Liberty Profile z/os. z/os Connect

The COS 333 Project. Robert M. Dondero, Ph.D. Princeton University

Copyright 2014 Blue Net Corporation. All rights reserved

Understanding RESTful APIs and documenting them with Swagger. Presented by: Tanya Perelmuter Date: 06/18/2018

Take a Load Off with U2 RESTful Web Services. Nik Kesic, Lead Technical Support for Rocket U2

How s your Sports ESP? Using SAS Event Stream Processing with SAS Visual Analytics to Analyze Sports Data

Full Stack Flex Program

,

Our trainings can be delivered as an Onsite Classroom Training or as an Instructor-Led Live Online Training(ILT).

Backend Development. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Contents. Microsoft is a registered trademark of Microsoft Corporation. TRAVERSE is a registered trademark of Open Systems Holdings Corp.

Intro Winter Semester 2016/17

10 ways to reduce your tax bill. Amit Nithianandan Senior Search Engineer Zvents Inc.

IBM s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM s sole discretion.

Best Programming Languages to Learn in 2017

Backend Development. SWE 432, Fall Web Application Development

Widget Toolkits CS MVC

FULL STACK FLEX PROGRAM

Technology in Action. Chapter Topics (cont.) Chapter Topics. Reasons for Software Programming. Information Systems 10/29/2010

JAVASCRIPT FOR BEGINNERS: The Ultimate Beginners Crash Course To Learn Javascript Quickly And Easily By Adam Vardy

Transcription:

Introduction to GraphQL and Relay Presenter: Eric W. Greene

Welcome to the Webinar! Welcome to the webinar on GraphQL and Relay!!! We will review a few slides, then experiment with GraphQL and review GraphQL code, followed by a few more slides and a Relay demonstration and code review, then spend the last 10 mins answering any questions (we can go longer if needed for questions) The session is being recorded for downloading afterwards

What is GraphQL? GraphQL is a replacement interface for traditional REST services When developers think of REST services, typically they envision the HTTP verbs and such, but also think of the implementation of business logic, data access, etc A better way to think of REST services is to strictly think of only the HTTP interface, the URIs and Verbs used to access resources without regard to the business logic or database access

What is GraphQL? When thinking of the interface only, GraphQL and REST are two ways of accomplishing the same goal REST services use a simple combination of HTTP Verb, URI (collection or element), and optional request body content to perform any number of data operations from the perspective of the client Compared to technologies such as SOAP or binary data connections, REST services make accessing data via HTTP very easy, and therefore it has become very popular

What is GraphQL? While easy and popular, REST service have some problems First, there is no standard, each organization can implement their REST services however they want. There are conventions and best practices, but even those can vary from organization to organization Second, REST services deliver static data structures unless the developer intentionally codes them to be customized

What is GraphQL? When REST services were first implemented most developers looked at their data as a large table (two-dimensional) From that table of data, developers retrieve, insert, update and delete data A lot has changed in the last 10-20 years

What is GraphQL? Data structures today are more complex, they are better thought of as graphs (multi-dimensional) instead of tables (two-dimensional) Querying those graphs requires a standard query language, and dynamic result structures which reflect what was actually queried for

What is GraphQL? GraphQL, created by Facebook, provides a more flexible, and standardized interface for querying these data graphs, and returning back result sets with a customizable structure GraphQL does not care about business logic or data access It only cares about how to query the graph, and then how to structure results as requested

Coding GraphQL Organizations implement GraphQL using several strategies Create a new services which use GraphQL combined with business logic and data access to provide services Create new GraphQL services which wrap existing REST (and other) services and deliver data through the GraphQL interface (we will do that in our code review)

Coding GraphQL GraphQL is a standard, not an implementation In the webinar, we will use the Node.js implementation of GraphQL, but GraphQL implementations exist for many languages Java C# Ruby Python And many more http://graphql.org/code

Coding GraphQL GraphQL implementations come with a tool called GraphiQL GraphiQL is a web based query tool for GraphQL It provides syntax validation, query beautification, code completion and documentation of the GraphQL server's particular data structures (aka schema) Queries can be entered, variables can be specified, and the results are displayed

Coding GraphQL With GraphQL on the server side, clients can access the GraphQL server via HTTP Within a web browser, standard AJAX calls can be made The AJAX calls DO NOT conform to the REST Verb/URI pattern, but the calls to GraphQL are standard HTTP calls so using existing AJAX libraries works great, and even REST service clients can be used for testing and debugging

Coding GraphQL There are three kinds of GraphQL requests Queries retrieves application data as a graph of nodes Mutations changes application data (can update one or many nodes) Introspections retrieves graph schema (data structure of the various node types and their connections to each other)

Let's Get Started We will explore GraphQL (as compared to a REST service), then review code for GraphQL Visual Studio Code will be used as the editor, but Node.js through Express and Webpack will be used to run the various transpilers and bundle our code, and serve the web pages JSON Server is being use to serve the REST service data

What is Relay? Relay is a framework for connecting GraphQL to client side code What problems does Relay solve? Data requirements for views are defined using declarative GraphQL queries The GraphQL queries are co-located with the views Mutations are managed to ensure data consistency, optimistic updates and error checking

What is Relay? Relay is part implementation and part standard From a standards perspective, Relay defines the GraphQL structure to deliver data, and defines how containers are created on the client to access the Relay Store and deliver the GraphQL data to UI component

What is Relay? From this standards perspective Relay does not care which implementation of GraphQL is used so long as the graph structure exposed by the server matches the Relay GraphQL standard Relay does not care which component library is used so long as the component library knows how interact with the Relay Store In principle, Relay does not require React

What is Relay? In practice, React is required (but there are efforts to make Relay work with other libraries/frameworks such as Angular 2) In our code review, our implementation will use the implementation of GraphQL in Express using the Relay GraphQL standard for the structure of the graph The client-side code will be using React

What is the Relay GraphQL Standard? Relay requires four structures to be present in the GraphQL server First, the graph must have single root node Second, every node in the graph must have a unique id so that it can be queried directly Third, connections between nodes must have a special structure which supports paging through connections Fourth, a standard structure for mutations

What is the Relay GraphQL Standard? To support this standard any implementation of GraphQL (Java, C#, JavaScript, etc ) can be used, but the coding of the graph structure must follow this standard The graphql-relay NPM package provides library code to create these structures for the developer

React and Relay The NPM package react-relay provides client-side library code for connecting the React application to Relay It provides containers for connecting the React Component tree to the Relay Store It provides library code for configuring routes and mutations

Let's Get Started We will explore Relay and review the code to support Relay both on the server-side and clientside

About Wintellect who we are consulting/trainin g Founded by top experts on Microsoft Jeffrey Richter, Jeff Prosise, and John Robbins, along with a team of industry leaders we pull out all the stops to help our customers achieve their goals through advanced software-based consulting and training solutions. consulting Wintellect helps you build better software, faster, tackling the tough projects and solving the software and technology questions that help you transform your business. Architecture, Analysis and Design Full lifecycle software development Debugging and Performance tuning Database design and development training Wintellect's courses are written and taught by some of the most renowned and respected names in the Microsoft programming industry. Learn from the best. Access the same training Microsoft s worldwide developers enjoy. Real world knowledge and solutions on both current and cutting edge technologies Flexibility in training options onsite, virtual, on demand

Questions??? To access the source code from today's webinar, download the code from here: https://github.com/training4developers/react_graphql _relay_webinar Email: eric@training4developers.com Any questions?