-
Notifications
You must be signed in to change notification settings - Fork 0
GraphQL
-
Technology Description
-
GraphQL is a query language for your API, and a server-side runtime for executing queries using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.
A GraphQL service is created by defining types and fields on those types, then providing functions for each field on each type
-
-
Learn from an expert
- Recorded presentation from Asis Halab: https://youtu.be/_cPAzI6lm6k
- Slides: https://docs.google.com/presentation/d/1L876T9SzntZaWMqm329Gdz2s4rMzCNfBXGG4HWWoA3I
-
More Information
- The GraphQL official site: https://graphql.org/
- THe Zendro Project: https://zendro-dev.github.io/
- Zendro and BrAPI: https://github.com/LzLang/Zendro-Converter
-
Cost to setup
- Depends on technology stack - code generators can help but the development implies a lot of work if you don't use Zendro or Apollo already
- Node.js package universe requires frequent maintenance
- Security requires extra thought (Zendro comes with oauth2 and role-based authorization)
-
Pros
- Spread data load
- partial backups; integrate data; etc.
- Zendro is available to generate code
- GraphQL is good at solving the problems: data definition and data standardization; data integration from multiple diverse sources
- supports MongoDB, Relational Databases, Amazon S3/Apache Hadoop File Clouds, Neo4J, Presto
- generates interactive scientific plots when using the web interface
-
Cons
- Challenges with finding and sorting data.
- Not good at: non data centric web servers
- Development is hard if you don't use code generators such as zendro (similar to scaffolding functions in ruby on rails etc.)
- Space complexity for multi record read (or write) requests
- Time complexity
-
Use Case
- Use Case
-
Findability - Metadata and data should be easy to find for both humans and computers.
-
F1 - (Meta)data are assigned a globally unique and persistent identifier
Uses Internationalized Resource Identifier (IRI) per node. It works for all types of network topology. The combination of physical location of the node in the data cloud + internal identifier (who are you/where do you live) = unique string pointing to the server. It also supports Global Object Identification for the data.
-
F4 - (Meta)data are registered or indexed in a searchable resource
Data in each node must be sorted separately using cursor based pagination for read access
-
-
Accessibility - Once the user finds the required data, it should be clear how the data can be fully accessed.
-
A1 - (Meta)data are retrievable by their identifier using a standardized communications protocol
Zendro provides a GraphQL API web interface, called GraphiQL, which is a Web Browser tool for writing, validating, and testing GraphQL queries.
-
A1.1 - The protocol is open, free, and universally implementable
GraphQL services can be written in any language. Since we can't rely on a specific programming language syntax, like JavaScript, to talk about GraphQL schemas, we'll define our own simple language. We'll use the ""GraphQL schema language"" - it's similar to the query language, and allows us to talk about GraphQL schemas in a language-agnostic way. Existing support for different programming languages like Java Script, Go, PHP, Python, Scala, Ruby, Rust, etc. https://graphql.org/code/. The GraphQL API Queries are written in the GraphQL language, and the result (the data) is given back in JSON format.
-
-
Interoperability - The data should easily interoperate with other data, as well as applications for analysis, storage, and processing.
-
Reusability - Metadata and data should be well-described so that they can be replicated and/or combined in different settings.
-
R1 - (Meta)data are richly described with a plurality of accurate and relevant attributes
The schema supports the detail description of edges, relations, etc
-
Created by the AgBioData Data Federation Training Working Group