GraphQL Crash Course

GraphQL Crash Course

32.989 Lượt nghe
GraphQL Crash Course
💻 More software engineering videos https://www.youtube.com/playlist?list=PLQnljOFTspQXOkIpdwjsMlVqkIffdqZ2K GraphQL Pros and Cons, examples and when to use over REST GraphQL is an open source query language developed by facebook that allows clients to formulate queries to get different results. Its main goal is to combine multiple services into one endpoint. In this video we will discuss what is GraphQL, why facebook developed it, go through some examples using github GraphQL API, finally we will discuss the pros and cons and when you should use this technology. - What is GraphQL? - Examples - Pros and Cons - when to use REST vs GRAPHQL What is GraphQL - Schema - Query language - Nesting - Mutation and subscription Examples Schema intro Github API Rest api Pros - Flexibility - efficient response : payload back only get what you want of fields since you know the schema - No round trips- Avoiding multiple round trips (HATEOS REST) - Uniform single interface API endpoint - Self documenting Cons - Complexity - Typed system - ( use it to know if a type is available or not and fork logic) slows down adoption.. same as soap - No Caching etag since always POST - Error management non-standard for HTTP. - Over engineering can lead to Inefficiency of the joins can lead to performance and DOS https://developer.github.com/v4/guides/intro-to-graphql/#discovering-the-graphql-api WHEN TO USE GRAPHQL Public ad-hoc API that you can’t predict how it will be used Specific and well-design use cases API Simple API that serves one client (webpage) Enterprise API (new york times) Well defined schema Without the need of performing multiple round trips. It as a reaction to certain limitations of the REST API. Schema all post except schema call get via fetch api Source Code for RESTAPI vs GraphQL https://github.com/hnasr/javascript_playground/tree/master/graphql_vs_restapi Jump Codes 2:30 What is GraphQL? 13:50 Properties of GraphQL 18:00 Examples 34:00 Pros and Cons 47:10 When to use GraphQL over REST Cards 4:00 REST API 31:20 GIT HUB REST API 33:00 Caddy Web Server 43:55 GET VS POST Support me on PayPal https://bit.ly/33ENps4 Become A Patron https://www.patreon.com/join/hnasr? Stay Awesome! Hussein