Moving queries into dedicated files (#1210)

* Moving queries into dedicated files

* fix ci
This commit is contained in:
Weiko
2023-08-14 19:31:20 -07:00
committed by GitHub
parent 656f1af15c
commit 24e5132029
149 changed files with 2908 additions and 3094 deletions

View File

@ -0,0 +1,11 @@
import { gql } from '@apollo/client';
export const INSERT_PERSON_FRAGMENT = gql`
fragment InsertPersonFragment on Person {
id
firstName
lastName
displayName
createdAt
}
`;

View File

@ -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
}
}
`;

View File

@ -0,0 +1,9 @@
import { gql } from '@apollo/client';
export const INSERT_ONE_PERSON = gql`
mutation InsertOnePerson($data: PersonCreateInput!) {
createOnePerson(data: $data) {
...InsertPersonFragment
}
}
`;

View File

@ -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
}
}
`;

View File

@ -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
}
}
`;

View File

@ -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)
}
`;

View 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
}
}
}
`;

View 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
}
}
}
}
`;

View 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
}
}
`;

View File

@ -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
}
}
`;

View 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
}
}
}
`;

View File

@ -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
}
}
`;

View 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
}
}
`;

View File

@ -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
}
}
`;

View 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
}
}
`;