GraphQL is a query language created by Facebook in 2012 which provides a common interface between the client and the server for data fetching and manipulations. The client asks for various data from the GraphQL server via queries.
GraphQL • Single endpoint • Not just a library • Application-Layer Protocol • Server agnostic • Strongly-typed • Client-specified queries • Hierarchical
PostContainer = Relay.createContainer(Post, { fragments: { post: () => Relay.QL` fragment on Post { id title tagline votes_count } `, }, }); Apollo fragment MenuItem on Topic { name slug imageUrl }
PostContainer = Relay.createContainer(Post, { fragments: { post: () => Relay.QL` fragment on Post { id title tagline votes_count } `, }, }); Apollo fragment NewsletterCard on Newsletter { name slug imageUrl description }
PostContainer = Relay.createContainer(Post, { fragments: { post: () => Relay.QL` fragment on Post { id title tagline votes_count } `, }, }); Apollo fragment GiveawayCard on Giveway { name slug imageUrl }
PostContainer = Relay.createContainer(Post, { fragments: { post: () => Relay.QL` fragment on Post { id title tagline votes_count } `, }, }); Apollo fragment PostItem on Post { id title headline slug votesCount commentsCount imageUrl topics { slug name } }