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.
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.
Soon
Note: You can look at to app
directory to see the example.
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.
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.
Status | Milestone | Goals | ETA |
---|---|---|---|
✅ | Type and Field | 2 / 2 | May 2024 |
✅ | Query and Mutation | 2 / 2 | Jun 2024 |
✅ | Relationship | 4 / 5 | Jun 2024 |
✅ | Middleware | 1 / 1 | Jun 2024 |
✅ | Subscription | 1 / 1 | Jul 2024 |
🚀 | Dataloader | 0 / 1 | Jul 2024 |
😃 | Directives | 0 / 1 | Aug 2024 |
😃 | Extensions | 0 / 1 | Aug 2024 |
😃 | Great Playground | 0 / 1 | Aug 2024 |
😃 | More Improvements | 0 / - | Sep 2024 |
Updated: Wed, 19 Jun 2024
This package is open-sourced software licensed under the MIT license.