refactor: create/update/delete one view instead of many (#1384)
Closes #1359
This commit is contained in:
10
front/src/modules/views/graphql/mutations/createView.ts
Normal file
10
front/src/modules/views/graphql/mutations/createView.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const CREATE_VIEW = gql`
|
||||
mutation CreateView($data: ViewCreateInput!) {
|
||||
view: createOneView(data: $data) {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1,9 +0,0 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const CREATE_VIEWS = gql`
|
||||
mutation CreateViews($data: [ViewCreateManyInput!]!) {
|
||||
createManyView(data: $data) {
|
||||
count
|
||||
}
|
||||
}
|
||||
`;
|
||||
10
front/src/modules/views/graphql/mutations/deleteView.ts
Normal file
10
front/src/modules/views/graphql/mutations/deleteView.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const DELETE_VIEW = gql`
|
||||
mutation DeleteView($where: ViewWhereUniqueInput!) {
|
||||
view: deleteOneView(where: $where) {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1,9 +0,0 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const DELETE_VIEWS = gql`
|
||||
mutation DeleteViews($where: ViewWhereInput!) {
|
||||
deleteManyView(where: $where) {
|
||||
count
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -2,7 +2,7 @@ import { gql } from '@apollo/client';
|
||||
|
||||
export const UPDATE_VIEW = gql`
|
||||
mutation UpdateView($data: ViewUpdateInput!, $where: ViewWhereUniqueInput!) {
|
||||
updateOneView(data: $data, where: $where) {
|
||||
view: updateOneView(data: $data, where: $where) {
|
||||
id
|
||||
name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user