-

Amsterdam, Netherlands
Back to Schedule

Janette Cheng

How To Use Fragments (they're Not for Re-use!)

Studio
GraphQL in ProductionScaling

Session description

The most natural way to understand fragments is as a reusable part of a query. We at Meta know that this isn't true and can lead to a world of pain when it comes to making sure the data you fetch matches the code that uses that data (no over-fetching). The worst part is both the GraphQL spec and the educational materials mention re-use for fragments as part of their value: "Fragments allow for the reuse of common repeated selections of fields, reducing duplicated text in the document." This talk will explain what we've learned is the best way to use fragments (as subcomponents you convert to in order to pass to the logic that is tied to that fragment). We will use Relay's per-file graphql co-location as a demonstration of this philosophy in action


Session speakers

Janette Cheng

Software Engineer, Meta

GraphQL in Production

Working on the GraphQL client and build infrastructure for mobile apps at Meta

Get your ticket

Join three transformative days of expert insights and innovation to shape the next decade of APIs!

Get tickets
COMMUNITYDEVELOPER EXPERIENCEAPIsTOOLS & LIBRARIESCOMMUNITYDEVELOPER EXPERIENCEAPIsTOOLS & LIBRARIES
OPEN SOURCEFEDERATIONECOSYSTEMSTRACING & OBSERVABILITYOPEN SOURCEFEDERATIONECOSYSTEMSTRACING & OBSERVABILITY
BEST PRACTICESWORKSHOPSSCHEMASSECURITYBEST PRACTICESWORKSHOPSSCHEMASSECURITY