|
| 1 | +package com.kotlin.generated |
| 2 | + |
| 3 | +import com.expediagroup.graphql.generator.annotations.* |
| 4 | + |
| 5 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 6 | +data class MyTypeToConsolidateWithConfig( |
| 7 | + val field: List<String>? = null, |
| 8 | + val field2: NestedTypeToConsolidateWithConfig? = null |
| 9 | +) |
| 10 | + |
| 11 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 12 | +data class MyTypeToConsolidateWithConfigInput( |
| 13 | + val field: List<String>? = null, |
| 14 | + val field2: NestedTypeToConsolidateWithConfigInput? = null |
| 15 | +) |
| 16 | + |
| 17 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 18 | +data class NestedTypeToConsolidateWithConfig( |
| 19 | + val field: String? = null |
| 20 | +) |
| 21 | + |
| 22 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 23 | +data class NestedTypeToConsolidateWithConfigInput( |
| 24 | + val field: String? = null |
| 25 | +) |
| 26 | + |
| 27 | +@GraphQLDescription("A description for MyTypeToConsolidate2") |
| 28 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 29 | +data class MyTypeToConsolidate2WithConfig( |
| 30 | + val field: String? = null |
| 31 | +) |
| 32 | + |
| 33 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 34 | +data class MyTypeToConsolidate2WithConfigInput( |
| 35 | + val field: String? = null |
| 36 | +) |
| 37 | + |
| 38 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 39 | +data class MyTypeToConsolidate3WithConfig( |
| 40 | + val field: String? = null |
| 41 | +) |
| 42 | + |
| 43 | +@GraphQLDescription("It ignores the description on the input when consolidating") |
| 44 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 45 | +data class MyTypeToConsolidate3WithConfigInput( |
| 46 | + val field: String? = null |
| 47 | +) |
| 48 | + |
| 49 | +@GraphQLDescription("It always uses the type description when consolidating") |
| 50 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 51 | +data class MyTypeToConsolidate4WithConfig( |
| 52 | + val field: String? = null |
| 53 | +) |
| 54 | + |
| 55 | +@GraphQLDescription("A description for MyTypeToConsolidateInput4") |
| 56 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 57 | +data class MyTypeToConsolidate4WithConfigInput( |
| 58 | + val field: String? = null |
| 59 | +) |
| 60 | + |
| 61 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 62 | +data class MyTypeNotToConsolidateWithConfig( |
| 63 | + val field: String? = null |
| 64 | +) |
| 65 | + |
| 66 | +@GraphQLDescription("The type name must exactly match in order to consolidate") |
| 67 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 68 | +data class MyTypeToNotConsolidateWithConfigInput( |
| 69 | + val field: String? = null |
| 70 | +) |
| 71 | + |
| 72 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 73 | +data class MyTypeToNotConsolidate2WithConfig( |
| 74 | + val field: String? = null |
| 75 | +) |
| 76 | + |
| 77 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 78 | +data class MyTypeInputToNotConsolidate2WithConfig( |
| 79 | + val field: String? = null |
| 80 | +) |
| 81 | + |
| 82 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 83 | +data class MyTypeWhereFieldsDoNotMatchWithConfig( |
| 84 | + val field: String? = null, |
| 85 | + val field2: String? = null |
| 86 | +) |
| 87 | + |
| 88 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 89 | +data class MyTypeWhereFieldsDoNotMatchWithConfigInput( |
| 90 | + val field: String? = null, |
| 91 | + val field2: Int? = null |
| 92 | +) |
| 93 | + |
| 94 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 95 | +data class MyTypeToConsolidateParentWithConfig( |
| 96 | + val field: MyTypeToConsolidateWithConfig? = null |
| 97 | +) |
| 98 | + |
| 99 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 100 | +data class MyTypeToConsolidateInputParentWithConfig( |
| 101 | + val field: MyTypeToConsolidateWithConfigInput? = null |
| 102 | +) |
| 103 | + |
| 104 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 105 | +open class MyTypeToConsolidateParent2WithConfig { |
| 106 | + open fun field(input: MyTypeToConsolidateWithConfigInput, dataFetchingEnvironment: graphql.schema.DataFetchingEnvironment): String? = throw NotImplementedError("MyTypeToConsolidateParent2WithConfig.field must be implemented.") |
| 107 | +} |
| 108 | + |
| 109 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 110 | +data class MyTypeNotToConsolidateParentWithConfig( |
| 111 | + val field: MyTypeNotToConsolidate2WithConfig? = null |
| 112 | +) |
| 113 | + |
| 114 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 115 | +data class MyTypeNotToConsolidateParentWithConfigInput( |
| 116 | + val field: MyTypeNotToConsolidate2WithConfigInput? = null |
| 117 | +) |
| 118 | + |
| 119 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 120 | +data class MyTypeNotToConsolidate2WithConfig( |
| 121 | + val field1: String? = null, |
| 122 | + val field2: String? = null |
| 123 | +) |
| 124 | + |
| 125 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 126 | +data class MyTypeNotToConsolidate2WithConfigInput( |
| 127 | + val field1: String? = null |
| 128 | +) |
| 129 | + |
| 130 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 131 | +data class MySuperSetTypeWithConfig( |
| 132 | + val field: String? = null, |
| 133 | + val field2: String? = null |
| 134 | +) |
| 135 | + |
| 136 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 137 | +data class MySuperSetTypeWithConfigInput( |
| 138 | + val field: String? = null, |
| 139 | + val field2: String? = null, |
| 140 | + val field3: Int? = null |
| 141 | +) |
| 142 | + |
| 143 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT]) |
| 144 | +data class MyTypeWithEnumsWithConfig( |
| 145 | + val field1: List<Enum1WithConfig>? = null, |
| 146 | + val field2: List<Enum2WithConfig>? = null |
| 147 | +) |
| 148 | + |
| 149 | +@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT]) |
| 150 | +data class MyTypeWithEnumsWithConfigInput( |
| 151 | + val field1: List<Enum1WithConfig>? = null, |
| 152 | + val field2: List<Enum2WithConfig>? = null |
| 153 | +) |
| 154 | + |
| 155 | +enum class Enum1WithConfig { |
| 156 | + This, |
| 157 | + That; |
| 158 | + |
| 159 | + companion object { |
| 160 | + fun findByName(name: String, ignoreCase: Boolean = false): Enum1WithConfig? = values().find { it.name.equals(name, ignoreCase = ignoreCase) } |
| 161 | + } |
| 162 | +} |
| 163 | + |
| 164 | +enum class Enum2WithConfig { |
| 165 | + The_Other; |
| 166 | + |
| 167 | + companion object { |
| 168 | + fun findByName(name: String, ignoreCase: Boolean = false): Enum2WithConfig? = values().find { it.name.equals(name, ignoreCase = ignoreCase) } |
| 169 | + } |
| 170 | +} |
0 commit comments