-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathGraphQLController.java
63 lines (53 loc) · 2.04 KB
/
GraphQLController.java
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
package com.bretpatterson.schemagen.graphql.annotations;
import com.bretpatterson.schemagen.graphql.IMutationFactory;
import com.bretpatterson.schemagen.graphql.IQueryFactory;
import com.bretpatterson.schemagen.graphql.impl.DefaultQueryAndMutationFactory;
import com.bretpatterson.schemagen.graphql.utils.AnnotationUtils;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Classes annotated with this method are scanned for methods defined as queryable.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface GraphQLController {
/**
* When using relay this must be set, otherwise it's an optional object name to wrapper
* this controllers top level queries within.
* @return
*/
String rootQueriesObjectName() default AnnotationUtils.DEFAULT_NULL;
/**
* When using relay this must be set, otherwise it's an optional object name to wrapper
* this controllers top level mutations within.
* @return
*/
String rootMutationsObjectName() default AnnotationUtils.DEFAULT_NULL;
/**
*
* This factory that will be used to generate queries for this object, if any.
* Default factory scans the object for {@link GraphQLQuery} annotated methods and turns
* the methods into queries.
* @return
*/
Class<? extends IQueryFactory> queryFactory() default DefaultQueryAndMutationFactory.class;
/**
* This factory that will be used to generate mutations for this object, if any.
* Default factory scans the object for {@link GraphQLMutation} annotated methods and turns
* the methods into mutations.
* @return
*/
Class<? extends IMutationFactory> mutationFactory() default DefaultQueryAndMutationFactory.class;
/**
* Set the description for the root query object name
* @return
*/
String queryDescription() default AnnotationUtils.DEFAULT_NULL;
/**
* Set the description for the root mutation object name
* @return
*/
String mutationDescription() default AnnotationUtils.DEFAULT_NULL;
}