{"id":13727158,"url":"https://github.com/avishwakarma/dgraph-orm","last_synced_at":"2025-08-07T02:30:33.262Z","repository":{"id":38809774,"uuid":"169737009","full_name":"avishwakarma/dgraph-orm","owner":"avishwakarma","description":"Simplified schema creation, queries and mutations for Dgraph.","archived":false,"fork":false,"pushed_at":"2022-12-02T22:28:42.000Z","size":285,"stargazers_count":51,"open_issues_count":5,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-02T12:59:36.980Z","etag":null,"topics":["dgraph","dgraph-client","dgraph-js","dgraph-nodejs","dgraph-orm"],"latest_commit_sha":null,"homepage":"https://avishwakarma.github.io/dgraph-orm","language":"TypeScript","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/avishwakarma.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":"2019-02-08T13:12:14.000Z","updated_at":"2025-03-30T08:02:32.000Z","dependencies_parsed_at":"2022-09-05T11:20:59.280Z","dependency_job_id":null,"html_url":"https://github.com/avishwakarma/dgraph-orm","commit_stats":null,"previous_names":["ashokvishwakarma/dgraph-orm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avishwakarma/dgraph-orm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avishwakarma%2Fdgraph-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avishwakarma%2Fdgraph-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avishwakarma%2Fdgraph-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avishwakarma%2Fdgraph-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avishwakarma","download_url":"https://codeload.github.com/avishwakarma/dgraph-orm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avishwakarma%2Fdgraph-orm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260281568,"owners_count":22985627,"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","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":["dgraph","dgraph-client","dgraph-js","dgraph-nodejs","dgraph-orm"],"created_at":"2024-08-03T01:03:42.091Z","updated_at":"2025-07-08T19:06:00.343Z","avatar_url":"https://github.com/avishwakarma.png","language":"TypeScript","readme":"# dgraph-orm\nSimplified schema creation, queries and mutations for Dgraph.\n\n## Installation\n\n```\nnpm install dgraph-orm\n```\n\nDepending on the version of Dgraph that you are connecting to, you will have to\nuse a different version.\n\n| Dgraph version | dgraph-orm version |\n| :------------: | :----------------: |\n|     1.0.X      |      _1.X.Y_       |\n|     1.1.X      |      _2.X.Y_       |\n\nNote: Only API breakage from _v1.X.Y_ to _v2.X.Y_ is in dependency -`dgraph-js`.\nFunction `DgraphClient.newTxn().mutate()` returns a `messages.Assigned`\ntype in _v1.X_ but a `messages.Response` type in _v2.X_.\n\n## Full Documentation\n\nhttps://avishwakarma.github.io/dgraph-orm\n\n## Your first schema and model\n\n```javascript\nimport dgraph from 'dgraph-orm';\n\nconst UserSchema = new dgraph.Schema('user', {\n  name: {\n    type: dgraph.Types.STRING,\n    index: true,\n    token: {\n      term: true\n    }\n  },\n  email: {\n    type: dgraph.Types.STRING,\n    index: true,\n    unique: true,\n    token: {\n      exact: true\n    }\n  },\n  password: dgraph.Types.PASSWORD,\n  bio: dgraph.Types.STRING,\n  friend: {\n    type: dgraph.Types.UID,\n    model: 'user', // related model name\n    count: true,\n    reverse: true\n  }\n});\n\n/**\n * Set and create model out of the schema\n */\nconst User = dgraph.model(UserSchema);\n\n/**\n * Creates a new user with passed fields\n *\n * Returns the created user along with the generated uid\n */\nconst user = await User.create({\n  name: 'Ashok Vishwakarma',\n  email: 'akvlko@gmail.com',\n  bio: 'My bio ...'\n});\n\nconsole.log(user);\n// {\n//    uid: '0x1',\n//    name: 'Ashok Vishwakarma',\n//    email: 'akvlko@gmail.com',\n//    bio: 'My bio ...'\n// }\n```\n\nFor the full documentation please visit the below link\n\nhttps://ashokvishwakarma.github.io/dgraph-orm\n\n\n## Futute releases\n\n* Other geo queries within, intersects\n* Group by\n* Aggregation\n\n\n## Contribution\n\nIssues and pull requests are welcome for\n\n* Unit test cases\n* Feature and query method implementation\n* Bug fixes\n\n## Author\n![my_pic](https://avatars1.githubusercontent.com/u/389185?s=100\u0026v=1)\n\n[](https://avatars1.githubusercontent.com/u/389185?s=460\u0026v=4)\n### Ashok Vishwakarma\n\n[LinkedIn](https://www.linkedin.com/in/ashokvishwakarmaa/) \u0026bull; [Twitter](https://twitter.com/_avishwakarma) \u0026bull; [Medium](https://medium.com/@avishwakarma)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favishwakarma%2Fdgraph-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favishwakarma%2Fdgraph-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favishwakarma%2Fdgraph-orm/lists"}