Skip to content

Latest commit

 

History

History
126 lines (119 loc) · 1.18 KB

query-examples.md

File metadata and controls

126 lines (119 loc) · 1.18 KB

Query examples

query User {
  user(id: "u-1") {
    id
    name
    birthDate
    reviews {
      id
      author {
        id
        name
      }
      body
      product {
        name
      }
    }
    recentPurchases {
      id
      name
      price
    }
  }
}
query Me {
  me {
    id
    name
    birthDate
  }
}
query Products {
  products {
    id
    name
    reviews {
      author {
        name
      }
      product {
        id
        name
      }
    }
  }
}
query ProductById {
  product(id: "p-3") {
    id
    name
    price
    reviews {
      body
    }
  }
}
query Reviews {
  reviews {
    id
    body
    author {
      id
      name
      birthDate
    }
    product {
      id
      name
    }
  }
}
query ReviewById {
  review(id: "r-3") {
    id
    body
    author {
      name
      reviews {
        body
      }
    }
    product {
      name
      reviews {
        id
        body
      }
    }
  }
}
query TopReviews {
  topReviews(first: 2) {
    id
    body
    author {
      id
      name
    }
    product {
      name
      id
      price
    }
  }
}