Skip to main content

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.1.0.tar.gz (19.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page