練習graphql-API
Playground<-練習リンク
チョルスの年齢は何歳ですか.△年齢のみを調べてください.Input3番の投稿の内容と作成日は何ですか?(内容と記入日のみを照会してください.) Input本人の名前で履歴書に記入してください. Input本人の名前で投稿を書いてください. Input自分の個人情報を調べてください. Inputを調べてください. Input本人の履歴書で、学校を卒業した小学校に変えた. Input本人の投稿で、タイトルと内容を変更してください. Input自分の好きな漫画の主人公で履歴書を書きましょう. Inputの上位10ビットのプロファイルを削除します. Inputの商品を作ってみます. Input位12位で作った商品の価格を500元引き上げる. Inputで作成された商品を検索し、価格のみを検索します. Inputの商品を削除してください. Input削除された商品が本当に削除されたかどうかをもう一度調べてください. Input投稿リストで、2ページ目を参照してください. Input投稿リストを参照するときにpageを入力しないと、どのような結果が得られますか? Input default値があります.出力結果は「page:1」と同じです. 合計プロファイルがいくつあるか見てみましょう. Inputにはいくつの投稿がありますか? Input
チョルスの年齢は何歳ですか.△年齢のみを調べてください.Input
query {
fetchProfile(name: "철수") {
age
}
}
Output{
"data": {
"fetchProfile": {
"age": 20
}
}
}
英姫の学校はどこですか.△学校だけ調べてください.Inputquery {
fetchProfile(name: "영희") {
age
}
}
Output{
"data": {
"fetchProfile": {
"school": "다람쥐초등학교"
}
}
}
query {
fetchBoard(number: 3) {
contents
createdAt
}
}
Output{
"data": {
"fetchBoard": {
"contents": "냉무",
"createdAt": "2021-07-07T05:23:28.118Z"
}
}
}
mutation {
createProfile(name: "Chungsik", age: 20, school: "KAIST"){
message
}
}
Output{
"data": {
"createProfile": {
"message": "프로필이 정상적으로 등록되었습니다."
}
}
}
mutation {
createBoard(
writer: "Chungsik"
password: "1234"
title: "This is a title."
contents: "These are contents."
) {
message
number
}
}
Output{
"data": {
"createBoard": {
"message": "게시물이 정상적으로 등록되었습니다.",
"number": 71
}
}
}
query {
fetchProfile(name: "Chungsik"){
# number
name
age
school
}
}
Output{
"data": {
"fetchProfile": {
"name": "Chungsik",
"age": 20,
"school": "KAIST"
}
}
}
自分の投稿query {
fetchBoard(number: 71){
number
writer
title
contents
like
createdAt
}
}
Output{
"data": {
"fetchBoard": {
"number": 71,
"writer": "Chungsik",
"title": "This is a title.",
"contents": "These are contents.",
"like": 0,
"createdAt": "2021-07-07T08:41:27.584Z"
}
}
}
mutation {
updateProfile(name: "Chungsik", age: 20, school: "POSTECH"){
# _id
# number
message
}
}
Output{
"data": {
"updateProfile": {
"_id": null,
"number": null,
"message": "프로필이 정상적으로 수정되었습니다."
}
}
}
mutation {
updateBoard(
number: 71
writer: "Chungsik"
# password: "1234"
title: "This is an edited title."
contents: "These are modified contents."
) {
# _id
# number
message
}
}
Output{
"data": {
"updateBoard": {
"message": "게시물이 정상적으로 수정되었습니다."
}
}
}
mutation {
createProfile(name: "Pororo", age: 19, school: "EBS") {
message
}
}
Output{
"data": {
"createProfile": {
"message": "프로필이 정상적으로 등록되었습니다."
}
}
}
mutation {
deleteProfile(name: "Pororo") {
message
}
}
Output{
"data": {
"deleteProfile": {
"message": "프로필이 정상적으로 삭제되었습니다."
}
}
}
mutation {
createProduct(
seller: "Chungsik"
createProductInput: {
name: "Nike Jordan 1"
detail: "Nike X Dior Collaboration Model"
price: 600
}
) {
_id
message
}
}
Output{
"data": {
"createProduct": {
"_id": "f8f63f1b-39d1-477c-950f-8ce32a3bc8c4",
"message": "상품이 정상적으로 등록되었습니다."
}
}
}
mutation {
updateProduct(
productId: "f8f63f1b-39d1-477c-950f-8ce32a3bc8c4"
updateProductInput: {
name: "Nike Jordan 1"
detail: "Nike X Dior Collaboration Model"
price: 1100
}
) {
message
}
}
Output{
"data": {
"updateProduct": {
"message": "상품이 정상적으로 수정되었습니다."
}
}
}
query {
fetchProduct(productId: "f8f63f1b-39d1-477c-950f-8ce32a3bc8c4") {
price
}
}
Output{
"data": {
"fetchProduct": {
"price": 1100
}
}
}
照会mutation {
deleteProduct(productId: "f8f63f1b-39d1-477c-950f-8ce32a3bc8c4") {
message
}
}
Output{
"data": {
"deleteProduct": {
"message": "상품이 정상적으로 삭제되었습니다."
}
}
}
query {
fetchProduct(productId: "f8f63f1b-39d1-477c-950f-8ce32a3bc8c4") {
name
detail
price
}
}
Output{
"data": {
"fetchProduct": null
}
}
query {
fetchBoards(page: 2) {
number
writer
title
contents
}
}
Output{
"data": {
"fetchBoards": [
{
"number": 17,
"writer": "맹구",
"title": "가끔은 눈물을 참을 수 없는 내가 별루 다.",
"contents": "히히히힣히히"
},
{
"number": 16,
"writer": "hard",
"title": "hard",
"contents": "hard하드"
},
{
"number": 15,
"writer": "맹구",
"title": "API",
"contents": "API는 어렵다."
},
{
"number": 14,
"writer": "짱구",
"title": "나는 왜",
"contents": "졸린가,,,"
},
{
"number": 13,
"writer": "Chungsik",
"title": "This is a title.",
"contents": "This is a content."
},
{
"number": 12,
"writer": "shong",
"title": "나는 왜",
"contents": "졸린가,,,"
},
{
"number": 11,
"writer": "코캠",
"title": "코캠파이팅",
"contents": "하하"
},
{
"number": 10,
"writer": "영은",
"title": "호두자두 사랑해",
"contents": "호두자두 일상글"
},
{
"number": 9,
"writer": "스펀지밥",
"title": "행복합니다.",
"contents": "잉잉"
},
{
"number": 8,
"writer": "스타벅스",
"title": "아메리카노",
"contents": "조아조아"
}
]
}
}
query {
fetchBoards {
number
writer
title
contents
}
}
Output{
"data": {
"fetchBoards": [
{
"number": 71,
"writer": "Chungsik",
"title": "This is an edited title.",
"contents": "These are modified contents."
},
{
"number": 70,
"writer": "Chungsik",
"title": "This is a title.",
"contents": "These are contents."
},
{
"number": 69,
"writer": "Chungsik",
"title": "This is a title.",
"contents": "These are contents."
},
{
"number": 68,
"writer": "Chungsik",
"title": "This is a title.",
"contents": "These are contents."
},
{
"number": 67,
"writer": "Chungsik",
"title": "This is a title.",
"contents": "These are contents."
},
{
"number": 66,
"writer": "Chungsik",
"title": "This is a title.",
"contents": "These are contents."
},
{
"number": 65,
"writer": "junku",
"title": "노가다",
"contents": "코드도 잘 모르겠다."
},
{
"number": 64,
"writer": "재훈",
"title": "제목2",
"contents": "수정"
},
{
"number": 58,
"writer": "철수",
"title": "제목",
"contents": "내용입니다"
},
{
"number": 18,
"writer": "유리",
"title": "훈이사랑",
"contents": "짱구도사랑"
}
]
}
}
query {
fetchProfilesCount
}
Output{
"data": {
"fetchProfilesCount": 55
}
}
query {
fetchBoardsCount
}
Output{
"data": {
"fetchBoardsCount": 27
}
}
Reference
この問題について(練習graphql-API), 我々は、より多くの情報をここで見つけました https://velog.io/@qkrcndtlr123/graphql-API-연습하기テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol