0.0.1-next.6 • Published 8 months ago

adonisjs-graphql v0.0.1-next.6

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

adonisjs-graphql (WIP)

codecov npm version code style: prettier

Introduction

As a lightweight and straightforward package specifically designed for the AdonisJS web framework, this package focuses on the code-first approach, enabling developers to easily build GraphQL servers directly within their AdonisJS applications.

With an emphasis on simplicity, ease of use, and seamless integration with AdonisJS, it eliminates the need for additional layers such as ExpressJS or Apollo Server. By running directly on the AdonisJS server and tightly integrating with the framework and Lucid ORM, this package can provide a smooth experience for developers looking to implement GraphQL functionality in their projects.

Features

  • Code-First Approach: Define your schema using TypeScript classes and decorators.
  • Type Safety: Leverage TypeScript's static typing to ensure type safety across your schema.
  • Decorators: Use decorators to define your schema, resolvers, and middleware.
  • Lucid ORM Integration: Seamlessly integrate with AdonisJS' Lucid ORM to query your database.
  • Middleware: Define middleware to run before or after your resolvers.
  • Subscriptions: Use GraphQL subscriptions to push real-time updates to your clients.

Prerequisites

  • This package requires AdonisJS v6

Installation

Install the package and peer dependencies:

# Using npm
npm install adonisjs-graphql graphql

# Using yarn
yarn add adonisjs-graphql graphql

Configure the package by running the following command:

node ace configure adonisjs-graphql

This will create a new playground.html file in the public directory, and a new graphql.ts file in the config directory.

Usage

Soon

Note: You can look at to app directory to see the example.

Development

To get started with development, clone the repository and install the dependencies:

git clone https://github.com/tuanvu0995/adonisjs-graphql.git
cd adonisjs-graphql
npm install
cp .env.example .env

You can run the tests using the following command:

# Run all tests
npm run test

# Run unit tests
npm run test unit

# Run e2e tests
npm run test e2e

To start the development server, run the following command:

npm run dev

This will start the AdonisJS server with the GraphQL playground enabled.

Go to http://localhost:3333/graphql to access the playground and start running queries.

Contributing

Any contributions from the community are welcome.

Find a bug, a typo, or something that’s not documented well? We’d love for you to open an issue telling us what we can improve! Follow the CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

We love your pull requests! Check out our Good First Issue and Help Wanted tags for good issues to tackle. Check out our contributors guide for more information.

If you like what you see, star us on GitHub.

Progress

StatusMilestoneGoalsETA
Type and Field2 / 2May 2024
Query and Mutation2 / 2Jun 2024
Relationship4 / 5Jun 2024
Middleware1 / 1Jun 2024
Subscription1 / 1Jul 2024
🚀Dataloader0 / 1Jul 2024
😃Directives0 / 1Aug 2024
😃Extensions0 / 1Aug 2024
😃Great Playground0 / 1Aug 2024
😃More Improvements0 / -Sep 2024

Updated: Wed, 19 Jun 2024

Who is using adonisjs-graphql?

License

This package is open-sourced software licensed under the MIT license.

0.0.1-next.6

8 months ago

0.0.1-next.2

1 year ago

0.0.1-next.4

1 year ago

0.0.1-next.3

1 year ago

0.0.1-next.5

1 year ago

0.0.1-next.1

1 year ago

0.0.1-next.0

1 year ago