|
1 | 1 | package graphql.scalars.alias; |
2 | 2 |
|
3 | 3 | import graphql.Assert; |
| 4 | +import graphql.GraphQLContext; |
4 | 5 | import graphql.Internal; |
| 6 | +import graphql.execution.CoercedVariables; |
5 | 7 | import graphql.language.Value; |
6 | 8 | import graphql.schema.Coercing; |
7 | 9 | import graphql.schema.CoercingParseLiteralException; |
8 | 10 | import graphql.schema.CoercingParseValueException; |
9 | 11 | import graphql.schema.CoercingSerializeException; |
10 | 12 | import graphql.schema.GraphQLScalarType; |
11 | 13 |
|
12 | | -import java.util.Map; |
| 14 | +import java.util.Locale; |
13 | 15 |
|
14 | 16 | /** |
15 | 17 | * Access this via {@link graphql.scalars.ExtendedScalars#newAliasedScalar(String)} |
16 | 18 | */ |
17 | 19 | @Internal |
18 | 20 | public final class AliasedScalar { |
19 | 21 |
|
20 | | - private AliasedScalar() {} |
| 22 | + private AliasedScalar() { |
| 23 | + } |
21 | 24 |
|
22 | 25 | /** |
23 | 26 | * A builder for {@link graphql.scalars.alias.AliasedScalar} |
@@ -75,31 +78,25 @@ public GraphQLScalarType build() { |
75 | 78 |
|
76 | 79 | private static GraphQLScalarType aliasedScalarImpl(String name, String description, GraphQLScalarType aliasedScalar) { |
77 | 80 | Assert.assertNotNull(aliasedScalar); |
78 | | - Coercing<Object, Object> coercing = new Coercing<Object, Object>() { |
79 | | - @Override |
80 | | - public Object serialize(Object input) throws CoercingSerializeException { |
81 | | - return aliasedScalar.getCoercing().serialize(input); |
82 | | - } |
83 | | - |
| 81 | + Coercing<Object, Object> coercing = new Coercing<>() { |
84 | 82 | @Override |
85 | | - public Object parseValue(Object input) throws CoercingParseValueException { |
86 | | - return aliasedScalar.getCoercing().parseValue(input); |
| 83 | + public Object serialize(Object input, GraphQLContext graphQLContext, Locale locale) throws CoercingSerializeException { |
| 84 | + return aliasedScalar.getCoercing().serialize(input, graphQLContext, locale); |
87 | 85 | } |
88 | 86 |
|
89 | 87 | @Override |
90 | | - public Object parseLiteral(Object input) throws CoercingParseLiteralException { |
91 | | - return aliasedScalar.getCoercing().parseLiteral(input); |
| 88 | + public Object parseValue(Object input, GraphQLContext graphQLContext, Locale locale) throws CoercingParseValueException { |
| 89 | + return aliasedScalar.getCoercing().parseValue(input, graphQLContext, locale); |
92 | 90 | } |
93 | 91 |
|
94 | 92 | @Override |
95 | | - public Object parseLiteral(Object input, Map<String, Object> variables) throws CoercingParseLiteralException { |
96 | | - Coercing<?, ?> c = aliasedScalar.getCoercing(); |
97 | | - return c.parseLiteral(input, variables); |
| 93 | + public Object parseLiteral(Value<?> input, CoercedVariables variables, GraphQLContext graphQLContext, Locale locale) throws CoercingParseLiteralException { |
| 94 | + return aliasedScalar.getCoercing().parseLiteral(input, variables, graphQLContext, locale); |
98 | 95 | } |
99 | 96 |
|
100 | 97 | @Override |
101 | | - public Value<?> valueToLiteral(Object input) { |
102 | | - return aliasedScalar.getCoercing().valueToLiteral(input); |
| 98 | + public Value<?> valueToLiteral(Object input, GraphQLContext graphQLContext, Locale locale) { |
| 99 | + return aliasedScalar.getCoercing().valueToLiteral(input, graphQLContext, locale); |
103 | 100 | } |
104 | 101 | }; |
105 | 102 | return GraphQLScalarType.newScalar() |
|
0 commit comments