ckanext-graphql

The extension is still in development and not yet ready for production use.
Requirement: CKAN >= 2.7
This extension aims to provide a GraphQL endpoint to query the CKAN.
In the future, it might be considered an alternative to the CKAN Action API.
Installation
Install the extension on your virtualenv:
(pyenv) $ pip install -e git+https://github.com/metaodi/ckanext-graphql.git#egg=ckanext-graphql
Install the extension requirements:
(pyenv) $ pip install -r ckanext-graphql/requirements.txt
Enable the required plugins in your ini file:
ckan.plugins = graphql
Once the graphql plugin is loaded, a new endpoint /graphql is available on your CKAN instance.
By default, it serves GraphiQL, an in-browser IDE to create GraphQL queries.
The endpoint /graphql can be directly called with GraphQL-queries.
Example queries
Query all packages incl. groups and organization:
{
packages {
name
ckanId
organization {
name
}
groups {
edges {
group: node {
name
}
}
}
}
}
Search for groups or packages that contain the term bau:
{
search(q: "bau") {
__typename
... on Group {
name
}
... on Package {
name
}
}
}
TODO
- [x] Support all/more models
- [x] Add support for Relay
- [x] Add travis build
- [ ] Merge PackageExtra in Package
- [x] Add possibility to search for packages or groups (see example)
- [ ] Add possibility for mutations
- [ ] Check if data should be read from Solr
- [ ] Add inte