Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Craft effective API with GraphQL and Absinthe - Ihor Katkov

223 views

Published on

Elixir Club 10
March 17, 2018
Kyiv

Published in: Technology
  • Be the first to comment

Craft effective API with GraphQL and Absinthe - Ihor Katkov

  1. 1. Craft effective API with GraphQL and Absinthe by Ihor Katkov
  2. 2. WHO AM I?
  3. 3. N+1 issue GET /coins?limit=10&start=0 GET /coins/btc GET /coins/btc/history GET /coins/btc/exchanges?page=1&limit=2 GET /exchanges/binance GET /exchanges/kuna “GraphQL prevents HTTP overfetching”
  4. 4. GraphQL prevents HTTP overfetching QUERY RESULT
  5. 5. Stop! We can include all the info into one payload!
  6. 6. What about a pagination?
  7. 7. What about a pagination? Answer: Relay Cursor Connections
  8. 8. EFFICIENT PAGINATION QUERY RESULT
  9. 9. EFFICIENT PAGINATION QUERY RESULT
  10. 10. EFFICIENT PAGINATION QUERY RESULT
  11. 11. YOUR FRONTEND TEAM GUY GONNA SAY
  12. 12. INSERTING DATA?
  13. 13. MUTATIONS
  14. 14. SUBSCRIPTIONS
  15. 15. EFFICIENT REAL-TIME QUERY RESULT
  16. 16. WHAT IF… ERRORS?
  17. 17. COMPILE-TIME ERROR
  18. 18. RUNTIME ERROR
  19. 19. WHAT ABOUT ELIXIR?
  20. 20. DECLARE AN OBJECT
  21. 21. DECLARE AN INTERFACE
  22. 22. QUERY ENTRY POINT
  23. 23. MUTATION ENTRY POINT
  24. 24. SUBSCRIPTION ENTRY POINT
  25. 25. RESOLVING IT
  26. 26. RETURNING ERRORS
  27. 27. VERSIONING
  28. 28. AS EASY AS DEPRECATE
  29. 29. COMPLEXITY
  30. 30. LIMITING QUERY BY COMPLEXITY
  31. 31. CUSTOM FIELD COMPLEXITY WITH DATALOADER
  32. 32. CUSTOM FIELD COMPLEXITY
  33. 33. TOOLS
  34. 34. GRAPHIQL SIMPLE
  35. 35. GRAPHIQL ADVANCED
  36. 36. GRAPHQL PLAYGROUND
  37. 37. ABSINTHE HAS IT ALL!
  38. 38. LEARNING RESOURCES
  39. 39. LINKS Documentation: https://hexdocs.pm/absinthe/overview.html Book: https://pragprog.com/book/wwgraphql/craft-graphql-apis-in-elixir-with-absinthe Project example: https://github.com/ihorkatkov/coinmarketcap-graphql-example
  40. 40. {:ok, “THANK YOU!”} Questions?

×