cubicweb-graphql provides a GraphQL interface and querier for CubicWeb.
Basic use in Python
Once the CubicWeb instance has been launched, GraphQL queries can be executed using:
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
Tests can be run using:
python -m unittest discover -s test
from top-level directory.
Release files for cubicweb-graphql 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cubicweb-graphql-0.2.2.tar.gz | 21.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cubicweb_graphql-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.1 kB
Release files / cubicweb-graphql-0.2.2.tar.gz
| Download URL | cubicweb-graphql-0.2.2.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52defff9becf79a570170429b5034aaa2a71b23f5b0112ed2fe19337f2d92be6
|
|
BLAKE2b-256 checksum How to use checksums |
be8bd54aab684b506c8398048118460ad6d4157eec7a19e79b5e48ff1715ffe8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Release files / cubicweb_graphql-0.2.2-py3-none-any.whl
| Download URL | cubicweb_graphql-0.2.2-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
641b4d1098e695849e321987a30cf08ccb70ded8e3ec9daf40505ec95c0d6517
|
|
BLAKE2b-256 checksum How to use checksums |
f1505e98347c47089cc68a1ee45b2b7d74d3fb24e3b7fbae032bb82b88145dd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|