The httpClient
submodule includes helper functions for making HTTP requests within the Wix platform.
1
fetchWithAuth()
Makes HTTP requests to Wix REST APIs and external endpoints that require a Wix access token, such as endpoints hosted by a Wix app backend. The Wix development framework generates the access token. The token reflects the identity of the current site user and is automatically included in requests from this function as an Authorization
header.
Note: Only use this function to call a Wix REST API if the needed functionality isn't available in the SDK. Otherwise, use the SDK version.
1
Name | Type | Description |
---|---|---|
url | string | URL of the REST API to call. |
options | object | Standard fetch request options. |
Standard fetch()
response.
Call the List Published Site Urls endpoint:
1
graphql()
Calls Wix APIs through the Wix GraphQL API.
Supports queries and mutation.
The Wix GraphQL API is in Alpha and is subject to change.
1
Name | Type | Description |
---|---|---|
query | TypedQueryInput<Result, Variables> | Wix GraphQL query to execute. |
variables | object | Variables to use in the query. Optional. |
Name | Type | Description |
---|---|---|
data | object | Result of the query. The format of the data depends on the query. |
errors | object | GraphQL query errors. This property is not returned if there are no errors. |
Query products using graphQL:
1