Code Monkey home page Code Monkey logo

graphiql-vapor's Introduction

GraphiQLVapor

Language Vapor Version build

This package ships functionality to add the GraphiQL GraphQL web editor and request-tester page to an RoutesBuilder instance in Vapor.

Installation

import PackageDescription

let package = Package(
    dependencies: [
        .package(url: "https://github.com/alexsteinerde/graphiql-vapor.git", from: "2.2.0"),
    ],
    targets: [
        .target(
            name: "App",
            dependencies: [
                .product(name: "GraphiQLVapor", package: "graphiql-vapor"),
            ]
        ),
    ...
    ]
)

Example

app.enableGraphiQL()

This will register the web page on GET /. If you want to have GraphiQL available on another route, call app.enableGraphiQL(on: "/graphiQL) or app.grouped("graphiQL").enableGraphiQL() instead.

License

This project is available under the MIT license. See the LICENSE file for more info.

Contribution

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 :)

graphiql-vapor's People

Contributors

alexsteinerde avatar doofyus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

graphiql-vapor's Issues

Ability to enable GraphiQL on a RouteBuilder

It would be great to be able to enable GraphiQL on a route builder, for example if I do,

let altRoute = app.grouped(...)
altRoute.enableGraphiQL()

The code change is small, instead of making an extension of Application, we would do an extension of RouteBuilder.

GraphiQL not sending headers

I was playing with this library and noticed that I wasn't getting the custom headers from GraphiQL in my Request object headers, checking the network tab in Chrome looks like it's not even sending it.

I have no knowledge of the of the graphiql js so I can fix it myself. Is it posible to know how can this be fixed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.