Package: GraphQLite.jl

Simple, fast, limited-scope implementation of GraphQL in Julia. Converts GraphQL input into a composition of arrays and Dicts.

Approximately "n + 1" queries to the database are required when using a "naive" resolver: one SQL query to fetch the list of items and "n" SQL queries to fetch the brand name for each item. GraphQLite.jl solves this inefficiency by automatically using "batch" resolvers, if defined.
type Query {
    getCart(id: Int): Cart
}
type Cart {
    items: [Item]
}
type Item {
    name: String
    brand: Brand
}
type Brand {
    name: String
}
query GetCart(customerId: Int!){
    getCart(customerId: $customerId){
        items{name brand {id name}}
    }
}
function GraphQLite.resolve(parent::Item, ::Val{:brand}, args)
    # Pseudocode
    """SELECT * FROM brands where id=$(parent.brand_id)"""[1] |> Brand
end
function GraphQLite.resolve(parents::Vector{Item}, ::Val{:brand}, args)
    # Pseudocode
    brand_ids = join(map(x->x.brand_id, parents), ",")
    [Brand(x) for x in """SELECT * FROM brands where id IN($brand_ids)""]
end