2019-06-19 14:40:52 +00:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
|
|
|
|
import { TypedMutation } from "../mutations";
|
2019-08-09 11:14:35 +00:00
|
|
|
import { fragmentAddress } from "../orders/queries";
|
2019-06-19 14:40:52 +00:00
|
|
|
import { shopFragment } from "./queries";
|
|
|
|
import {
|
|
|
|
AuthorizationKeyAdd,
|
|
|
|
AuthorizationKeyAddVariables
|
|
|
|
} from "./types/AuthorizationKeyAdd";
|
|
|
|
import {
|
|
|
|
AuthorizationKeyDelete,
|
|
|
|
AuthorizationKeyDeleteVariables
|
|
|
|
} from "./types/AuthorizationKeyDelete";
|
|
|
|
import {
|
|
|
|
ShopSettingsUpdate,
|
|
|
|
ShopSettingsUpdateVariables
|
|
|
|
} from "./types/ShopSettingsUpdate";
|
|
|
|
|
|
|
|
const authorizationKeyAdd = gql`
|
|
|
|
${shopFragment}
|
|
|
|
mutation AuthorizationKeyAdd(
|
|
|
|
$input: AuthorizationKeyInput!
|
|
|
|
$keyType: AuthorizationKeyType!
|
|
|
|
) {
|
|
|
|
authorizationKeyAdd(input: $input, keyType: $keyType) {
|
|
|
|
errors {
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
shop {
|
|
|
|
...ShopFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
export const TypedAuthorizationKeyAdd = TypedMutation<
|
|
|
|
AuthorizationKeyAdd,
|
|
|
|
AuthorizationKeyAddVariables
|
|
|
|
>(authorizationKeyAdd);
|
|
|
|
|
|
|
|
const authorizationKeyDelete = gql`
|
|
|
|
${shopFragment}
|
|
|
|
mutation AuthorizationKeyDelete($keyType: AuthorizationKeyType!) {
|
|
|
|
authorizationKeyDelete(keyType: $keyType) {
|
|
|
|
errors {
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
shop {
|
|
|
|
...ShopFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
export const TypedAuthorizationKeyDelete = TypedMutation<
|
|
|
|
AuthorizationKeyDelete,
|
|
|
|
AuthorizationKeyDeleteVariables
|
|
|
|
>(authorizationKeyDelete);
|
|
|
|
|
|
|
|
const shopSettingsUpdate = gql`
|
|
|
|
${shopFragment}
|
2019-08-09 11:14:35 +00:00
|
|
|
${fragmentAddress}
|
2019-06-19 14:40:52 +00:00
|
|
|
mutation ShopSettingsUpdate(
|
|
|
|
$shopDomainInput: SiteDomainInput!
|
|
|
|
$shopSettingsInput: ShopSettingsInput!
|
2019-08-09 11:14:35 +00:00
|
|
|
$addressInput: AddressInput!
|
2019-06-19 14:40:52 +00:00
|
|
|
) {
|
|
|
|
shopSettingsUpdate(input: $shopSettingsInput) {
|
|
|
|
errors {
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
shop {
|
|
|
|
...ShopFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
shopDomainUpdate(input: $shopDomainInput) {
|
|
|
|
errors {
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
shop {
|
|
|
|
domain {
|
|
|
|
host
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-09 11:14:35 +00:00
|
|
|
shopAddressUpdate(input: $addressInput) {
|
|
|
|
errors {
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
shop {
|
|
|
|
companyAddress {
|
|
|
|
...AddressFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-19 14:40:52 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
export const TypedShopSettingsUpdate = TypedMutation<
|
|
|
|
ShopSettingsUpdate,
|
|
|
|
ShopSettingsUpdateVariables
|
|
|
|
>(shopSettingsUpdate);
|