forked from ExpediaGroup/graphql-kotlin
/
SchemaGeneratorTest.kt
581 lines (478 loc) · 22.7 KB
/
SchemaGeneratorTest.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
/*
* Copyright 2019 Expedia, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.expediagroup.graphql.generator
import com.expediagroup.graphql.TopLevelObject
import com.expediagroup.graphql.annotations.GraphQLDescription
import com.expediagroup.graphql.annotations.GraphQLID
import com.expediagroup.graphql.annotations.GraphQLIgnore
import com.expediagroup.graphql.annotations.GraphQLName
import com.expediagroup.graphql.exceptions.ConflictingTypesException
import com.expediagroup.graphql.exceptions.GraphQLKotlinException
import com.expediagroup.graphql.exceptions.InvalidIdTypeException
import com.expediagroup.graphql.extensions.deepName
import com.expediagroup.graphql.testSchemaConfig
import com.expediagroup.graphql.toSchema
import graphql.ExceptionWhileDataFetching
import graphql.GraphQL
import graphql.Scalars
import graphql.execution.DataFetcherResult
import graphql.execution.ExecutionPath
import graphql.language.SourceLocation
import graphql.schema.GraphQLFieldDefinition
import graphql.schema.GraphQLNonNull
import graphql.schema.GraphQLObjectType
import graphql.schema.GraphQLSchema
import org.junit.jupiter.api.Test
import java.net.CookieManager
import java.util.UUID
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue
@Suppress("Detekt.UnusedPrivateMember",
"Detekt.FunctionOnlyReturningConstant",
"Detekt.LargeClass",
"Detekt.MethodOverloading")
class SchemaGeneratorTest {
@Test
fun `SchemaGenerator generates a simple GraphQL schema`() {
val schema = toSchema(
queries = listOf(TopLevelObject(QueryObject())),
mutations = listOf(TopLevelObject(MutationObject())),
config = testSchemaConfig
)
val graphQL = GraphQL.newGraphQL(schema).build()
val result = graphQL.execute(" { query(value: 1) { id } }")
val geo: Map<String, Map<String, Any>>? = result.getData()
assertEquals(1, geo?.get("query")?.get("id"))
}
@Test
fun `SchemaGenerator generates a simple GraphQL schema with default builder`() {
val schemaGenerator = SchemaGenerator(testSchemaConfig)
val schema = schemaGenerator.generate(
queries = listOf(TopLevelObject(QueryObject())),
mutations = listOf(TopLevelObject(MutationObject())),
subscriptions = emptyList()
)
val graphQL = GraphQL.newGraphQL(schema).build()
val result = graphQL.execute(" { query(value: 1) { id } }")
val geo: Map<String, Map<String, Any>>? = result.getData()
assertEquals(1, geo?.get("query")?.get("id"))
}
@Test
fun `SchemaGenerator generates a simple GraphQL schema with predefined builder`() {
val schemaGenerator = SchemaGenerator(testSchemaConfig)
val field = GraphQLFieldDefinition.newFieldDefinition()
.name("foo")
.type(Scalars.GraphQLInt)
.build()
val customObject = GraphQLObjectType.Builder()
.field(field)
.name("MyObject")
.build()
val builder = GraphQLSchema.newSchema()
.additionalType(customObject)
val schema = schemaGenerator.generate(
queries = listOf(TopLevelObject(QueryObject())),
mutations = listOf(TopLevelObject(MutationObject())),
subscriptions = emptyList(),
builder = builder
)
val graphQL = GraphQL.newGraphQL(schema).build()
val result = graphQL.execute(" { query(value: 1) { id } }")
val geo: Map<String, Map<String, Any>>? = result.getData()
assertEquals(1, geo?.get("query")?.get("id"))
assertNotNull(schema.getType("MyObject"))
}
@Test
fun `Schema generator exposes arrays of primitive types as function arguments`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithArray())), config = testSchemaConfig)
val firstArgumentType = schema.queryType.getFieldDefinition("sumOf").arguments[0].type.deepName
assertEquals("[Int!]!", firstArgumentType)
val graphQL = GraphQL.newGraphQL(schema).build()
val result = graphQL.execute("{ sumOf(ints: [1, 2, 3]) }")
val sum = result.getData<Map<String, Int>>().values.first()
assertEquals(6, sum)
}
@Test
fun `Schema generator exposes arrays of complex types as function arguments`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithArray())), config = testSchemaConfig)
val firstArgumentType = schema.queryType.getFieldDefinition("sumOfComplexArray").arguments[0].type.deepName
assertEquals("[ComplexWrappingTypeInput!]!", firstArgumentType)
val graphQL = GraphQL.newGraphQL(schema).build()
val result = graphQL.execute("{sumOfComplexArray(objects: [{value: 1}, {value: 2}, {value: 3}])}")
val sum = result.getData<Map<String, Int>>().values.first()
assertEquals(6, sum)
}
@Test
fun `SchemaGenerator ignores fields and functions with @Ignore`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithIgnored())), config = testSchemaConfig)
assertTrue(schema.queryType.fieldDefinitions.none {
it.name == "ignoredFunction"
})
val resultType = schema.getObjectType("ResultWithIgnored")
assertTrue(resultType.fieldDefinitions.none {
it.name == "ignoredFunction"
})
assertTrue(resultType.fieldDefinitions.none {
it.name == "ignoredProperty"
})
}
@Test
fun `SchemaGenerator generates a GraphQL schema with repeated types to test conflicts`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithRepeatedTypes())), config = testSchemaConfig)
val resultType = schema.getObjectType("Result")
val topLevelQuery = schema.getObjectType("Query")
assertEquals("Result!", topLevelQuery.getFieldDefinition("query").type.deepName)
assertEquals("SomeObject", resultType.getFieldDefinition("someObject").type.deepName)
assertEquals("[Int!]!", resultType.getFieldDefinition("someIntValues").type.deepName)
assertEquals("[Boolean!]!", resultType.getFieldDefinition("someBooleanValues").type.deepName)
assertEquals("[SomeObject!]!", resultType.getFieldDefinition("someObjectValues").type.deepName)
assertEquals("[SomeOtherObject!]!", resultType.getFieldDefinition("someOtherObjectValues").type.deepName)
}
@Test
fun `SchemaGenerator generates a GraphQL schema with mixed nullity`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithNullableAndNonNullTypes())), config = testSchemaConfig)
val resultType = schema.getObjectType("MixedNullityResult")
val topLevelQuery = schema.getObjectType("Query")
assertEquals("MixedNullityResult!", topLevelQuery.getFieldDefinition("query").type.deepName)
assertEquals("String", resultType.getFieldDefinition("oneThing").type.deepName)
assertEquals("String!", resultType.getFieldDefinition("theNextThing").type.deepName)
}
@Test
fun `SchemaGenerator generates a GraphQL schema where the input types differ from the output types`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithInputObject())), config = testSchemaConfig)
val topLevelQuery = schema.getObjectType("Query")
assertEquals(
"SomeObjectInput!",
topLevelQuery.getFieldDefinition("query").getArgument("someObject").type.deepName
)
assertEquals("SomeObject!", topLevelQuery.getFieldDefinition("query").type.deepName)
}
@Test
fun `SchemaGenerator generates a GraphQL schema where the input and output enum is the same`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithInputEnum())), config = testSchemaConfig)
val topLevelQuery = schema.getObjectType("Query")
assertEquals("SomeEnum!", topLevelQuery.getFieldDefinition("query").getArgument("someEnum").type.deepName)
assertEquals("SomeEnum!", topLevelQuery.getFieldDefinition("query").type.deepName)
}
@Test
fun `SchemaGenerator names types according to custom name in @GraphQLName`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithCustomName())), config = testSchemaConfig)
val topLevelQuery = schema.getObjectType("Query")
assertEquals("SomeInputObjectRenamedInput!", topLevelQuery.getFieldDefinition("query").getArgument("someInputObjectWithCustomName").type.deepName)
assertEquals("SomeEnumRenamed!", topLevelQuery.getFieldDefinition("query").getArgument("someEnumWithCustomName").type.deepName)
assertEquals("SomeObjectWithDefaultNameInput!", topLevelQuery.getFieldDefinition("query").getArgument("someObjectWithDefaultName").type.deepName)
assertEquals("SomeOtherObjectRenamed!", topLevelQuery.getFieldDefinition("query").type.deepName)
}
@Test
fun `SchemaGenerator names self-referencing types according to custom name in @GraphQLName`() {
val schema = toSchema(queries = listOf(TopLevelObject(QuerySelfReferencingWithCustomName())), config = testSchemaConfig)
val topLevelQuery = schema.getObjectType("Query")
val resultType = schema.getObjectType("ObjectSelfReferencingRenamed")
assertEquals("ObjectSelfReferencingRenamed!", topLevelQuery.getFieldDefinition("query").type.deepName)
assertEquals("ObjectSelfReferencingRenamed", resultType.getFieldDefinition("self").type.deepName)
}
@Test
fun `SchemaGenerator documents types annotated with @Description`() {
val schema = toSchema(
queries = listOf(TopLevelObject(QueryObject())),
mutations = listOf(TopLevelObject(MutationObject())),
config = testSchemaConfig
)
val geo = schema.getObjectType("Geography")
assertTrue(geo.description.startsWith("A place"))
}
@Test
fun `SchemaGenerator documents arguments annotated with @Description`() {
val schema = toSchema(
queries = listOf(TopLevelObject(QueryObject())),
mutations = listOf(TopLevelObject(MutationObject())),
config = testSchemaConfig
)
val documentation = schema.queryType.fieldDefinitions.first().arguments.first().description
assertEquals("A GraphQL value", documentation)
}
@Test
fun `SchemaGenerator documents properties annotated with @Description`() {
val schema = toSchema(
queries = listOf(TopLevelObject(QueryObject())),
mutations = listOf(TopLevelObject(MutationObject())),
config = testSchemaConfig
)
val documentation = schema.queryType.fieldDefinitions.first().description
assertEquals("A GraphQL query method", documentation)
}
@Test
fun `SchemaGenerator can expose functions on result classes`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithDataThatContainsFunction())), config = testSchemaConfig)
val resultWithFunction = schema.getObjectType("ResultWithFunction")
val repeatFieldDefinition = resultWithFunction.getFieldDefinition("repeat")
assertEquals("repeat", repeatFieldDefinition.name)
assertEquals("Int!", repeatFieldDefinition.arguments.first().type.deepName)
assertEquals("String!", repeatFieldDefinition.type.deepName)
}
@Test
fun `SchemaGenerator can execute functions on result classes`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithDataThatContainsFunction())), config = testSchemaConfig)
val graphQL = GraphQL.newGraphQL(schema).build()
val result = graphQL.execute("{ query(something: \"thing\") { repeat(n: 3) } }")
val data: Map<String, Map<String, Any>> = result.getData()
assertEquals("thingthingthing", data["query"]?.get("repeat"))
}
@Test
fun `SchemaGenerator ignores private fields`() {
val schema =
toSchema(queries = listOf(TopLevelObject(QueryWithPrivateParts())), config = testSchemaConfig)
val topLevelQuery = schema.getObjectType("Query")
val query = topLevelQuery.getFieldDefinition("query")
val resultWithPrivateParts = query.type as? GraphQLObjectType
assertNotNull(resultWithPrivateParts)
assertEquals("ResultWithPrivateParts", resultWithPrivateParts.deepName)
assertEquals(1, resultWithPrivateParts.fieldDefinitions.size)
assertEquals("something", resultWithPrivateParts.fieldDefinitions[0].name)
}
@Test
fun `SchemaGenerator throws when encountering java stdlib`() {
assertFailsWith(GraphQLKotlinException::class) {
toSchema(queries = listOf(TopLevelObject(QueryWithJavaClass())), config = testSchemaConfig)
}
}
@Test
fun `SchemaGenerator throws when encountering list of java stdlib`() {
assertFailsWith(GraphQLKotlinException::class) {
toSchema(queries = listOf(TopLevelObject(QueryWithListOfJavaClass())), config = testSchemaConfig)
}
}
@Test
fun `SchemaGenerator throws when encountering conflicting types`() {
assertFailsWith(ConflictingTypesException::class) {
toSchema(queries = listOf(TopLevelObject(QueryWithConflictingTypes())), config = testSchemaConfig)
}
}
@Suppress("UNCHECKED_CAST")
@Test
fun `SchemaGenerator supports type references`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithParentChildRelationship())), config = testSchemaConfig)
val graphQL = GraphQL.newGraphQL(schema).build()
val result = graphQL.execute("{ query { name children { name } } }")
val data = result.getData<Map<String, Map<String, Any>>>()
assertNotNull(data)
val res: Map<String, Any>? = data["query"]
assertEquals("Bob", res?.get("name").toString())
val bobChildren = res?.get("children") as? List<Map<String, Any>>
assertNotNull(bobChildren)
val firstChild = bobChildren.get(0)
assertEquals("Alice", firstChild["name"])
assertNull(firstChild["children"])
}
@Test
fun `SchemaGenerator support GraphQLID scalar`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithId())), config = testSchemaConfig)
val placeType = schema.getObjectType("PlaceOfIds")
assertEquals(Scalars.GraphQLID, (placeType.getFieldDefinition("intId").type as? GraphQLNonNull)?.wrappedType)
assertEquals(Scalars.GraphQLID, (placeType.getFieldDefinition("longId").type as? GraphQLNonNull)?.wrappedType)
assertEquals(Scalars.GraphQLID, (placeType.getFieldDefinition("stringId").type as? GraphQLNonNull)?.wrappedType)
assertEquals(Scalars.GraphQLID, (placeType.getFieldDefinition("uuid").type as? GraphQLNonNull)?.wrappedType)
}
@Test
fun `SchemaGenerator throws an exception for invalid GraphQLID`() {
val exception = assertFailsWith(InvalidIdTypeException::class) {
toSchema(queries = listOf(TopLevelObject(QueryWithInvalidId())), config = testSchemaConfig)
}
assertEquals("Person is not a valid ID type, only [kotlin.Int, kotlin.String, kotlin.Long, java.util.UUID] are accepted", exception.message)
}
@Test
fun `SchemaGenerator supports Scalar GraphQLID for input types`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryObject())), mutations = listOf(TopLevelObject(MutationWithId())), config = testSchemaConfig)
val furnitureType = schema.getObjectType("Furniture")
val serialField = furnitureType.getFieldDefinition("serial").type as? GraphQLNonNull
assertEquals(Scalars.GraphQLID, serialField?.wrappedType)
}
@Test
fun `SchemaGenerator supports DataFetcherResult as a return type`() {
val schema = toSchema(queries = listOf(TopLevelObject(QueryWithDataFetcherResult())), config = testSchemaConfig)
val graphQL = GraphQL.newGraphQL(schema).build()
val result = graphQL.execute("{ dataAndErrors }")
val data = result.getData<Map<String, String>>()
val errors = result.errors
assertNotNull(data)
val res: String? = data["dataAndErrors"]
assertEquals(actual = res, expected = "Hello")
assertNotNull(errors)
assertEquals(expected = 1, actual = errors.size)
}
class QueryObject {
@GraphQLDescription("A GraphQL query method")
fun query(@GraphQLDescription("A GraphQL value") value: Int): Geography = Geography(value, GeoType.CITY, listOf())
}
class QueryWithArray {
fun sumOf(ints: IntArray): Int = ints.sum()
fun sumOfComplexArray(objects: Array<ComplexWrappingType>): Int = objects.map { it.value }.sum()
}
class QueryWithIgnored {
fun query(): ResultWithIgnored? = null
@GraphQLIgnore
@Suppress("Detekt.FunctionOnlyReturningConstant")
fun ignoredFunction() = "payNoAttentionToMe"
}
class ResultWithIgnored(val something: String) {
@GraphQLIgnore
val ignoredProperty = "payNoAttentionToMe"
@GraphQLIgnore
@Suppress("Detekt.FunctionOnlyReturningConstant")
fun ignoredFunction() = "payNoAttentionToMe"
}
class MutationObject {
fun mutation(value: Int): Boolean = value > 0
}
data class ComplexWrappingType(val value: Int)
@GraphQLDescription("A place")
data class Geography(
val id: Int?,
val type: GeoType,
val locations: List<Location>
)
enum class GeoType {
CITY, STATE
}
data class Location(val lat: Double, val lon: Double)
class QueryWithRepeatedTypes {
fun query(): Result =
Result(
listOf(),
listOf(),
listOf(),
listOf(),
SomeObject("something")
)
}
data class Result(
val someIntValues: List<Int>,
val someBooleanValues: List<Boolean>,
val someObjectValues: List<SomeObject>,
val someOtherObjectValues: List<SomeOtherObject>,
val someObject: SomeObject?
)
data class SomeObject(val name: String)
data class SomeOtherObject(val name: String)
class QueryWithNullableAndNonNullTypes {
fun query(): MixedNullityResult =
MixedNullityResult("hey", "ho")
}
data class MixedNullityResult(val oneThing: String?, val theNextThing: String)
class QueryWithInputObject {
fun query(someObject: SomeObject): SomeObject =
SomeObject("someName")
}
class QueryWithInputEnum {
fun query(someEnum: SomeEnum): SomeEnum =
SomeEnum.SomeValue
}
enum class SomeEnum { SomeValue }
class QueryWithDataThatContainsFunction {
fun query(something: String): ResultWithFunction? =
ResultWithFunction(something)
}
class ResultWithFunction(private val something: String) {
fun repeat(n: Int) = something.repeat(n)
}
class QueryWithPrivateParts {
fun query(something: String): ResultWithPrivateParts? = null
}
class ResultWithPrivateParts(val something: String) {
private val privateSomething: String = "soPrivate"
private fun privateFunction(): Int = 2
}
class QueryWithJavaClass {
fun query(): java.net.CookieManager? = CookieManager()
}
class QueryWithListOfJavaClass {
fun listQuery(): List<java.net.CookieManager> = listOf(CookieManager())
}
class QueryWithConflictingTypes {
@GraphQLDescription("A conflicting GraphQL query method")
fun type1() = GeoType.CITY
@GraphQLDescription("A second conflicting GraphQL query method")
fun type2() = com.expediagroup.graphql.test.conflicts.GeoType.CITY
}
class QueryWithParentChildRelationship {
fun query(): Person {
val children = listOf(Person("Alice"))
return Person("Bob", children)
}
}
data class Person(val name: String, val children: List<Person>? = null)
data class PlaceOfIds(
@GraphQLID val intId: Int,
@GraphQLID val longId: Long,
@GraphQLID val stringId: String,
@GraphQLID val uuid: UUID
)
data class InvalidIds(@GraphQLID val person: Person)
class QueryWithId {
fun query(): PlaceOfIds = PlaceOfIds(42, 24, "42", UUID.randomUUID())
}
class QueryWithInvalidId {
fun query(): InvalidIds = InvalidIds(Person("person id not a valid type id"))
}
data class SomeObjectWithDefaultName(val title: String)
@GraphQLName("SomeObjectRenamed")
data class SomeObjectWithCustomName(val title: String)
@GraphQLName("SomeOtherObjectRenamed")
data class SomeOtherObjectWithCustomName(
val title: String,
val someObject: SomeObjectWithCustomName,
val someEnum: SomeEnumWithCustomName
)
@GraphQLName("SomeInputObjectRenamed")
data class SomeInputObjectWithCustomName(val title: String)
@GraphQLName("SomeEnumRenamed")
enum class SomeEnumWithCustomName { ONE, TWO }
class QueryWithCustomName {
fun query(
someInputObjectWithCustomName: SomeInputObjectWithCustomName,
someEnumWithCustomName: SomeEnumWithCustomName,
someObjectWithDefaultName: SomeObjectWithDefaultName
): SomeOtherObjectWithCustomName =
SomeOtherObjectWithCustomName(
title = someObjectWithDefaultName.title,
someObject = SomeObjectWithCustomName("something"),
someEnum = someEnumWithCustomName
)
}
@GraphQLName("ObjectSelfReferencingRenamed")
data class ObjectSelfReferencingWithCustomName(
val self: ObjectSelfReferencingWithCustomName? = null
)
class QuerySelfReferencingWithCustomName {
fun query(): ObjectSelfReferencingWithCustomName = ObjectSelfReferencingWithCustomName()
}
class MutationWithId {
fun mutate(furniture: Furniture): Furniture = furniture
}
data class Furniture(
@GraphQLID val serial: UUID,
val type: String
)
class QueryWithDataFetcherResult {
fun dataAndErrors(): DataFetcherResult<String> {
val error = ExceptionWhileDataFetching(ExecutionPath.rootPath(), RuntimeException(), SourceLocation(1, 1))
return DataFetcherResult.newResult<String>().data("Hello").error(error).build()
}
}
}