Documentation May 3, 2020
Abstract Schema Graph
The MetaMate community progressively models the abstract schema graph around real-world data. Following, a high-level perspective on how the asg
emerges, and how it propagates through the stack.
Entities
This stage defines core and domain-specific entity types, how they relate to one another and which ones are going to be exposed by endpoints. Core entity types are ClientAccount
, ServiceAccount
, and Service
, to name a few. Domain-specific entities are HackerNewsActivity
, Post
, or PostFeed
, for example. Currently, these entities are defined as code but are going to be served by MetaMates soon (see Roadmap).
Actions
The action stage defines endpoints that are hard to model in a CRUD fashion. Examples of this are the LookupService
, AuthenticateClientAccount
or VerifyToken
endpoints.
Expansion
This stage processes the previously defined entity types, adds further fields to types, generates relation and relationship types, and composes generic types like SocialAccountFilter
, SocialAccountSort
, and SocialAccountSelect
entities. The expansion stage further generates the communication bits of the asg
on top of that. It adds generic types like GetSocialAccountsRequest
, PostSocialAccountsRequest
, PutSocialAccountsRequest
, DeleteSocialAccountsRequest
and the according Response
counterparts for all exposed types, and connects them to endpoints.
metactl
metactl is MetaMate’s CLI. It relies on the asg
to query MetaMate instances, to inspect nodes in the asg
, and most importantly, to generate project tailored and typed SDKs.
MetaMate
The asg
powers MetaMate’s internal and generic type representation system. MetaMate uses it to boot the communication stack, like composing the graphql
schema and exposing a generic http/json based API. MetaMate furthermore enforces validation rules, defined by the asg
.
Nodes
The asg
is composed of 8 different kinds of nodes. Nodes carry binary flags and are interconnected via edges.
Root
The Root
node holds a reference to all other nodes. It’s the starting point when retrieving nodes or traversing the graph.
BasicType
BasicType
nodes hold low-level types. They are predefined and constrained by the typing capabilities of various serialization formats. They currently consist of bool
, int32
, float64
, and string
.
Enum
Enum
nodes represent a predefined set of string
values.
Type
Type
nodes define custom data structures.
Field
Field
nodes are referenced by Type
nodes and either hold BasicType
, Enum
or Type
nodes.
Relation
Relation
nodes hold an active and a passive Path
node.
Path
Path
nodes are attached to Relation
nodes and model either an active or passive relation path between Type
nodes and specify a cardinality. Post mentions many SocialAccounts
is an active, HackerNewsActivity mentioned by many Posts
is it’s passive counterpart Path
.
Endpoint
Endpoint
nodes