Skip to content

graphql 쿼리 예시

Minwook Je edited this page Feb 10, 2021 · 14 revisions

Place

{
  getPlacesByKeyword(filters: {
    query: "제주도 라면"
    
  }){
    id
    place_name
    category_name
    category_group_code
    category_group_name
    phone
    address_name
    road_address_name
    place_url
    distance
    x
    y
  }
}

Sticker

mutation {
  createSticker(createStickerInput: {
    place_id: "201796840"
    place_name: "할망라면"
    x: 126.525700988171
    y: 33.241145974544
    sticker_category: "당도70"    
  }){
		
    sticker_category
    is_used
    spot(populate:true){
      _id
      place_id
      stickers(populate:false){
        _id
      }
      place_name
      category_name
      category_group_code
      category_group_name
      phone
      address_name
      road_address_name
      place_url
      distance
      x
      y
    }
  }
}

spot

{
  getAllSpots{
    _id
    place_id
    place_name
    stickers(populate:true) {
      _id
      is_used
      spot(populate:false) {
        _id
      }
    }
  }
}

{
  getSpotsByKeyword(keyword:"라면"){
    _id
    place_name
    category_name
    category_group_code
    category_group_name
    phone
    address_name
    road_address_name
    place_url
    distance
    x
    y
    stickers(populate:true){
     is_used 
    }
  }
}
mutation {
  removeSpot(id: "6001ee99ca1c83001503ffd9") {
    n
  }
}

Course

  • 코스 생성
    • 스티커를 먼저 생성 한 뒤, 스티커들을 순서에 맞게 리스트에 넣어준다.
mutation {
  createCourse(createCourseInput: {
    stickers: ["60238405bc7cab131aa133b9","60238425bc7cab131aa133bb","60238440bc7cab131aa133bd"]
    title: "광교 데이트"
    is_share: false
  }){
    _id
    title
    is_share
    stickers

  }
}
  • 코스 이미지 받기
{
  course(courseInput: {
    courseId: "60238477bc7cab131aa133bf"
    courseImageInput: {
      theme: dark
      width: 700
      height: 700
      
    }
    
  }){
    _id
    stickers
    title
    is_share
    courseImage
  }
}

Clone this wiki locally