Home / Companies / Wundergraph / Blog / Post Details
Content Deep Dive

Understanding GraphQL Federation Versions (V1, V1.5, and V2)

Blog post from Wundergraph

Post Details
Company
Date Published
Author
David Stutt
Word Count
2,750
Language
English
Hacker News Points
-
Summary

GraphQL Federation has evolved from its initial version, V1, which was rigid and inflexible, to a more developer-friendly V2, introducing simpler syntax and greater flexibility. V1, released publicly in 2019, introduced the concept of entities, which are GraphQL Object types defined with a @key directive, allowing for resolving objects over multiple services. V2, announced in late 2021, removes the concept of "origin entities" and the need for special syntax for entity definitions across subgraphs, promoting easier migration and compatibility. Additionally, V2 introduces stricter rules for using the @external directive, ensuring fields and types conform to specific paths using @provides or @requires directives. The text also discusses a conceptual "Version 1.5," which represents subgraphs that are interpreted as V1 by V2 routers but are not fully compatible with true V1 composition, reflecting a hybridization of the two versions. This evolution aims to enhance cooperation across teams and safeguard against unintended changes in subgraphs, with V2 supporting backwards compatibility but sometimes requiring modifications for successful composition with V1.