Skip to content

Commit 1f9afa9

Browse files
committed
Shortcut annotations target method level only again
Closes gh-290
1 parent 937c265 commit 1f9afa9

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/MutationMapping.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,14 +28,10 @@
2828
* shortcut for {@link SchemaMapping @SchemaMapping} with
2929
* {@code typeName="Mutation"}.
3030
*
31-
* <p>You can use this annotation both at the method and at the class level, in
32-
* which case all handlers methods in the controller are mutations, unless the
33-
* typeName is overridden.
34-
*
3531
* @author Rossen Stoyanchev
3632
* @since 1.0.0
3733
*/
38-
@Target({ElementType.TYPE, ElementType.METHOD})
34+
@Target(ElementType.METHOD)
3935
@Retention(RetentionPolicy.RUNTIME)
4036
@Documented
4137
@SchemaMapping(typeName = "Mutation")

spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/QueryMapping.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,14 +28,10 @@
2828
* shortcut for {@link SchemaMapping @SchemaMapping} with
2929
* {@code typeName="Query"}.
3030
*
31-
* <p>You can use this annotation both at the method and at the class level, in
32-
* which case all handlers methods in the controller are queries, unless the
33-
* typeName is overridden.
34-
*
3531
* @author Rossen Stoyanchev
3632
* @since 1.0.0
3733
*/
38-
@Target({ElementType.TYPE, ElementType.METHOD})
34+
@Target(ElementType.METHOD)
3935
@Retention(RetentionPolicy.RUNTIME)
4036
@Documented
4137
@SchemaMapping(typeName = "Query")

spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/SubscriptionMapping.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,14 +28,10 @@
2828
* shortcut for {@link SchemaMapping @SchemaMapping} with
2929
* {@code typeName="Subscription"}.
3030
*
31-
* <p>You can use this annotation both at the method and at the class level, in
32-
* which case all handlers methods in the controller are subscriptions, unless the
33-
* typeName is overridden.
34-
*
3531
* @author Rossen Stoyanchev
3632
* @since 1.0.0
3733
*/
38-
@Target({ElementType.TYPE, ElementType.METHOD})
34+
@Target(ElementType.METHOD)
3935
@Retention(RetentionPolicy.RUNTIME)
4036
@Documented
4137
@SchemaMapping(typeName = "Subscription")

0 commit comments

Comments
 (0)