Last active
September 14, 2017 12:29
-
-
Save hmaurer/79c838966dff65b94d9c6a7102c9f7eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
object(rid: "2450090569620309683") { | |
id | |
children { | |
rid | |
name | |
children { | |
id | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"object": { | |
"id": "ORGANISATION", | |
"children": [ | |
{ | |
"rid": "222897136273728385", | |
"name": "Organization default", | |
"children": [] | |
}, | |
{ | |
"rid": "1405209353840064631", | |
"name": "Test Stefan 1", | |
"children": [] | |
} | |
] | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn read-object-rid | |
[context args _value] | |
(print args) | |
(-> (client/request-backend (:rid args)) | |
(get :body))) | |
(defn read-object-key | |
[context args _value] | |
(-> (client/request-backend nil) | |
(get :body) | |
(get (keyword (:key args))) | |
(get :rid) | |
(client/request-backend) | |
(get :body))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:enums | |
{:model | |
{:description "The root models in the API" | |
:values [:accessProfile | |
:actionPlan | |
:classConfig | |
:custom_Period | |
:defaults | |
:expression | |
:externalResource | |
:forms | |
:group | |
:node | |
:nodeDataImport | |
:nodeType | |
:notification | |
:organisation | |
:page | |
:portal | |
:property | |
:reporter | |
:risk | |
:templateCategory | |
:transformer | |
:user]}} | |
:objects | |
{:Object {:description "An object." | |
:fields {:rid {:type (non-null ID)} | |
:id {:type String} | |
:name {:type String} | |
:children {:type (list Object)} | |
:className {:type (non-null String)}} | |
:args {:rid {:type (non-null ID) | |
:description "Unique object rid."}} | |
:resolve :resolve-read-object-rid} | |
:Model {:description "A model." | |
:fields {:rid {:type (non-null ID)} | |
:id {:type String} | |
:name {:type String} | |
:key {:type :model} | |
:children {:type (list Object)} | |
:className {:type (non-null String)}}}} | |
:queries | |
{:object {:type Object | |
:description "Retrieve object by rid" | |
:args {:rid {:type ID | |
:description "Unique object rid."}} | |
:resolve :resolve-read-object-rid} | |
:model {:type Model | |
:description "Retrieve a single model root by its key" | |
:args {:key {:type String | |
:description "Unique object key"}} | |
:resolve :resolve-read-model-root}}} |
Author
hmaurer
commented
Sep 14, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment