Weitere ähnliche Inhalte
Ähnlich wie GraphQL & Relay (20)
Kürzlich hochgeladen (20)
GraphQL & Relay
- 3. Problems
• UI Driven Data Fetching
• Network Op!miza!ons
• Simple API Versioning
• Incremental Rendering
3
- 14. fragments: {
object: () => Relay.QL`
fragment on Object {
title
photos(width: 300) {
url
}
}
`,
}
fragments: {
object: () => Relay.QL`
fragment on Object {
title
photos(width: 300) {
url
}
}
`,
}
fragments: {
object: () => Relay.QL`
fragment on Object {
title
photos(width: 300) {
url
}
}
`,
}
fragments: {
object: () => Relay.QL`
fragment on Object {
title
photos(width: 300) {
url
}
}
`,
}
Parse Requirements
14
- 15. fragments: {
user: () => Relay.QL`
fragment on User {
favourites(first: 10) {
${ObjectView.getFragment(‘object’)}
}
}
`,
}
Compose Requirements
15
- 16. fragments: {
root: () => Relay.QL`
fragment on RootQuery {
me {
balance
${ObjectView.getFragment(‘user’)}
}
}
`,
}
Send Composed Query
16
- 20. There are only
two hard things
in Computer Science:
cache invalida!on
and naming things.
20
- 29. Good Parts: Recap
• Declara!ve & UI Oriented
• Very Effec!ve
• Simple Maintenance
• Extra Pre#y Features
26