adding authorization

This commit is contained in:
Bryce Covert
2018-07-10 20:16:26 -07:00
parent d87ebbbfe4
commit dd9b7ce86e
6 changed files with 27 additions and 9 deletions

View File

@@ -326,7 +326,7 @@
invoices (map
->graphql
(invoices/get-graphql (<-graphql args)))
(invoices/get-graphql (<-graphql (assoc args :id (:id context)))))
invoice-count (invoices/count-graphql (<-graphql args))]
(resolve/with-context
[{:invoices invoices
@@ -423,7 +423,7 @@
(defn get-company [context args value]
(->graphql
(filter #(can-see-company? (:identity context) %)
(filter #(can-see-company? (:id context) %)
(companies/get-all))))
(defn join-companies [users]
@@ -515,4 +515,4 @@
(query id q nil ))
([id q v]
(println "executing graphql query" id q v)
(simplify (execute schema q v {:identity id}))))
(simplify (execute schema q v {:id id}))))