Intro to GraphQL
Getting started with GraphQL!
https://tech.kakao.com/2019/08/01/graphql-basic/
https://www.slideshare.net/shilpe34/typescript-200-graphql-179690400
What is GraphQL?
Query Language for APIs!
Query Language like SQL (Structured Query Language)
but, there's a big difference in linguistic structure
As a result, the utilization of these two is different
Purpose of use
sql: Purpose is to efficiently retrieve data stored in DBgql: Purpose is for Web Client to efficiently retrieve data from server
Calling
sql: Written and called in Backend systemgql: Written and called in Client system
Can load a lot of data with a single request
Type system
Provides powerful developer tools
Serverside GraphQL application
Takes queries written in
gqlas input, processes the queries and returns the results back to clientGraphQL server
Differences between REST API and GraphQL API
REST API
Various Endpoints exist because they combine
URL,METHOD, etc.Database SQL query differs for each Endpoint
gql API
Only one Endpoint exists
The type of data to load is determined through query combinations
Database SQL query differs for each gql schema type
The advantages and disadvantages of each change depending on the configured infrastructure, business model, and purpose of use!
schema / type
ex)
Object type: CharacterField: name, appearInScala type: String, Id, Int etc.!: Required value (non-nullable)[ ,]: Array
Resolver
gql query parsing is handled by most gql libraries
but, the specific process of retrieving data is handled by
resolverand must be implemented directly!
If the field is a
scalar value(primitive type like string or number), execution terminatesThat is, no more chained resolver calls occur
Last updated