UiDevkitClient
setTargetOrigin
Set the window.postMessage API
targetOrigin
. The Vendure ui-devkit uses the postMessage API to
enable cross-frame and cross-origin communication between the ui extension code and the Admin UI
app. The targetOrigin
is a security feature intended to provide control over where messages are sent.
Signature
function setTargetOrigin(value: string): void
Parameters
value
parameter
type:
string
graphQlQuery
Perform a GraphQL query and returns either an Observable or a Promise of the result.
Signature
function graphQlQuery<T, V extends { [key: string]: any }>(document: string, variables?: { [key: string]: any }, fetchPolicy?: WatchQueryFetchPolicy): {
then: Promise<T>['then'];
stream: Observable<T>;
}
Parameters
document
parameter
type:
string
variables
parameter
type:
{ [key: string]: any }
fetchPolicy
parameter
type:
WatchQueryFetchPolicy
graphQlMutation
Perform a GraphQL mutation and returns either an Observable or a Promise of the result.
Signature
function graphQlMutation<T, V extends { [key: string]: any }>(document: string, variables?: { [key: string]: any }): {
then: Promise<T>['then'];
stream: Observable<T>;
}
Parameters
document
parameter
type:
string
variables
parameter
type:
{ [key: string]: any }
notify
Display a toast notification.
Signature
function notify(options: NotificationMessage['data']): void
Parameters
options
parameter
type:
NotificationMessage['data']