PWA Studio only. Learn more.

contactUs mutation

The contactUs mutation submits the contents of the Contact Us form.

Syntax

mutation: contactUs(input: ContacUsInput!): ContactUsOutput

Example usage

The following example adds a Contact Us form to the site.

Request:

1
2
3
4
5
6
7
8
9
10
11
mutation {
  contactUs(
    input: {
      comment: "My comment",
      email: "bobloblaw@example.com",
      telephone: "(555)-CALL-BOB",
      name: "Bob Loblaw" }
      ) {
    status
  }
}

Response:

1
2
3
4
5
6
7
{
  "data": {
    "contactUs": {
      "status": true
    }
  }
}

Input attributes

The contactUs mutation requires the contactUsInput object.

contactUsInput object

The contactUsInput object must contain the following attributes:

Attribute Data Type Description
email String! The email address of the shopper
name String! The full name of the shopper
telephone String The shopper’s telephone number
comment String! The shopper’s comment to the merchant

Output attributes

The contactUsOutput object returns a Boolean value indicting the success or failure of the request.

Attribute Data Type Description
status Boolean! Indicates whether the request was successful