KGraphQL icon indicating copy to clipboard operation
KGraphQL copied to clipboard

Allow a kotlin type to be used as graphql type and inputType

Open Bertrand opened this issue 5 years ago • 2 comments

Allows reusing the same kotlin type (with a different name attribute) in a gql type and a gql inputType.

Avoids many useless kotlin type duplication to circumvent GraphQL constraint that output types cannot be input types (even when it's totally legit).

Example use :

val schema = KGraphQL.schema { inputType<MyKotlinType>() { name="TypeAsInput" } type<MyKotlinType>() { name="TypeAsObject" } }

Bertrand avatar Apr 12 '19 06:04 Bertrand

Coverage Status

Coverage increased (+0.2%) to 88.08% when pulling 2dfc9d5b4cee6f569f8bb3eb39cd9c776abf429d on Bertrand:same_type_used_for_object_and_inputtype into 42fef4a82c722d8b8944ceef8d8801ee9d7ed23b on pgutkowski:master.

coveralls avatar Apr 12 '19 06:04 coveralls

Coverage Status

Coverage increased (+0.2%) to 88.08% when pulling 2dfc9d5b4cee6f569f8bb3eb39cd9c776abf429d on Bertrand:same_type_used_for_object_and_inputtype into 42fef4a82c722d8b8944ceef8d8801ee9d7ed23b on pgutkowski:master.

coveralls avatar Apr 12 '19 06:04 coveralls