File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
example/src/main/kotlin/com/expedia/graphql/sample/query Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com.expedia.graphql.sample.query
2
+
3
+ import com.expedia.graphql.annotations.GraphQLDescription
4
+ import com.expedia.graphql.annotations.GraphQLIgnore
5
+ import org.springframework.beans.factory.BeanFactory
6
+ import org.springframework.beans.factory.BeanFactoryAware
7
+ import org.springframework.beans.factory.getBean
8
+ import org.springframework.context.annotation.Scope
9
+ import org.springframework.stereotype.Component
10
+
11
+ @Component
12
+ class SubQueries : Query , BeanFactoryAware {
13
+ private lateinit var beanFactory: BeanFactory
14
+
15
+ @GraphQLIgnore
16
+ override fun setBeanFactory (beanFactory : BeanFactory ) {
17
+ this .beanFactory = beanFactory
18
+ }
19
+
20
+ @GraphQLDescription(
21
+ """ Creates a hierarchy of executable fields.
22
+ Arguments can be passed from `main` to the `SubQuery` via the constructor invoke by the bean factory"""
23
+ )
24
+ fun main (): SubQuery = beanFactory.getBean()
25
+ }
26
+
27
+ @Component
28
+ @Scope(" prototype" )
29
+ class SubQuery {
30
+ fun secondary () = " secondary"
31
+ }
You can’t perform that action at this time.
0 commit comments