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

bjorn 1cc1d79c6d Clean up README; il y a 9 ans
README.md 1cc1d79c6d Clean up README; il y a 9 ans
parse.lua 93f65117b9 Document/definition/operation parsing; il y a 9 ans

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