Home

Awesome

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

Installation

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: "https://github.com/nerdsupremacist/graphzahl-fluent-support.git", from: "0.1.0-alpha.")
    ]
)

Usage

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:

Contributions

Contributions are welcome and encouraged!

License

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.