Skip to content

Commit c987b13

Browse files
authored
federation documentation cleanup (ExpediaGroup#347)
Removes unnecessary @Property: prefix from the annotations
1 parent 3f194f2 commit c987b13

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

graphql-kotlin-federation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Extended federated GraphQL schemas provide additional functionality to the types
8585
```kotlin
8686
@KeyDirective(fields = FieldSet("id"))
8787
@ExtendsDirective
88-
data class Product(@property:ExternalDirective val id: Int) {
88+
data class Product(@ExternalDirective val id: Int) {
8989

9090
fun reviews(): List<Review> {
9191
// returns list of product reviews

graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/federation/directives/ExtendsDirective.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private const val DESCRIPTION = "Marks target object as extending part of the fe
3636
* ```kotlin
3737
* @KeyDirective(FieldSet("id"))
3838
* @ExtendsDirective
39-
* class Product(@property:ExternalDirective val id: String) {
39+
* class Product(@ExternalDirective val id: String) {
4040
* fun newFunctionality(): String = "whatever"
4141
* }
4242
* ```

graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/federation/directives/ExternalDirective.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import graphql.introspection.Introspection
3333
* ```kotlin
3434
* @KeyDirective(FieldSet("id"))
3535
* @ExtendsDirective
36-
* class Product(@property:ExternalDirective val id: String) {
36+
* class Product(@ExternalDirective val id: String) {
3737
* fun newFunctionality(): String = "whatever"
3838
* }
3939
* ```

graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/federation/directives/ProvidesDirective.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ import graphql.introspection.Introspection
4141
* @KeyDirective(FieldSet("userId"))
4242
* @ExtendsDirective
4343
* class User(
44-
* @property:ExternalDirective val userId: String,
45-
* @property:ExternalDirective val name: String
44+
* @ExternalDirective val userId: String,
45+
* @ExternalDirective val name: String
4646
* )
4747
* ```
4848
*

graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/federation/directives/RequiresDirective.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import graphql.introspection.Introspection
4141
* ```kotlin
4242
* @KeyDirective(FieldSet("id"))
4343
* @ExtendsDirective
44-
* class Product(@property:ExternalDirective val id: String) {
44+
* class Product(@ExternalDirective val id: String) {
4545
*
4646
* @ExternalDirective
4747
* var weight: Double by Delegates.notNull()

graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/federation/validation/FederatedSchemaValidatorKeyDirectiveTest.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import com.expediagroup.graphql.federation.FederatedSchemaGenerator
2020
import com.expediagroup.graphql.federation.FederatedSchemaGeneratorConfig
2121
import com.expediagroup.graphql.federation.FederatedSchemaGeneratorHooks
2222
import com.expediagroup.graphql.federation.FederatedSchemaValidator
23-
import com.expediagroup.graphql.federation.exception.InvalidFederatedSchema
2423
import com.expediagroup.graphql.federation.directives.ExtendsDirective
2524
import com.expediagroup.graphql.federation.directives.ExternalDirective
2625
import com.expediagroup.graphql.federation.directives.FieldSet
2726
import com.expediagroup.graphql.federation.directives.KeyDirective
27+
import com.expediagroup.graphql.federation.exception.InvalidFederatedSchema
2828
import graphql.schema.GraphQLObjectType
2929
import io.mockk.mockk
3030
import org.junit.jupiter.api.BeforeEach
@@ -123,7 +123,7 @@ class FederatedSchemaValidatorKeyDirectiveTest {
123123
*/
124124
@KeyDirective(fields = FieldSet("id"))
125125
@ExtendsDirective
126-
private data class FederatedSimpleKey(@property:ExternalDirective val id: String, val description: String)
126+
private data class FederatedSimpleKey(@ExternalDirective val id: String, val description: String)
127127

128128
/*
129129
type KeyWithMultipleFields @key(fields : "id type") {
@@ -144,7 +144,7 @@ class FederatedSchemaValidatorKeyDirectiveTest {
144144
*/
145145
@KeyDirective(fields = FieldSet("id type"))
146146
@ExtendsDirective
147-
private data class FederatedKeyWithMultipleFields(@property:ExternalDirective val id: String, @property:ExternalDirective val type: String, val description: String)
147+
private data class FederatedKeyWithMultipleFields(@ExternalDirective val id: String, @ExternalDirective val type: String, val description: String)
148148

149149
/*
150150
type KeyWithNestedFields @key(fields : "id { uuid }") {
@@ -173,11 +173,11 @@ class FederatedSchemaValidatorKeyDirectiveTest {
173173
*/
174174
@KeyDirective(fields = FieldSet("id { uuid }"))
175175
@ExtendsDirective
176-
private data class FederatedKeyWithNestedFields(@property:ExternalDirective val id: FederatedNestedId, val description: String)
176+
private data class FederatedKeyWithNestedFields(@ExternalDirective val id: FederatedNestedId, val description: String)
177177

178178
@KeyDirective(fields = FieldSet("uuid"))
179179
@ExtendsDirective
180-
private data class FederatedNestedId(@property:ExternalDirective val uuid: String)
180+
private data class FederatedNestedId(@ExternalDirective val uuid: String)
181181

182182
/*
183183
type FederatedMissingKey @extends {
@@ -186,7 +186,7 @@ class FederatedSchemaValidatorKeyDirectiveTest {
186186
}
187187
*/
188188
@ExtendsDirective
189-
private data class FederatedMissingKey(@property:ExternalDirective val id: String, val description: String)
189+
private data class FederatedMissingKey(@ExternalDirective val id: String, val description: String)
190190

191191
/*
192192
type KeyMissingFieldSelection @key(fields : "") {
@@ -213,7 +213,7 @@ class FederatedSchemaValidatorKeyDirectiveTest {
213213
}
214214
*/
215215
@KeyDirective(fields = FieldSet("id"))
216-
data class BaseKeyReferencingExternalFields(@property:ExternalDirective val id: String, val description: String)
216+
data class BaseKeyReferencingExternalFields(@ExternalDirective val id: String, val description: String)
217217

218218
/*
219219
type ExternalKeyReferencingLocalField @extends @key(fields : "id") {

graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/federation/validation/FederatedSchemaValidatorProvidesDirectiveTest.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import com.expediagroup.graphql.federation.FederatedSchemaGenerator
2020
import com.expediagroup.graphql.federation.FederatedSchemaGeneratorConfig
2121
import com.expediagroup.graphql.federation.FederatedSchemaGeneratorHooks
2222
import com.expediagroup.graphql.federation.FederatedSchemaValidator
23-
import com.expediagroup.graphql.federation.exception.InvalidFederatedSchema
2423
import com.expediagroup.graphql.federation.directives.ExtendsDirective
2524
import com.expediagroup.graphql.federation.directives.ExternalDirective
2625
import com.expediagroup.graphql.federation.directives.FieldSet
2726
import com.expediagroup.graphql.federation.directives.KeyDirective
2827
import com.expediagroup.graphql.federation.directives.ProvidesDirective
28+
import com.expediagroup.graphql.federation.exception.InvalidFederatedSchema
2929
import graphql.schema.GraphQLObjectType
3030
import graphql.schema.GraphQLTypeUtil
3131
import io.mockk.mockk
@@ -122,8 +122,8 @@ class FederatedSchemaValidatorProvidesDirectiveTest {
122122
@KeyDirective(fields = FieldSet("id"))
123123
@ExtendsDirective
124124
private data class ProvidedType(
125-
@property:ExternalDirective val id: String,
126-
@property:ExternalDirective val text: String
125+
@ExternalDirective val id: String,
126+
@ExternalDirective val text: String
127127
)
128128

129129
/*
@@ -169,7 +169,7 @@ class FederatedSchemaValidatorProvidesDirectiveTest {
169169
@KeyDirective(fields = FieldSet("id"))
170170
@ExtendsDirective
171171
private data class ProvidedWithLocalField(
172-
@property:ExternalDirective val id: String,
172+
@ExternalDirective val id: String,
173173
val text: String
174174
)
175175

@@ -242,8 +242,8 @@ class FederatedSchemaValidatorProvidesDirectiveTest {
242242
@KeyDirective(fields = FieldSet("id"))
243243
@ExtendsDirective
244244
private data class ProvidedWithList(
245-
@property:ExternalDirective val id: String,
246-
@property:ExternalDirective val text: List<String>
245+
@ExternalDirective val id: String,
246+
@ExternalDirective val text: List<String>
247247
)
248248

249249
/*
@@ -273,7 +273,7 @@ class FederatedSchemaValidatorProvidesDirectiveTest {
273273
@KeyDirective(fields = FieldSet("id"))
274274
@ExtendsDirective
275275
private data class ProvidedWithInterface(
276-
@property:ExternalDirective val id: String,
277-
@property:ExternalDirective val data: ProvidedInterface = throw UnsupportedOperationException("not implemented")
276+
@ExternalDirective val id: String,
277+
@ExternalDirective val data: ProvidedInterface = throw UnsupportedOperationException("not implemented")
278278
)
279279
}

graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/federation/validation/FederatedSchemaValidatorRequiresDirectiveTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import com.expediagroup.graphql.federation.FederatedSchemaGenerator
2020
import com.expediagroup.graphql.federation.FederatedSchemaGeneratorConfig
2121
import com.expediagroup.graphql.federation.FederatedSchemaGeneratorHooks
2222
import com.expediagroup.graphql.federation.FederatedSchemaValidator
23-
import com.expediagroup.graphql.federation.exception.InvalidFederatedSchema
2423
import com.expediagroup.graphql.federation.directives.ExtendsDirective
2524
import com.expediagroup.graphql.federation.directives.ExternalDirective
2625
import com.expediagroup.graphql.federation.directives.FieldSet
2726
import com.expediagroup.graphql.federation.directives.KeyDirective
2827
import com.expediagroup.graphql.federation.directives.RequiresDirective
28+
import com.expediagroup.graphql.federation.exception.InvalidFederatedSchema
2929
import graphql.schema.GraphQLObjectType
3030
import io.mockk.mockk
3131
import org.junit.jupiter.api.BeforeEach
@@ -105,7 +105,7 @@ class FederatedSchemaValidatorRequiresDirectiveTest {
105105
*/
106106
@KeyDirective(fields = FieldSet("id"))
107107
@ExtendsDirective
108-
private class SimpleRequires(@property:ExternalDirective val id: String, val description: String) {
108+
private class SimpleRequires(@ExternalDirective val id: String, val description: String) {
109109
@ExternalDirective
110110
var weight: Double by Delegates.notNull()
111111

@@ -123,7 +123,7 @@ class FederatedSchemaValidatorRequiresDirectiveTest {
123123
*/
124124
@KeyDirective(fields = FieldSet("id"))
125125
@ExtendsDirective
126-
private class RequiresLocalField(@property:ExternalDirective val id: String, val description: String) {
126+
private class RequiresLocalField(@ExternalDirective val id: String, val description: String) {
127127

128128
var weight: Double = 0.0
129129

@@ -141,7 +141,7 @@ class FederatedSchemaValidatorRequiresDirectiveTest {
141141
*/
142142
@KeyDirective(fields = FieldSet("id"))
143143
@ExtendsDirective
144-
class RequiresNonExistentField(@property:ExternalDirective val id: String, val description: String) {
144+
class RequiresNonExistentField(@ExternalDirective val id: String, val description: String) {
145145

146146
@ExternalDirective
147147
var weight: Double by Delegates.notNull()

graphql-kotlin-federation/src/test/kotlin/test/data/queries/federated/Product.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type Book implements Product @extends @key(fields : "id") {
5050
@ExtendsDirective
5151
@KeyDirective(FieldSet("id"))
5252
class Book(
53-
@property:ExternalDirective override val id: String
53+
@ExternalDirective override val id: String
5454
) : Product {
5555

5656
// optionally provided as it is not part of the @key field set
@@ -105,6 +105,6 @@ type User {
105105
@ExtendsDirective
106106
@KeyDirective(FieldSet("userId"))
107107
data class User(
108-
@property:ExternalDirective val userId: Int,
109-
@property:ExternalDirective val name: String
108+
@ExternalDirective val userId: Int,
109+
@ExternalDirective val name: String
110110
)

0 commit comments

Comments
 (0)