Giter Site home page Giter Site logo

auritylab / graphql-kotlin-toolkit Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 659 KB

GraphQL toolkit for Kotlin.

Home Page: https://auritylab.github.io/graphql-kotlin-toolkit/#/

License: Apache License 2.0

Kotlin 99.93% Shell 0.07%
codegen codegenerator gradle-plugin graphql kotlin spring-boot

graphql-kotlin-toolkit's People

Contributors

wipeair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cybernetics

graphql-kotlin-toolkit's Issues

Usage of existing enums

Sometimes there are already existing enums for the ones used in the GraphQL schema.
The code generator will currently always generate a new enum, which matches the one defined in the schema.

This behavior sometimes results in unnecessarily ugly code, therefore there should be an easier way to do that.

Possible fixes:

  • Allow kRepresentation on Enums to directly use the existing enum.
    • Is there a way to guarantee that the given enum contains the required values? (Would break type safety and runtime otherwise)

Specify type for scalar "ID" explicitly (with converter)

There should be the possibility to set an explicit type for the "ID" scalar. This functionality should also come with a convert, as the ID is typically given as a String.

This may be implemented like this:

  • Two new properties within the CodegenOptions. (Reference to the ID type and the converter implementation)
  • Special handling for the ID scalar within the TypeMapper.
  • Generate a converter interface.

Pagination field resolvers: Support for own types and validation

The current implementation of the pagination field resolvers requires the return type of a field to be a list (e.g. [User]). But the generator should also support own *Connection and *Edge types.
When bringing in their own types, the generator should validate them against the GraphQL Cursor Connections Specification.

The user should also be able to define additional fields on the *Connection and *Edge types. When additional fields are given the generator has to generate specific Kotlin classes to support those. (Currently, global Kotlin classes are being used (PaginationConnectionGenerator, PaginationEdgeGenerator))

The pagination field resolvers should also properly handle the nullability of the types.

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.