GraphQL implementation in Lua
#lua #graphql #server #library
|
пре 9 година | |
---|---|---|
tests | пре 9 година | |
README.md | пре 9 година | |
parse.lua | пре 9 година | |
rules.lua | пре 9 година | |
schema.lua | пре 9 година | |
types.lua | пре 9 година | |
validate.lua | пре 9 година |
Lua implementation of GraphQL parser using LPeg. Experimental.
require 'parse' [[{
me {
firstName
lastName
}
}]]
Gives you this scary table:
{
kind = "document",
definitions = {
{
kind = "operation",
operation = "query",
selectionSet = {
kind = "selectionSet",
selections = {
{
kind = "field",
name = {
kind = "name",
value = "me"
},
selectionSet = {
kind = "selectionSet",
selections = {
{
kind = "field",
name = {
kind = "name",
value = "firstName"
}
},
{
kind = "field",
name = {
kind = "name",
value = "lastName"
}
}
}
}
}
}
}
}
}
}
The parser can parse virtually all of the query syntax:
The type system supports scalars, objects, enums, input objects, interfaces, and unions. The built in scalars are also provided (ints, floats, strings, etc.), as well as the two wrapper types (non null and list).
MIT