{"id":22740222,"url":"https://github.com/a-type/graphql-orientdb","last_synced_at":"2025-03-30T03:41:27.711Z","repository":{"id":44113251,"uuid":"194878672","full_name":"a-type/graphql-orientdb","owner":"a-type","description":"[Experimental] A query translation layer from GraphQL to OrientDB","archived":false,"fork":false,"pushed_at":"2023-01-04T03:34:06.000Z","size":1298,"stargazers_count":2,"open_issues_count":15,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T06:12:22.384Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-type.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-02T14:24:24.000Z","updated_at":"2020-04-30T06:57:30.000Z","dependencies_parsed_at":"2023-02-01T18:46:45.693Z","dependency_job_id":null,"html_url":"https://github.com/a-type/graphql-orientdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Fgraphql-orientdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Fgraphql-orientdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Fgraphql-orientdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Fgraphql-orientdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-type","download_url":"https://codeload.github.com/a-type/graphql-orientdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273519,"owners_count":20750904,"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":[],"created_at":"2024-12-10T23:07:56.216Z","updated_at":"2025-03-30T03:41:27.689Z","avatar_url":"https://github.com/a-type.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-orientdb\n\nAn experimental query translation / compilation layer from GraphQL to OrientDB SQL.\n\nThe purpose of this library is to allow users to easily write minimal backend API servers for rich client applications, defining their own external GraphQL schema which suits their use case, while powering that schema directly with OrientDB SQL statements.\n\nThis is accomplished using schema directives. You annotate your GraphQL schema with these directives to indicate how your fields translate into OrientDB SQL statements. These statements are then compiled over the entire GraphQL query to form a set of final SQL queries which will be run against the database.\n\n## [Sketches] Initial ideas for query translation\n\nI'm a visual thinker, so I'm going to start outlining what I want to accomplish with this library.\n\n```graphql\ntype Post {\n  id: ID!\n  title: String!\n}\n\ntype User {\n  id: ID!\n  name: String!\n  bio: String\n\n  posts: [Post!]!\n    @match(statement: \":parent-HasPost-\u003e{as:post}\", return: \"post\")\n}\n\ninput UserGetInput {\n  id: ID!\n}\n\ntype Query {\n  user(input: UserGetInput!): User\n    @match(\n      statement: \"{class: User, where: (id = $args.input.id), as: user}\"\n      return: \"user\"\n    )\n}\n```\n\nRunning the query\n\n```graphql\nquery GetUserAndPosts {\n  user(input: { id: \"foo\" }) {\n    id\n    name\n    posts {\n      id\n      title\n    }\n  }\n}\n```\n\nWould result in the following OrientDB SQL query:\n\n\u003e I'm still learning OrientDB, so I need to verify that some of these things\n\u003e would actually work...\n\n```orientdb\nSELECT id, name, posts:{id, title} FROM (\n  MATCH {class: User, where: (id = $args.input.id), as: user}\n  ... TODO ...\n)\n```\n\n## Comparable Projects\n\n[Join Monster](https://github.com/acarl005/join-monster) compiles SQL queries from GraphQL for most typical relational databases (but not OrientDB)\n\nNeo4J has projects which do the same for Cypher. [neo4j-graphql-js](https://github.com/neo4j-graphql/neo4j-graphql-js) is an official project. There's also my previous foray into this area, [graphql-cypher](https://github.com/a-type/graphql-cypher), which follows similar principles to this library, only targeting Cypher. I created this library before discovering and migrating to OrientDB from Neo4J.\n\n===========\n\nThis project was bootstrapped with [TSDX](https://github.com/jaredpalmer/tsdx).\n\n## Local Development\n\nBelow is a list of commands you will probably find useful.\n\n### `npm start` or `yarn start`\n\nRuns the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/4060187/52168303-574d3a00-26f6-11e9-9f3b-71dbec9ebfcb.gif\" width=\"600\" /\u003e\n\nYour library will be rebuilt if you make edits.\n\n### `npm run build` or `yarn build`\n\nBundles the package to the `dist` folder.\nThe package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).\n\n\u003cimg src=\"https://user-images.githubusercontent.com/4060187/52168322-a98e5b00-26f6-11e9-8cf6-222d716b75ef.gif\" width=\"600\" /\u003e\n\n### `npm test` or `yarn test`\n\nRuns the test watcher (Jest) in an interactive mode.\nBy default, runs tests related to files changed since the last commit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-type%2Fgraphql-orientdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-type%2Fgraphql-orientdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-type%2Fgraphql-orientdb/lists"}