Swiftpack.co - nerdsupremacist/graphzahl-fluent-support as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nerdsupremacist.
nerdsupremacist/graphzahl-fluent-support 0.1.0-alpha.6
A set of extensions that allow to use Fluent APIs with GraphZahl
⭐️ 4
🕓 3 years ago
macOS
.package(url: "https://github.com/nerdsupremacist/graphzahl-fluent-support.git", from: "0.1.0-alpha.6")

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:

  • 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

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.

GitHub

link
Stars: 4
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

3 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics