Giter Club home page Giter Club logo

pgschema-to-apischema's Introduction

pgschema-to-apischema

The tool in this repository extends a schema for Property Graphs into a GraphQL schema for a GraphQL API, where the Property Graph schema is assumed to be represented using the GraphQL Schema Definition Language (SDL). The actual approach to extend the Property Graph schemas into GraphQL API schemas (as implemented by this tool) is documented in the wiki of this repo.

Example

$ python3 generator.py \
      --input resources/schema.graphql \
      --output api-schema.graphql \
      --config resources/config.yml

Usage

$ python3 generator.py --help
usage: generator.py [-h] --input INPUT [--output OUTPUT] [--config CONFIG]

optional arguments:
  -h, --help       show this help message and exit
  --input INPUT    Input schema files (separated by commas)
  --output OUTPUT  Output schema file (default stdout)
  --config CONFIG  Path to configuration file

Configuration

The configuration file controls the features that are enabled during the generation process. For example:

transform:
    type_names: PascalCase
    field_names: camelCase
    enum_values: uppercase
    drop_comments: true
generation:
    add_query_type: true
    add_mutation_type: true
    # add id field to all schema types
    field_for_id: true
    # add reverse edges for traversal
    reverse_edges: true
    # add edge types
    edge_types: false
    fields_for_edge_types: false
    # add queries
    query_by_id: true
    query_list_of: true
    # add input types
    input_to_create_objects: true
    input_to_update_objects: true
    # add edge input types (not supported)
    input_to_create_edge_objects: false
    input_to_update_edge_objects: false
    # add mutations
    create_objects: true
    update_objects: true
    delete_objects: false
    # add edge mutations (not supported)
    create_edge_objects: false
    update_edge_objects: false
    delete_edge_objects: false

pgschema-to-apischema's People

Contributors

keski avatar rcapshaw avatar hartig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.