Skip to content

Commit 45d4adb

Browse files
committed
fix: Lenient generics on KProperty parameters
1 parent 07b9865 commit 45d4adb

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

core/src/main/kotlin/schema/BuilderInterfaces.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ fun <T : Any, M> WithFieldsBuilder<T>.field(
416416
*/
417417
@MonktDsl
418418
fun <T : Any, M> WithFieldsBuilder<T>.field(
419-
property: KProperty1<T, M>,
419+
property: KProperty1<in T, M>,
420420
type: GraphQLOutputType<M>? = null,
421421
block: GraphQLFieldDefinitionBuilderBlock<T, M> = {}
422422
) {
@@ -482,7 +482,7 @@ fun <T : Any, M> WithInputFieldsBuilder<T>.field(
482482
* @since 2.0.0
483483
*/
484484
fun <T : Any, M> WithInputFieldsBuilder<T>.field(
485-
property: KMutableProperty1<T, M>,
485+
property: KMutableProperty1<in T, M>,
486486
type: GraphQLInputType<M>? = null,
487487
block: GraphQLInputFieldDefinitionBuilderBlock<T, M> = {}
488488
) {

core/src/main/kotlin/schema/GraphQLFieldDefinition.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fun <T : Any, M> GraphQLFieldDefinition(
272272
*/
273273
@Suppress("FunctionName")
274274
fun <T : Any, M> GraphQLPropertyFieldDefinition(
275-
property: KProperty1<T, M>,
275+
property: KProperty1<in T, M>,
276276
type: GraphQLOutputType<M>? = null,
277277
block: GraphQLFieldDefinitionBuilderBlock<T, M> = {}
278278
): GraphQLFieldDefinition<T, M> {
@@ -293,7 +293,7 @@ fun <T : Any, M> GraphQLPropertyFieldDefinition(
293293
*/
294294
@OptIn(AdvancedGraphktApi::class)
295295
fun <T : Any, M> GraphQLFieldDefinitionBuilder<T, M>.property(
296-
property: KProperty1<T, M>
296+
property: KProperty1<in T, M>
297297
) {
298298
this.name = property.name
299299
this.getter = {

core/src/main/kotlin/schema/GraphQLInputFieldDefinition.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fun <T : Any, M> GraphQLInputFieldDefinition(
160160
*/
161161
@Suppress("FunctionName")
162162
fun <T : Any, M> GraphQLPropertyInputFieldDefinition(
163-
property: KMutableProperty1<T, M>,
163+
property: KMutableProperty1<in T, M>,
164164
type: GraphQLInputType<M>? = null,
165165
block: GraphQLInputFieldDefinitionBuilderBlock<T, M> = {}
166166
): GraphQLInputFieldDefinition<T, M> {
@@ -181,7 +181,7 @@ fun <T : Any, M> GraphQLPropertyInputFieldDefinition(
181181
*/
182182
@OptIn(AdvancedGraphktApi::class)
183183
fun <T : Any, M> GraphQLInputFieldDefinitionBuilder<T, M>.property(
184-
property: KMutableProperty1<T, M>
184+
property: KMutableProperty1<in T, M>
185185
) {
186186
this.name = property.name
187187
this.getter = property.getter

0 commit comments

Comments
 (0)