This package ships functionality to add the GraphiQL GraphQL web editor and request tester page to a Router
service in Vapor.
import PackageDescription
let package = Package(
dependencies: [
.package(url: "https://github.com/alexsteinerde/graphiql-vapor.git", from: "1.0.0"),
],
targets: [
.target(name: "App", dependencies: [<#T##Other Dependencies#>, "GraphiQLVapor"]),
...
]
)
let router = EngineRouter.default()
router.enableGraphiQL()
services.register(router, as: Router.self)
This will register the web page on GET /
. If you want to have GraphiQL available on another route, call router.enableGraphiQL(on: "/graphiQL)
instead.
This project is available under the MIT license. See the LICENSE file for more info.
You can contribute to this project by submitting a detailed issue or by forking this project and sending a pull request. Contributions of any kind are very welcome :)