saleor-dashboard/src/apps/mutations.ts
Dominik Żegleń 5b85d6c086
Use graphql-codegen (#1874)
* Use generated hooks in apps

* Remove unused files

* Use proper types in apps

* Use generated hooks in attributes

* Use generated hooks in auth module

* Use generated hooks in categories

* Use generated hooks in channels

* Use generated types in collections

* Remove legacy types from background tasks

* Use generated hooks in customers

* Use generated hooks in discounts

* Use generated hook in file upload

* Use generated types in gift cards

* Use generated types in home

* Use generated hooks in navigation

* Use generated hooks in orders

* Use generated hooks in pages

* Use generated hooks in page types

* Use generated hooks in permission groups

* Use generated hooks in plugins

* Use generated hooks in products

* Use fragment to mark product variants

* Improve code a bit

* Use generated hooks in page types

* Use generated types in searches

* Use generated hooks in shipping

* Use generated hooks in site settings

* Use generated hooks in staff members

* Use generated hooks in taxes

* Place all gql generated files in one directory

* Use generated hooks in translations

* Use global types from new generated module

* Use generated hooks in warehouses

* Use generated hooks in webhooks

* Use generated fragment types

* Unclutter types

* Remove hoc components

* Split hooks and types

* Fetch introspection file

* Delete obsolete schema file

* Fix rebase artifacts

* Fix autoreplace

* Fix auth provider tests

* Fix urls

* Remove leftover types

* Fix rebase artifacts
2022-03-09 09:56:55 +01:00

173 lines
2.8 KiB
TypeScript

import { gql } from "@apollo/client";
export const appCreateMutation = gql`
mutation AppCreate($input: AppInput!) {
appCreate(input: $input) {
authToken
app {
...App
}
errors {
...AppError
}
}
}
`;
export const appDeleteMutation = gql`
mutation AppDelete($id: ID!) {
appDelete(id: $id) {
app {
...App
}
errors {
...AppError
}
}
}
`;
export const appDeleteFailedInstallationMutation = gql`
mutation AppDeleteFailedInstallation($id: ID!) {
appDeleteFailedInstallation(id: $id) {
appInstallation {
id
status
appName
message
}
errors {
...AppError
}
}
}
`;
export const appFetchMutation = gql`
mutation AppFetch($manifestUrl: String!) {
appFetchManifest(manifestUrl: $manifestUrl) {
manifest {
identifier
version
about
name
appUrl
configurationUrl
tokenTargetUrl
dataPrivacy
dataPrivacyUrl
homepageUrl
supportUrl
permissions {
code
name
}
}
errors {
...AppError
}
}
}
`;
export const appInstallMutation = gql`
mutation AppInstall($input: AppInstallInput!) {
appInstall(input: $input) {
appInstallation {
id
status
appName
manifestUrl
}
errors {
...AppError
}
}
}
`;
export const appRetryInstallMutation = gql`
mutation AppRetryInstall($id: ID!) {
appRetryInstall(id: $id) {
appInstallation {
id
status
appName
manifestUrl
}
errors {
...AppError
}
}
}
`;
export const appUpdateMutation = gql`
mutation AppUpdate($id: ID!, $input: AppInput!) {
appUpdate(id: $id, input: $input) {
app {
...App
permissions {
code
name
}
}
errors {
...AppError
message
permissions
}
}
}
`;
export const appTokenCreateMutation = gql`
mutation AppTokenCreate($input: AppTokenInput!) {
appTokenCreate(input: $input) {
appToken {
name
authToken
id
}
authToken
errors {
...AppError
}
}
}
`;
export const appTokenDeleteMutation = gql`
mutation AppTokenDelete($id: ID!) {
appTokenDelete(id: $id) {
appToken {
name
authToken
id
}
errors {
...AppError
}
}
}
`;
export const appActivateMutation = gql`
mutation AppActivate($id: ID!) {
appActivate(id: $id) {
errors {
...AppError
}
}
}
`;
export const appDeactivateMutation = gql`
mutation AppDeactivate($id: ID!) {
appDeactivate(id: $id) {
errors {
...AppError
}
}
}
`;