Moving queries into dedicated files (#1210)
* Moving queries into dedicated files * fix ci
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const DELETE_FAVORITE = gql`
|
||||
mutation DeleteFavorite($where: FavoriteWhereInput!) {
|
||||
deleteFavorite(where: $where) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,14 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const INSERT_COMPANY_FAVORITE = gql`
|
||||
mutation InsertCompanyFavorite($data: FavoriteMutationForCompanyArgs!) {
|
||||
createFavoriteForCompany(data: $data) {
|
||||
id
|
||||
company {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,15 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const INSERT_PERSON_FAVORITE = gql`
|
||||
mutation InsertPersonFavorite($data: FavoriteMutationForPersonArgs!) {
|
||||
createFavoriteForPerson(data: $data) {
|
||||
id
|
||||
person {
|
||||
id
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1,14 +1,14 @@
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
|
||||
import { GET_COMPANY } from '@/companies/queries';
|
||||
import { GET_PERSON } from '@/people/queries/show';
|
||||
import { GET_COMPANY } from '@/companies/graphql/queries/getCompany';
|
||||
import { GET_PERSON } from '@/people/graphql/queries/getPerson';
|
||||
import {
|
||||
useDeleteFavoriteMutation,
|
||||
useInsertCompanyFavoriteMutation,
|
||||
useInsertPersonFavoriteMutation,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
import { GET_FAVORITES } from '../queries/show';
|
||||
import { GET_FAVORITES } from '../graphql/queries/getFavorites';
|
||||
|
||||
export function useFavorites() {
|
||||
const [insertCompanyFavoriteMutation] = useInsertCompanyFavoriteMutation();
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const INSERT_PERSON_FAVORITE = gql`
|
||||
mutation InsertPersonFavorite($data: FavoriteMutationForPersonArgs!) {
|
||||
createFavoriteForPerson(data: $data) {
|
||||
id
|
||||
person {
|
||||
id
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_COMPANY_FAVORITE = gql`
|
||||
mutation InsertCompanyFavorite($data: FavoriteMutationForCompanyArgs!) {
|
||||
createFavoriteForCompany(data: $data) {
|
||||
id
|
||||
company {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_FAVORITE = gql`
|
||||
mutation DeleteFavorite($where: FavoriteWhereInput!) {
|
||||
deleteFavorite(where: $where) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user