{"id":21396405,"url":"https://github.com/baslr/graphql-aql-generator","last_synced_at":"2025-07-13T19:31:08.698Z","repository":{"id":57253330,"uuid":"97010152","full_name":"baslr/graphql-aql-generator","owner":"baslr","description":"query GraphQL with only GraphQL IDL. Super simple.","archived":false,"fork":false,"pushed_at":"2018-02-25T18:06:31.000Z","size":21,"stargazers_count":17,"open_issues_count":6,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T19:41:03.095Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/baslr.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":"2017-07-12T13:16:50.000Z","updated_at":"2022-10-14T20:01:13.000Z","dependencies_parsed_at":"2022-08-31T22:20:27.956Z","dependency_job_id":null,"html_url":"https://github.com/baslr/graphql-aql-generator","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/baslr/graphql-aql-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fgraphql-aql-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fgraphql-aql-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fgraphql-aql-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fgraphql-aql-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baslr","download_url":"https://codeload.github.com/baslr/graphql-aql-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fgraphql-aql-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265194740,"owners_count":23725967,"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-11-22T14:26:56.892Z","updated_at":"2025-07-13T19:31:08.406Z","avatar_url":"https://github.com/baslr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-aql-generator\nschema graphql query – query GraphQL with only a GraphQL IDL schema.\n\nAre you tired of writing GraphQL.js schema files?\n\nThen try `graphql-aql-generator`. `graphql-aql-generator` needs only a GraphQL IDL file and generates the GraphQL.js schema automatically.\n\n\n\n# Example\n\n\n```es6\n'use strict';\n\nconst graphql = require('graphql-sync').graphql;\nconst generator = require('graphql-aql-generator');\n\n\nlet typeDefs = [`\n  type BlogEntry {\n    _key: String!\n    authorKey: String!\n\n    author: Author @aql(exec: \"FOR author in Author filter author._key == @current.authorKey return author\")\n  }\n\n  type Author {\n    _key: String!\n    name: String\n  }\n\n  type Query {\n    blogEntry(_key: String!): BlogEntry\n  }\n`]\n\nconst schema = generator(typeDefs);\n\nconst query = `\n{\n  blogEntry(_key: \"1\") {\n    _key\n    authorKey\n    author {\n      name\n     }\n  }\n}`;\n\nconst result = graphql(schema, query);\nprint(result);\n/*\n{\n  \"data\" : {\n    \"blogEntry\" : {\n      \"_key\" : \"1\",\n      \"authorKey\" : \"2\",\n      \"author\" : {\n        \"name\" : \"Plumbum\"\n      }\n    }\n  }\n}\n*/`\n\n\n// or use it with a GraphQLRouter\n\n'use strict';\n\nconst createRouter = require('@arangodb/foxx/router');\nconst router = createRouter();\nmodule.context.use(router);\n\nconst createGraphQLRouter = require('@arangodb/foxx/graphql');\n\nconst graphql = require('graphql-sync').graphql;\nconst sgq = require('sgq');\n\nconst typeDefs = [`\n  type BlogEntry {\n    _key: String!\n    authorKey: String!\n\n    author: Author @aql(exec: \"FOR author in Author filter author._key == @current.authorKey return author\")\n  }\n\n  type Author {\n    _key: String!\n    name: String\n  }\n\n  type Query {\n    blogEntry(_key: String!): BlogEntry\n  }\n`]\n\nconst schema = sgq(typeDefs);\n\nrouter.use('/graphql', createGraphQLRouter({\n  schema: schema,\n  graphiql: true,\n  graphql: require('graphql-sync')\n}));\n\n```\nIn this example two types and a query are defined. `BlogEntry` and `Author`. BlogEntry has a sub attribute Author which is fetched with a @aql directive. The query returns a BlogEntry with the corresponding Author depending on the BlogEntries _key.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaslr%2Fgraphql-aql-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaslr%2Fgraphql-aql-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaslr%2Fgraphql-aql-generator/lists"}