summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/crm/contacts/components/graphql
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/crm/contacts/components/graphql')
-rw-r--r--app/assets/javascripts/crm/contacts/components/graphql/create_contact.mutation.graphql10
-rw-r--r--app/assets/javascripts/crm/contacts/components/graphql/crm_contact_fields.fragment.graphql14
-rw-r--r--app/assets/javascripts/crm/contacts/components/graphql/get_group_contacts.query.graphql13
-rw-r--r--app/assets/javascripts/crm/contacts/components/graphql/update_contact.mutation.graphql10
4 files changed, 47 insertions, 0 deletions
diff --git a/app/assets/javascripts/crm/contacts/components/graphql/create_contact.mutation.graphql b/app/assets/javascripts/crm/contacts/components/graphql/create_contact.mutation.graphql
new file mode 100644
index 00000000000..e0192459609
--- /dev/null
+++ b/app/assets/javascripts/crm/contacts/components/graphql/create_contact.mutation.graphql
@@ -0,0 +1,10 @@
+#import "./crm_contact_fields.fragment.graphql"
+
+mutation createContact($input: CustomerRelationsContactCreateInput!) {
+ customerRelationsContactCreate(input: $input) {
+ contact {
+ ...ContactFragment
+ }
+ errors
+ }
+}
diff --git a/app/assets/javascripts/crm/contacts/components/graphql/crm_contact_fields.fragment.graphql b/app/assets/javascripts/crm/contacts/components/graphql/crm_contact_fields.fragment.graphql
new file mode 100644
index 00000000000..cef4083b446
--- /dev/null
+++ b/app/assets/javascripts/crm/contacts/components/graphql/crm_contact_fields.fragment.graphql
@@ -0,0 +1,14 @@
+fragment ContactFragment on CustomerRelationsContact {
+ __typename
+ id
+ firstName
+ lastName
+ email
+ phone
+ description
+ organization {
+ __typename
+ id
+ name
+ }
+}
diff --git a/app/assets/javascripts/crm/contacts/components/graphql/get_group_contacts.query.graphql b/app/assets/javascripts/crm/contacts/components/graphql/get_group_contacts.query.graphql
new file mode 100644
index 00000000000..2a8150e42e3
--- /dev/null
+++ b/app/assets/javascripts/crm/contacts/components/graphql/get_group_contacts.query.graphql
@@ -0,0 +1,13 @@
+#import "./crm_contact_fields.fragment.graphql"
+
+query contacts($groupFullPath: ID!) {
+ group(fullPath: $groupFullPath) {
+ __typename
+ id
+ contacts {
+ nodes {
+ ...ContactFragment
+ }
+ }
+ }
+}
diff --git a/app/assets/javascripts/crm/contacts/components/graphql/update_contact.mutation.graphql b/app/assets/javascripts/crm/contacts/components/graphql/update_contact.mutation.graphql
new file mode 100644
index 00000000000..f55f6a10e0a
--- /dev/null
+++ b/app/assets/javascripts/crm/contacts/components/graphql/update_contact.mutation.graphql
@@ -0,0 +1,10 @@
+#import "./crm_contact_fields.fragment.graphql"
+
+mutation updateContact($input: CustomerRelationsContactUpdateInput!) {
+ customerRelationsContactUpdate(input: $input) {
+ contact {
+ ...ContactFragment
+ }
+ errors
+ }
+}