BOD-118 Added Saga to start conversations from anywhere. Removed gql apollo-boost due to package size and replaced with graphql-tag

This commit is contained in:
Patrick Fic
2020-05-04 15:11:14 -07:00
parent 782b7fe7f3
commit b7d438a0f0
38 changed files with 222 additions and 136 deletions

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const INSERT_ALLOCATION = gql`
mutation INSERT_ALLOCATION($alloc: [allocations_insert_input!]!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
query QUERY_ALL_ACTIVE_APPOINTMENTS {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_ALL_ASSOCIATIONS = gql`
query QUERY_ALL_ASSOCIATIONS {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_AUDIT_TRAIL = gql`
query QUERY_AUDIT_TRAIL($id: uuid!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_AVAILABLE_NEW_JOBS = gql`
query QUERY_AVAILABLE_NEW_JOBS {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_BODYSHOP = gql`
query QUERY_BODYSHOP {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const INSERT_NEW_CONTRACT = gql`
mutation INSERT_NEW_CONTRACT($contract: [cccontracts_insert_input!]!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const CONVERSATION_LIST_SUBSCRIPTION = gql`
subscription CONVERSATION_LIST_SUBSCRIPTION {
@@ -45,3 +45,21 @@ export const CONVERSATION_SUBSCRIPTION_BY_PK = gql`
}
}
`;
export const CONVERSATION_ID_BY_PHONE = gql`
query CONVERSATION_ID_BY_PHONE($phone: String!) {
conversations(where: { phone_num: { _eq: $phone } }) {
id
}
}
`;
export const CREATE_CONVERSATION = gql`
mutation CREATE_CONVERSATION($conversation: [conversations_insert_input!]!) {
insert_conversations(objects: $conversation) {
returning {
id
}
}
}
`;

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const INSERT_NEW_COURTESY_CAR = gql`
mutation INSERT_NEW_COURTESY_CAR(

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const GET_DOCUMENTS_BY_JOB = gql`
query GET_DOCUMENTS_BY_JOB($jobId: uuid!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_EMPLOYEES = gql`
query QUERY_EMPLOYEES {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const INSERT_NEW_INVOICE = gql`
mutation INSERT_NEW_INVOICE($invoice: [invoices_insert_input!]!) {

View File

@@ -1,9 +1,10 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const INSERT_CONVERSATION_TAG = gql`
mutation INSERT_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
insert_job_conversations(
objects: { conversationid: $conversationId, jobid: $jobId }
on_conflict: { constraint: job_conversations_pkey, update_columns: jobid }
) {
returning {
jobid

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const GET_JOB_LINES_BY_PK = gql`
query GET_JOB_LINES_BY_PK($id: uuid!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_ALL_ACTIVE_JOBS = gql`
query QUERY_ALL_ACTIVE_JOBS($statuses: [String!]!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const MARK_MESSAGES_AS_READ_BY_CONVERSATION = gql`
mutation MARK_MESSAGES_AS_READ_BY_CONVERSATION($conversationId: uuid) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const GET_LANDING_NAV_ITEMS = gql`
query nav_items {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const INSERT_NEW_NOTE = gql`
mutation INSERT_NEW_NOTE($noteInput: [notes_insert_input!]!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_SEARCH_OWNER_BY_IDX = gql`
query QUERY_SEARCH_OWNER_BY_IDX($search: String!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const INSERT_NEW_PARTS_ORDERS = gql`
mutation INSERT_NEW_PARTS_ORDERS($po: [parts_orders_insert_input!]!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_TEMPLATES_BY_NAME = gql`
query QUERY_TEMPLATES_BY_NAME($name: String!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_TICKETS_BY_JOBID = gql`
query QUERY_TICKETS_BY_JOBID($jobid: uuid!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const UPSERT_USER = gql`
mutation UPSERT_USER($authEmail: String!, $authToken: String!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_VEHICLE_BY_ID = gql`
query QUERY_VEHICLE_BY_ID($id: uuid!) {

View File

@@ -1,4 +1,4 @@
import { gql } from "apollo-boost";
import gql from "graphql-tag";
export const QUERY_VENDOR_BY_ID = gql`
query QUERY_VENDOR_BY_ID($id: uuid!) {