{"id":13499538,"url":"https://github.com/bjornbytes/graphql-lua","last_synced_at":"2025-04-30T21:20:54.416Z","repository":{"id":2632656,"uuid":"46766457","full_name":"bjornbytes/graphql-lua","owner":"bjornbytes","description":"GraphQL implementation in Lua","archived":false,"fork":false,"pushed_at":"2023-03-13T08:29:08.000Z","size":102,"stargazers_count":188,"open_issues_count":4,"forks_count":27,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-30T20:04:08.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/bjornbytes.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,"governance":null}},"created_at":"2015-11-24T04:17:40.000Z","updated_at":"2025-03-23T15:55:17.000Z","dependencies_parsed_at":"2023-07-05T18:49:04.575Z","dependency_job_id":null,"html_url":"https://github.com/bjornbytes/graphql-lua","commit_stats":{"total_commits":108,"total_committers":6,"mean_commits":18.0,"dds":"0.11111111111111116","last_synced_commit":"6312c75b0995a96ff58f50cf8ae3f0e0808f67d1"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjornbytes%2Fgraphql-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjornbytes%2Fgraphql-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjornbytes%2Fgraphql-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjornbytes%2Fgraphql-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjornbytes","download_url":"https://codeload.github.com/bjornbytes/graphql-lua/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251782996,"owners_count":21643032,"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-07-31T22:00:34.477Z","updated_at":"2025-04-30T21:20:54.355Z","avatar_url":"https://github.com/bjornbytes.png","language":"Lua","readme":"GraphQL Lua [![Join the chat at https://gitter.im/bjornbytes/graphql-lua](https://badges.gitter.im/bjornbytes/graphql-lua.svg)](https://gitter.im/bjornbytes/graphql-lua?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n===\n\nLua implementation of GraphQL.\n\nInstallation\n------------\n\n1. Using luvit\n\n        lit install bjornbytes/graphql\n    \n2. Using luarocks\n\n        luarocks install graphql\n\nExample\n---\n\n```lua\nlocal parse = require 'graphql.parse'\nlocal schema = require 'graphql.schema'\nlocal types = require 'graphql.types'\nlocal validate = require 'graphql.validate'\nlocal execute = require 'graphql.execute'\n\n-- Parse a query\nlocal ast = parse [[\nquery getUser($id: ID) {\n  person(id: $id) {\n    firstName\n    lastName\n  }\n}\n]]\n\n-- Create a type\nlocal Person = types.object {\n  name = 'Person',\n  fields = {\n    id = types.id.nonNull,\n    firstName = types.string.nonNull,\n    middleName = types.string,\n    lastName = types.string.nonNull,\n    age = types.int.nonNull\n  }\n}\n\n-- Create a schema\nlocal schema = schema.create {\n  query = types.object {\n    name = 'Query',\n    fields = {\n      person = {\n        kind = Person,\n        arguments = {\n          id = types.id\n        },\n        resolve = function(rootValue, arguments)\n          if arguments.id ~= 1 then return nil end\n\n          return {\n            id = 1,\n            firstName = 'Bob',\n            lastName = 'Ross',\n            age = 52\n          }\n        end\n      }\n    }\n  }\n}\n\n-- Validate a parsed query against a schema\nvalidate(schema, ast)\n\n-- Execution\nlocal rootValue = {}\nlocal variables = { id = 1 }\nlocal operationName = 'getUser'\n\nexecute(schema, ast, rootValue, variables, operationName)\n\n--[[\n{\n  person = {\n    firstName = 'Bob',\n    lastName = 'Ross'\n  }\n}\n]]\n```\n\nStatus\n---\n\n- [x] Parsing\n  - [ ] Improve error messages\n- [x] Type system\n- [x] Introspection\n- [x] Validation\n- [x] Execution\n  - [ ] Asynchronous execution (coroutines)\n- [ ] Example server\n\nRunning tests\n---\n\n```lua\nlua tests/runner.lua\n```\n\nLicense\n---\n\nMIT\n","funding_links":[],"categories":["Libraries","资源","Implementations","Resources"],"sub_categories":["Lua Libraries","Experimental, etc","Lua"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjornbytes%2Fgraphql-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjornbytes%2Fgraphql-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjornbytes%2Fgraphql-lua/lists"}