Extension Graphql


Extension Basics

Title
Graphql
Name
ckanext-graphql
Type
Public extension
Description
The **graphql** extension for CKAN introduces a GraphQL API endpoint, providing an alternative meth
CKAN versions
Download-Url (zip)
Last commit
7 years ago (2018-02-27 13:54:21)
Url to repo
Category
Visualization & Analytics


Background Infos

Description (long)
Show details

ckanext-graphql

Build Status

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

  1. Install the extension on your virtualenv:

    (pyenv) $ pip install -e git+https://github.com/metaodi/ckanext-graphql.git#egg=ckanext-graphql
    
  2. Install the extension requirements:

    (pyenv) $ pip install -r ckanext-graphql/requirements.txt
    
  3. 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
Version
Version release date
(not set)
Contact name
Stefan Oderbolz
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints
  1. Install the extension on your virtualenv:

    (pyenv) $ pip install -e git+https://github.com/metaodi/ckanext-graphql.git#egg=ckanext-graphql
    
  2. Install the extension requirements:

    (pyenv) $ pip install -r ckanext-graphql/requirements.txt
    
  3. 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](https://github.com/grap

Plugins to configure (ckan.ini)
graphql Once the
CKAN Settings (ckan.ini)
DB migration to be executed
(not set)
<< back to Extensions