GraphQL for CubicWeb
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cubicweb-graphql-0.2.2.tar.gz
(21.5 kB
view details)
Built Distribution
File details
Details for the file cubicweb-graphql-0.2.2.tar.gz
.
File metadata
- Download URL: cubicweb-graphql-0.2.2.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52defff9becf79a570170429b5034aaa2a71b23f5b0112ed2fe19337f2d92be6 |
|
MD5 | 82bad0320f6e26aa33e273f11a61eee2 |
|
BLAKE2b-256 | be8bd54aab684b506c8398048118460ad6d4157eec7a19e79b5e48ff1715ffe8 |
File details
Details for the file cubicweb_graphql-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: cubicweb_graphql-0.2.2-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 641b4d1098e695849e321987a30cf08ccb70ded8e3ec9daf40505ec95c0d6517 |
|
MD5 | ee7801120fcdcd08d1cf824e780a3620 |
|
BLAKE2b-256 | f1505e98347c47089cc68a1ee45b2b7d74d3fb24e3b7fbae032bb82b88145dd8 |