A sample cloud of examples built on Apollo Federation.
# Create or Authorize a User
mutation authorize($email: String!, $password: String!) {
authorize(email: $email, password: $password) {
token
user {
name
}
}
}
mutation create($create: CreateUserForm!) {
createAccount(input: $create) {
token
user {
email
name
}
}
}
{
"email": "[email protected]",
"password": "badPassword",
"create": {
"email": "[email protected]",
"name": "Jungle Cat",
"password": "badPassword"
}
}
query myInfo {
me {
email
name
postedColors {
id
title
value
reviews {
advRating
reviews {
rating
comment
}
}
}
}
}
{
"authorization": "Bearer <TOKEN>"
}
mutation add($title: String!, $value: String!) {
addColor(title: $title, value: $value) {
id
title
createdBy {
email
name
}
}
}
{
"title": "Grand",
"value": "#00FF00"
}
query allColors {
allColors {
id
title
value
createdBy {
name
}
reviews {
advRating
yourReview {
rating
comment
}
reviews {
rating
comment
}
}
}
}
mutation rateColor($input: ReviewForm!) {
addReview(input: $input) {
id
rating
comment
color {
title
value
}
user {
email
name
}
}
}
{
"input": {
"itemID": "O6z9tliSS",
"rating": 2,
"comment": "This color isn't beautiful"
}
}