File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ val CustomScalarType = GraphQLScalarType<CustomScalar> {
3434 }
3535}
3636
37- val CustomObjectType : GraphQLObjectType <CustomObject > = GraphQLObjectType {
37+ object CustomObjectType : GraphQLObjectClass <CustomObject>( {
3838 name("Custom ")
3939 description { " An example of a custom object type." }
4040 field(CustomObject ::name) {
@@ -45,7 +45,28 @@ val CustomObjectType: GraphQLObjectType<CustomObject> = GraphQLObjectType {
4545 type { GraphQLStringType }
4646 description { " The value of the object." }
4747 }
48- }
48+ field("this") {
49+ type { CustomObjectType }
50+ description { " This" }
51+ get { instance }
52+ }
53+ field("copycatOfThis") {
54+ type { CustomObjectTypeCopyCat }
55+ description { " This but as the copycat version." }
56+ get { instance }
57+ }
58+ })
59+
60+ object CustomObjectTypeCopyCat : GraphQLObjectClass<CustomObject>({
61+ name("CustomCopyCat ")
62+ description { " An example of a custom object type copying another type." }
63+
64+ directives += CustomObjectType .directives
65+ interfaces += CustomObjectType .interfaces
66+ onGetBlocks += CustomObjectType .onGetBlocks
67+ onGetBlockingBlocks += CustomObjectType .onGetBlockingBlocks
68+ fields += CustomObjectType .fields
69+ })
4970
5071fun main () {
5172 embeddedServer(
You can’t perform that action at this time.
0 commit comments