validateSession
Updates a web session with the specified values. Use this mutation to change locale or currency, for example.
Usage​
Arguments​
session*IStoreSession!Description
Web session information.
search*String!Description
Search term.
Fields​
Below you can see a list of fields that can be returned by the validateSession mutation. Click on the links to learn more details about each field.
validateSession: StoreSession
Mutation structure​
mutation {
  validateSession (
    session: {
        # IStoreSession fields
    },
    search: ""
  )
  {
    # StoreSession fields
  }
}
Example​
Validating session with locale, currency, country and the shopper's information, while also fetching the same data.
- Mutation
 - Variables
 - Response
 
mutation validateSession($session: IStoreSession!, $search: String!) {
  validateSession (session: $session, search: $search)
  {
    locale,
    country,
    currency {
      code,
      symbol
    },
    person {
      email,
      givenName
    }
  }
}
{
    "session": {
      "person": {
        "email": "hal.jordan@examplemail.com",
        "id": "123456789abc",
        "givenName": "Hal",
        "familyName": "Jordan"
      },
      "locale": "EN",
      "currency": {
        "code": "USD",
        "symbol": "$"
      },
      "country": "USA"
  },
  "search": "computer"
}
{
    data: {
        "validateSession": {
            "locale": "EN",
            "country": "USA",
            "currency": {
                "code": "USD",
                "symbol": "$"
            },
            "person": {
                "email": "hal.jordan@examplemail.com",
                "givenName": "Hal"
            }
        } 
    }
}