feat: disable atomic operation on nestjs graphql models (#751)
* feat: no atomic * feat: update front not atomic operations * feat: optional fields for person model & use proper gql type * Fix bug display name * Fix bug update user * Fixed bug avatar URL * Fixed display name on people cell * Fix lint * Fixed storybook display name * Fix storybook requests --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -1,29 +1,11 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const UPDATE_PERSON = gql`
|
||||
mutation UpdatePeople(
|
||||
$id: String
|
||||
$firstName: String
|
||||
$lastName: String
|
||||
$phone: String
|
||||
$city: String
|
||||
$companyId: String
|
||||
$email: String
|
||||
$createdAt: DateTime
|
||||
export const UPDATE_ONE_PERSON = gql`
|
||||
mutation UpdateOnePerson(
|
||||
$where: PersonWhereUniqueInput!
|
||||
$data: PersonUpdateInput!
|
||||
) {
|
||||
updateOnePerson(
|
||||
where: { id: $id }
|
||||
data: {
|
||||
city: { set: $city }
|
||||
company: { connect: { id: $companyId } }
|
||||
email: { set: $email }
|
||||
firstName: { set: $firstName }
|
||||
id: { set: $id }
|
||||
lastName: { set: $lastName }
|
||||
phone: { set: $phone }
|
||||
createdAt: { set: $createdAt }
|
||||
}
|
||||
) {
|
||||
updateOnePerson(data: $data, where: $where) {
|
||||
id
|
||||
city
|
||||
company {
|
||||
@ -34,33 +16,16 @@ export const UPDATE_PERSON = gql`
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
phone
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_PERSON = gql`
|
||||
mutation InsertPerson(
|
||||
$id: String!
|
||||
$firstName: String!
|
||||
$lastName: String!
|
||||
$phone: String!
|
||||
$city: String!
|
||||
$email: String!
|
||||
$createdAt: DateTime
|
||||
) {
|
||||
createOnePerson(
|
||||
data: {
|
||||
id: $id
|
||||
firstName: $firstName
|
||||
lastName: $lastName
|
||||
phone: $phone
|
||||
city: $city
|
||||
email: $email
|
||||
createdAt: $createdAt
|
||||
}
|
||||
) {
|
||||
export const INSERT_ONE_PERSON = gql`
|
||||
mutation InsertOnePerson($data: PersonCreateInput!) {
|
||||
createOnePerson(data: $data) {
|
||||
id
|
||||
city
|
||||
company {
|
||||
@ -71,14 +36,15 @@ export const INSERT_PERSON = gql`
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
phone
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_PEOPLE = gql`
|
||||
mutation DeletePeople($ids: [String!]) {
|
||||
export const DELETE_MANY_PERSON = gql`
|
||||
mutation DeleteManyPerson($ids: [String!]) {
|
||||
deleteManyPerson(where: { id: { in: $ids } }) {
|
||||
count
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user