Thomas Frisendal
Visual Design of GraphQL Data A Practical Introduction with Legacy Data and Neo4j
Thomas Frisendal
Copenhagen S, Denmark
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book's product page, located at www.apress.com/9781484239032 . For more detailed information, please visit http://www.apress.com/source-code .
ISBN 978-1-4842-3903-2 e-ISBN 978-1-4842-3904-9
https://doi.org/10.1007/978-1-4842-3904-9
Library of Congress Control Number: 2018956408
Thomas Frisendal 2018
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
My wonderful wife, Ellen-Margrethe Soelberg, has again experienced a period of having an author in the house, yet she has at the same time undertaken the proof-reading job in her usual, professional manner. Thank You!.
Introduction
You know the basics of GraphQL, but you are still uncertain about how to get business content and API structures right in GraphQL?
GraphQL is indeed an attractive data API for applications (and people).
The GraphQL Schema is pivotal to the success of a GraphQL API. Most development projects involve many stakeholders. There are the developers, of course, and there are business experts as well as application owners, who are to consume the content of the API. This means that the schema is not only a scope contract, but also the authoritative source of structure and meaning of the context covered by the API. There are many other contexts, where complex structures and semantics must be communicated effecetively between a number of people with various backgrounds. And the trick invariably turns out to be: Use good visualizations!
The main proposition of this book is graph visualization: GraphQL Schema structure and meaning must be visualized, and the book shows you how. Since the schema is a data graph containing related concepts in a network organized as a directed graph, the increasingly popular property graph paradigm is very appropriate for visualizing GraphQL structures and semantics.
The second theme of this book is that of quality. GraphQL APIs can be used in many constellations possibly including legacy data and/or externally sourced data. Quality must be ensured in all cases. Both on the definitional level (business terminology etc.) and on the data content level (meaningful presentation of the data in business-friendly formats). The book summarizes the top 10 most important focal areas of such quality assurance remedies.
In this edition of the book, the following was added:
Catching up with the latest version of the GraphQL specifikation (minor adjustments)
Brief explanation of schema stitching etc. and the impact of it on development style
Discussion of resolver requirements, in particular vis-a-vis legacy SQL data
Explanation of the Neo4j-GraphQL integration and a look at applying GraphQL to both existing and new Neo4j graph databases.
In this manner, the (data and metadata quality) challenges of front-ending old and new databases with a GraphQL API is the third theme of this book.
The book contains simple guidelines based on lessons learned from real life data discovery and unification. This helps developers and architects to get good quality in the resulting API designs. And the visual techniques helps in producing convincing visual communication about the structure of the API designs.
Spending time on schema quality means that developers work from sharp definitions, which in turn leads to greater productivity and well-structured applications.
Acknowledgments
Named relationships is one of the fundamental recommendations of this book. The importance of this was made originally by Prof. Joseph D. Novak, who was one of the fathers of Concept Mapping in the development of the psychology of learning.
GraphQL is designed by Facebook, Copyright 2015-2016. It is now an open source project, where the software is available under a BSD 3 license. Refer to for more information.
The GraphQL @relation schema directive originated at Graphcool, refer to for more information.
The chapter about using GraphQL with a new graph database draws heavily on a blogpost . I am quoting from it with the authors kind permission. Thank you!
About the Author and About the Technical Reviewer
About the Author
Thomas Frisendal
Figure 1
Graph Data Modeling
is an experienced database consultant with more than 30 years on the IT vendor side and as an independent consultant. He has worked with databases and data modeling since the late 70s; since 1995 primarily on data warehouse projects. He has a strong urge to visualize everything as graphs - even datamodels! He excels in the art of turning data into information and knowledge. His approach to information-driven analysis and design is New Nordic in the sense that it represents the traditional Nordic values such as superior quality, functionality, reliability and innovation by new ways of communicating the structure and meaning of the business context.