Menu

πŸ“°
0

How the Fission Algorithm Works: Top-Down GraphQL Federation Design

DEV Community: graphqlΒ·WunderGraphΒ·about 1 month ago
#8r7KBN9o
#dev#class#code#strong#subgraph#article
Reading 0:00
15s threshold

TL;DR Fission inverts GraphQL Federation. Instead of composing subgraphs into a supergraph, you design the supergraph first and Fission decomposes it into subgraph specs, handling entity keys, directives, and validation automatically. In a previous post , I argued that Federation's composition model is backwards. It builds the supergraph from the bottom up when it should be designed from the top down. This post is a technical deep dive into how the Fission algorithm actually does that. The Problem Fission Solves To understand Fission, first you need to understand what makes schema changes expensive in Federation. Consider a federated graph with three subgraphs: # Subgraph: Users type User @ key ( fields : " id " ) { id : ID ! name : String ! email : String ! } type Query { user ( id : ID !): User users : [ User !]! } # Subgraph: Orders type User @ key ( fields : " id " ) { id : ID ! orders : [ Order !]! } type Order @ key ( fields : " id " ) { id : ID ! total : Float ! status : OrderStatus !…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More