Coder Social home page Coder Social logo

wireframe's Introduction

Wireframe

Maven Central

Wireframe is currently in a proof-of-concept stage. It should not be used in production environments. Feel free to try it out while the API gets polished and new features are added, but be aware that breaking changes are likely to occur.

Wireframe is a GraphQL library for Kotlin, built on top of GraphQL-Java. It provides support for coroutines and integrates with some popular web frameworks and serialization libraries.

Features

Feature Status
Generate type-safe resolvers Implemented ✅
Routing integration Implemented ✅
Custom context builders Implemented ✅
Subscriptions support Not implemented 🚧
Batch requests support Not implemented 🚧
Support GraphQL interfaces and unions Not implemented 🚧
Custom type mappings Implemented ✅

Quick start

This guide explains how to install and setup your GraphQL application using a Ktor server backend. The full code can be found in the sample project.

Installation

Apply the gradle plugin on your project's build script:

// build.gradle.kts
id("io.github.darvld.wireframe")

Add runtime dependencies:

// build.gradle.kts

// Ktor integration
implementation("io.github.darvld.wireframe:runtime-ktor:<version>")

// Serialization provider
implementation("io.github.darvld.wireframe:transport-kotlinx:<version>")

Usage

Suppose you have the following GraphQL schema:

type Query {
    artist(id: ID!): Artist
}

type Artist {
    id: ID!
    name: String!
    bio: String
}

We can point the code generator to our SDL files using the Gradle plugin:

// build.gradle.kts
wiring {
    sourcesRoot.set("src/main/graphql")
}

Then we can use the generateWiring task to generate the code for our resolvers.

gradle generateWiring

The processor will generate a type-safe DSL that we can use to define our GraphQL API:

// AccountResolvers.kt

fun Resolvers.accountResolvers() = query {
    artist { id -> ArtistDto(id, "Bob") }
}

Integrations

[TBD]

Features

[TBD]

Context plugins

[TBD]

Custom mappings

[TBD]

wireframe's People

Contributors

actions-user avatar darvld avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.