/knex_poll

Primary LanguageTypeScript

Knex Poll

Knex Poll is a GraphQL and Node.js-based implementation of the Django REST framework pools API. This project aims to provide a more flexible and efficient way to manage polls through GraphQL, leveraging the power of graphql-compose for autogenerating GraphQL mutations, queries, types, and schemas.

Features

  • Autogeneration of GraphQL mutations, queries, types, and schemas based on Objective-JS models.
  • Seamless integration with existing Django REST framework pools API endpoints.
  • Flexible and efficient management of polls through GraphQL.

Autogeneration Process

The autogeneration process in Knex Poll is achieved through a custom library layer developed specifically for this purpose. This library layer analyzes the Objective-JS models and generates corresponding GraphQL mutations, queries, types, and schemas using graphql-compose.

Steps Involved:

  1. Model Analysis: The library layer analyzes the Objective-JS models to extract information about the polls, choices, and responses.

  2. Schema Generation: Based on the extracted information, the library layer dynamically generates GraphQL schemas for polls, choices, and responses.

  3. Type Mapping: The library layer maps Objective-JS model types to corresponding GraphQL types, ensuring consistency and compatibility.

  4. Mutation and Query Generation: Using graphql-compose, the library layer generates CRUD (Create, Read, Update, Delete) mutations and queries for polls, choices, and responses.

  5. Integration: The autogenerated GraphQL mutations, queries, types, and schemas are seamlessly integrated into the Knex Poll project, providing a complete GraphQL API for managing polls.

Usage

To use Knex Poll, simply clone the repository and follow the installation instructions in the README. Once installed, you can start using the autogenerated GraphQL API to manage polls efficiently.

Contributing

Contributions to Knex Poll are welcome! If you have ideas for improvements or new features, feel free to open an issue or submit a pull request.