A set of extensions that allow to use Fluent APIs with GraphZahl

GraphZahl Fluent Support

A set of extensions that allow to use Fluent APIs and Types with GraphZahl

Warning: For the best results please use. graphzahl-fluent-support with Xcode 11.4 Beta

About GraphZahl

GraphZahl is a Framework to implement Declarative, Type-Safe GraphQL Server APIs with Magic 🎩.

Learn more about GraphZahl: here


Swift Package Manager

You can install graphzahl-fluent-support via Swift Package Manager by adding the following line to your Package.swift:

import PackageDescription

let package = Package(
    dependencies: [
        .package(url: "", from: "0.1.0-alpha.")


To use Fluent Types and Models in your API, you can use graphzahl-fluent-support:

enum API: GraphQLSchema {
    typealias ViewerContext = Database

    class Query: QueryType {
        let database: Database

        // QueryBuilders are supported with additional paging API
        func todos() -> QueryBuilder<Todo> {
            return Todo.query(on: database)

        required init(viewerContext database: Database) {
            self.database = database

It adds support for:

  • QueryBuilder

  • @Parent

  • @Children

  • @Siblings

  • @Field

  • @ID

    Known Issues

  • Relation Fields depend on some query builder having run before, or a connection to the databse beeing somewhere in the viewer context, or they will crash otherwise. This is not ideal and should be solved


Contributions are welcome and encouraged!


graphzahl-fluent-support is available under the MIT license. See the LICENSE file for more info.

This project is being done under the supervision of the Chair for Applied Software Enginnering at the Technical University of Munich. The chair has everlasting rights to use and maintain this tool.


  • Swift Tools 5.1.0
View More Packages from this Author


Last updated: Wed Nov 09 2022 03:47:24 GMT-0500 (GMT-05:00)