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 hashes)
Built Distribution
Close
Hashes for cubicweb_graphql-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 641b4d1098e695849e321987a30cf08ccb70ded8e3ec9daf40505ec95c0d6517 |
|
MD5 | ee7801120fcdcd08d1cf824e780a3620 |
|
BLAKE2b-256 | f1505e98347c47089cc68a1ee45b2b7d74d3fb24e3b7fbae032bb82b88145dd8 |