Completed basic README
authorLaurent Wouters <lwouters@cenotelie.fr>
Thu, 21 Jun 2018 18:19:00 +0200
changeset 4 5477b5a437e6
parent 3 b7a2348c2378
child 5 75a26ebb659f
Completed basic README
README.rst
--- a/README.rst	Thu Jun 21 18:06:39 2018 +0200
+++ b/README.rst	Thu Jun 21 18:19:00 2018 +0200
@@ -8,6 +8,32 @@
     https://graphql.org/
 
 
+Basic use in Python
+-------------------
+
+Once the CubicWeb instance has been launched, GraphQL queries can be executed using:
+
+.. codeblock:: python
+
+    from cubicweb_graphql.querier import GraphQLQuerier
+
+    query = "query getAffaire($affaire_eid: ID) { Affaire(eid: $affaire_eid) { sujet } }"
+    result = GraphQLQuerier.execute(connection, query, affaire_eid=self.affaire1)
+
+
+Access from the Web API
+-----------------------
+
+The GraphQL querier can be access through the Web API:
+
+::
+
+    curl "http://localhost:8080/ajax" \
+            -d "fname=graphql" \
+            -d "query=$QUERY" \
+
+.
+
 Testing
 -------