{"id":23162752,"url":"https://github.com/lk321/magic-graphql","last_synced_at":"2025-08-18T03:31:54.579Z","repository":{"id":40122553,"uuid":"278440040","full_name":"lk321/magic-graphql","owner":"lk321","description":"Automatic graph generator for Sequelize ORM, it's magic! 🧙‍♂️🧑🏻‍💻","archived":false,"fork":false,"pushed_at":"2023-01-06T14:54:32.000Z","size":519,"stargazers_count":5,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-31T02:35:24.193Z","etag":null,"topics":["dataloader","graphql","sequelize","sequelize-orm","subscriptions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lk321.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-09T18:22:50.000Z","updated_at":"2024-03-12T20:13:15.000Z","dependencies_parsed_at":"2023-02-06T05:30:20.337Z","dependency_job_id":null,"html_url":"https://github.com/lk321/magic-graphql","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lk321/magic-graphql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lk321%2Fmagic-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lk321%2Fmagic-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lk321%2Fmagic-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lk321%2Fmagic-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lk321","download_url":"https://codeload.github.com/lk321/magic-graphql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lk321%2Fmagic-graphql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270940334,"owners_count":24671669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dataloader","graphql","sequelize","sequelize-orm","subscriptions"],"created_at":"2024-12-18T00:13:23.420Z","updated_at":"2025-08-18T03:31:54.283Z","avatar_url":"https://github.com/lk321.png","language":"JavaScript","readme":"# magic-graphql\n\nAutomatic graph generator for Sequelize ORM, it\u0026#39;s magic! 🧙‍♂️🧑🏻‍💻\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/) module available through the \n[npm registry](https://www.npmjs.com/). It can be installed using the \n[`npm`](https://docs.npmjs.com/getting-started/installing-npm-packages-locally)\nor \n[`yarn`](https://yarnpkg.com/en/)\ncommand line tools.\n\n```$ yarn add magic-graphql```\n\n## Example\n\nThis is an [example](https://github.com/lk321/magic-graph-example) of how to use the library 💪\n\n```js\nconst http = require('http')\nconst express = require('express')\n\nconst graphqlServer = require('./magic-graphql')\n\nconst app = express()\nconst httpServer = http.createServer(app)\n\n// ! GraphQL setup\ngraphqlServer(app, {\n    modelDirPath: '../models', // Or require('../models')\n    customsDirPath: null,\n    graphqlEndpint: '/graphql',\n    subscriptions: true,\n    httpServer: httpServer,\n    dataloader: true,\n    dataloaderOptions: { \n        max: 500, \n        cache: true, \n        batch: true \n    },\n    context: {}\n})\n\nhttpServer.listen(global.ConfigApp, () =\u003e {\n    console.log(`✅ Starting server`)\n})\n```\n\n## Options\n\n  | Option Key | Type | Default | Description |\n  | ---------- | ---- | ------- | ----------- |\n  | *modelDirPath*  | String / Object | `../models` | Path where the models folder is located.\n  | *customsDirPath* | String | `null` | Folder for custom queries and mutations.\n  | *graphqlEndpint*  | String | `/graphql` | GraphQL endpoint.\n  | *subscriptions*  | Boolean | `false` | Set to `true` to enable GraphQL subscriptions, this requires an http server.\n  | *httpServer* | Object | `null` | HttpServer it is required to be able to use GraphQL subscriptions.\n  | *dataloader*  | Boolean | `true` | Set to `false` to disable dataloader.\n  | *dataloaderOptions* | Object | `{ ... }` | Dataloader [options](#dataloader-options).\n  | *context* | Object | `{}` | Context object.\n\n#### Dataloader options\n\n  | Option Key | Type | Default | Description |\n  | ---------- | ---- | ------- | ----------- |\n  | *batch*  | Boolean | `true` | Set to `false` to disable batching.\n  | *max* | Number | `500` | Limits the number of items that get passed in to the batch. May be set to `1` to disable batching.\n  | *cache* | Boolean | `true` | Set to `false` to disable memoization caching.\n\n## Dependencies\n\n- [express](https://ghub.io/express): Fast, unopinionated, minimalist web framework\n- [express-graphql](https://ghub.io/express-graphql): Production ready GraphQL HTTP middleware.\n- [graphql](https://ghub.io/graphql): A Query Language and Runtime which can target any service.\n- [graphql-playground-middleware-express](https://ghub.io/graphql-playground-middleware-express): GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs \u0026amp; collaboration).\n- [graphql-relay](https://ghub.io/graphql-relay): A library to help construct a graphql-js server supporting react-relay.\n- [graphql-sequelize](https://ghub.io/graphql-sequelize): GraphQL \u0026amp; Relay for MySQL \u0026amp; Postgres via Sequelize\n- [lodash](https://ghub.io/lodash): Lodash modular utilities.\n- [mysql2](https://ghub.io/mysql2): fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS\n- [sequelize](https://ghub.io/sequelize): Multi dialect ORM for Node.JS\n\n## Dev Dependencies\n\n- [nodemon](https://ghub.io/nodemon): Simple monitor script for use during development of a node.js app.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flk321%2Fmagic-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flk321%2Fmagic-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flk321%2Fmagic-graphql/lists"}