Upgrade to Pro — share decks privately, control downloads, hide ads and more …

It Depends - Examining GraphQL Myths & Assumptions

It Depends - Examining GraphQL Myths & Assumptions

Marc-Andre Giroux

December 07, 2020
Tweet

More Decks by Marc-Andre Giroux

Other Decks in Programming

Transcript

  1. Performance We’re thinking of using GraphQL as our API Cool!

    Why are you choosing GraphQL over other API styles? Because… performance!
  2. The trade-off, though, is that a uniform interface degrades efficiency,

    since information is transferred in a standardized form rather than one which is specific to an application's needs. The REST interface is designed to be efficient for large-grain hypermedia data transfer, optimizing for the common case of the Web, but resulting in an interface that is not optimal for other forms of architectural interaction. https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
  3. viewer { contributionsCollection { commitContributionsByRepository { contributions { nodes {

    commitCount } } } } repositories(first: 100) { nodes { name issues(first: 100) { nodes { body } } } } issues(first: 100) { edges { node { author { login } } } }
  4. viewer { contributionsCollection { commitContributionsByRepository { contributions { nodes {

    commitCount } } } } repositories(first: 100) @defer { nodes { name issues(first: 100) { nodes { body } } } } issues(first: 100) @defer { edges { node { author { login } } } }
  5. type User { name: String! nameForAndroid: String! age: Int! ageForThisOneClient:

    Int! friends: [User!]! friendsForXBOX: [XBOXFriend!]! }
  6. type User { name: String! nameForAndroid: String! age: Int! ageForThisOneClient:

    Int! friends: [User!]! friendsForXBOX: [XBOXFriend!]! }