2
0

GraphQL implementation in Lua
#lua #graphql #server #library

bjorn 0b4bbf588c Add README example; 9 жил өмнө
README.md 0b4bbf588c Add README example; 9 жил өмнө
parse.lua 214cdb8bf3 README; 9 жил өмнө

README.md

GraphQL Lua

Lua implementation of GraphQL parser using LPeg. Experimental.

Example

require 'parse' [[
{
  me {
		firstName
    lastName
  }
}
]]

Gives you a table that looks like this:

{
  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"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

License

MIT