Getting started with GraphQL!
https://tech.kakao.com/2019/08/01/graphql-basic/
https://www.slideshare.net/shilpe34/typescript-200-graphql-179690400
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
- but, there's a big difference in linguistic structure
- Can load a lot of data with a single request
- Type system
- Provides powerful developer tools
- Takes queries written in
gqlas input, processes the queries and returns the results back to client - GraphQL server
-
- Various Endpoints exist because they combine
URL,METHOD, etc.- Database SQL query differs for each Endpoint
- Various Endpoints exist because they combine
-
- 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!
ex)
type Character {
name: String!
appearIn: [Episode!]!
}
Object type: CharacterField: name, appearInScala type: String, Id, Int etc.!: Required value (non-nullable)[ ,]: Array
- gql query parsing is handled by most gql libraries
- but, the specific process of retrieving data is handled by
resolverand must be implemented directly!
- but, the specific process of retrieving data is handled by
- If the field is a
scalar value(primitive type like string or number), execution terminates- That is, no more chained resolver calls occur