saleor-dashboard/src/webhooks/queries.ts

65 lines
1.2 KiB
TypeScript
Raw Normal View History

import { webhooksFragment } from "@saleor/fragments/webhooks";
import makeQuery from "@saleor/hooks/makeQuery";
2019-10-09 06:01:52 +00:00
import gql from "graphql-tag";
2019-10-30 14:34:24 +00:00
import {
WebhookDetails,
WebhookDetailsVariables
} from "./types/WebhookDetails";
2019-10-09 06:01:52 +00:00
import { Webhooks, WebhooksVariables } from "./types/Webhooks";
const webhooksList = gql`
${webhooksFragment}
query Webhooks(
$first: Int
$after: String
$last: Int
$before: String
$filter: WebhookFilterInput
2019-12-17 17:13:56 +00:00
$sort: WebhookSortingInput
) {
webhooks(
first: $first
after: $after
before: $before
last: $last
filter: $filter
2019-12-17 17:13:56 +00:00
sortBy: $sort
) {
2019-10-09 06:01:52 +00:00
edges {
node {
2019-10-09 06:56:46 +00:00
...WebhookFragment
2019-10-09 06:01:52 +00:00
}
}
pageInfo {
hasPreviousPage
hasNextPage
startCursor
endCursor
}
}
}
`;
2019-12-17 17:13:56 +00:00
export const useWebhooksListQuery = makeQuery<Webhooks, WebhooksVariables>(
2019-10-09 06:01:52 +00:00
webhooksList
);
const webhooksDetails = gql`
${webhooksFragment}
2019-10-11 13:35:33 +00:00
query WebhookDetails($id: ID!) {
2019-10-09 06:01:52 +00:00
webhook(id: $id) {
2019-10-09 06:56:46 +00:00
...WebhookFragment
events {
eventType
}
secretKey
targetUrl
2019-10-09 06:01:52 +00:00
}
}
`;
Apps (#599) * create Apps view * create more app components, generate types and messages * apps refactor, update snapshots * show error message in tooltip when app installation fail * update apps components and view, add apps list to storybook * update defaultMessages * create app details view * update AppListPage with Skeleton component * create app activate/deactivate dialogs, create app details stories * add AppHeader to AppDetailsPage * update defaultMessages * update AppDetails view and components after review * create custom app details view * refactor webhooks * update webhooks fixtures * update WebhookDetailsPage story * update strings * create CustomAppCreate view and components * update AppListPage story * create AppInstall view and page * handle errors in AppInstall view * update defaultMessages * add AppInstallPage to storybook * add status prop to MessageManager * update defaultMessages * remove service account section * remove service account routes * remove as operator from notify status * add notifications for app installations * update styles for deactivated app * update app installations with local storage * update defaultMessages * AppInstall update * dd delete button to ongoin installations table * fix active installations condition * fix error messages in AppsList * update defaultMessages * add iframe to AppDetailsPage * create AppDetailsSettingsPage * install macaw-ui * apps styles clean up * update schema, fixtures * few apps updates * WebhookCreate - fix onBack button name * WebhookCreatePage story update * rename apps table from external to thirdparty * update defaultMessages * fix test, update snapshots * AppDetailsSettings - add token to headers * fix first number in local apps query * app details settings - use shop domain host * add onSettingsRowClick to InstalledApps * resolve conflicts * update changelog and messages * add noopener noreferrer do app privacy link * update snapshots * update snapshots * updates after review * update defaultMessages * CustomAppDetails - add missing notify status
2020-07-22 10:54:15 +00:00
export const useWebhooksDetailsQuery = makeQuery<
2019-10-30 14:34:24 +00:00
WebhookDetails,
WebhookDetailsVariables
>(webhooksDetails);