Moving queries into dedicated files (#1210)
* Moving queries into dedicated files * fix ci
This commit is contained in:
@ -0,0 +1,11 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const INSERT_PERSON_FRAGMENT = gql`
|
||||
fragment InsertPersonFragment on Person {
|
||||
id
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
createdAt
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,9 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const DELETE_MANY_PERSON = gql`
|
||||
mutation DeleteManyPerson($ids: [String!]) {
|
||||
deleteManyPerson(where: { id: { in: $ids } }) {
|
||||
count
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,9 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const INSERT_ONE_PERSON = gql`
|
||||
mutation InsertOnePerson($data: PersonCreateInput!) {
|
||||
createOnePerson(data: $data) {
|
||||
...InsertPersonFragment
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const REMOVE_PERSON_PICTURE = gql`
|
||||
mutation RemovePersonPicture($where: PersonWhereUniqueInput!) {
|
||||
updateOnePerson(data: { avatarUrl: null }, where: $where) {
|
||||
id
|
||||
avatarUrl
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,27 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const UPDATE_ONE_PERSON = gql`
|
||||
mutation UpdateOnePerson(
|
||||
$where: PersonWhereUniqueInput!
|
||||
$data: PersonUpdateInput!
|
||||
) {
|
||||
updateOnePerson(data: $data, where: $where) {
|
||||
id
|
||||
city
|
||||
company {
|
||||
domainName
|
||||
name
|
||||
id
|
||||
}
|
||||
email
|
||||
jobTitle
|
||||
linkedinUrl
|
||||
xUrl
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
phone
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,7 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const UPDATE_PERSON_PICTURE = gql`
|
||||
mutation UploadPersonPicture($id: String!, $file: Upload!) {
|
||||
uploadPersonPicture(id: $id, file: $file)
|
||||
}
|
||||
`;
|
||||
30
front/src/modules/people/graphql/queries/getPeople.ts
Normal file
30
front/src/modules/people/graphql/queries/getPeople.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PEOPLE = gql`
|
||||
query GetPeople(
|
||||
$orderBy: [PersonOrderByWithRelationInput!]
|
||||
$where: PersonWhereInput
|
||||
$limit: Int
|
||||
) {
|
||||
people: findManyPerson(orderBy: $orderBy, where: $where, take: $limit) {
|
||||
id
|
||||
phone
|
||||
email
|
||||
city
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
jobTitle
|
||||
linkedinUrl
|
||||
xUrl
|
||||
avatarUrl
|
||||
createdAt
|
||||
_activityCount
|
||||
company {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
35
front/src/modules/people/graphql/queries/getPerson.ts
Normal file
35
front/src/modules/people/graphql/queries/getPerson.ts
Normal file
@ -0,0 +1,35 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PERSON = gql`
|
||||
query GetPerson($id: String!) {
|
||||
findUniquePerson(id: $id) {
|
||||
id
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
email
|
||||
createdAt
|
||||
city
|
||||
jobTitle
|
||||
linkedinUrl
|
||||
xUrl
|
||||
avatarUrl
|
||||
phone
|
||||
_activityCount
|
||||
company {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
Favorite {
|
||||
id
|
||||
person {
|
||||
id
|
||||
}
|
||||
company {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
10
front/src/modules/people/graphql/queries/getPersonCity.ts
Normal file
10
front/src/modules/people/graphql/queries/getPersonCity.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PERSON_CITY = gql`
|
||||
query GetPersonCityById($id: String!) {
|
||||
person: findUniquePerson(id: $id) {
|
||||
id
|
||||
city
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PERSON_COMMENT_COUNT = gql`
|
||||
query GetPersonCommentCountById($id: String!) {
|
||||
person: findUniquePerson(id: $id) {
|
||||
id
|
||||
_activityCount
|
||||
}
|
||||
}
|
||||
`;
|
||||
14
front/src/modules/people/graphql/queries/getPersonCompany.ts
Normal file
14
front/src/modules/people/graphql/queries/getPersonCompany.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PERSON_COMPANY = gql`
|
||||
query GetPersonCompanyById($id: String!) {
|
||||
person: findUniquePerson(id: $id) {
|
||||
id
|
||||
company {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PERSON_CREATED_AT = gql`
|
||||
query GetPersonCreatedAtById($id: String!) {
|
||||
person: findUniquePerson(id: $id) {
|
||||
id
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
10
front/src/modules/people/graphql/queries/getPersonEmail.ts
Normal file
10
front/src/modules/people/graphql/queries/getPersonEmail.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PERSON_EMAIL = gql`
|
||||
query GetPersonEmailById($id: String!) {
|
||||
person: findUniquePerson(id: $id) {
|
||||
id
|
||||
email
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,13 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PERSON_NAMES_AND_COMMENT_COUNT = gql`
|
||||
query GetPersonNamesAndCommentCountById($id: String!) {
|
||||
person: findUniquePerson(id: $id) {
|
||||
id
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
_activityCount
|
||||
}
|
||||
}
|
||||
`;
|
||||
10
front/src/modules/people/graphql/queries/getPersonPhone.ts
Normal file
10
front/src/modules/people/graphql/queries/getPersonPhone.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_PERSON_PHONE = gql`
|
||||
query GetPersonPhoneById($id: String!) {
|
||||
person: findUniquePerson(id: $id) {
|
||||
id
|
||||
phone
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user