[git] Graphql 4 ( 스키마 )
스키마
스키마는 데이터 structure.
Type
Query
// server 단에서 이렇게 쿼리를 만들면...
type Query {
books: [Book]
authors: [Author]
}
// client
query GetBooksAndAuthors {
books {
title
}
authors: {
name
}
}
Mutation
// server
type Mutation {
addBook(title: String, author: String): Book
}
// client
mutation CreateBook {
addBook(title: "Fox in Socks", author: "Dr. Seuss") {
title
author {
name
}
}
}
#그래퓨큐엘/apollo-server/schema