Class GraphqlIDCoercing
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription@Nullable ObjectparseLiteral(@NonNull Value<?> input, @NonNull CoercedVariables variables, @NonNull GraphQLContext graphQLContext, @NonNull Locale locale) Called during query execution to convert a query input AST node into a Java object acceptable for the scalar type.parseLiteral(@NonNull Object input) Deprecated.parseValue(@NonNull Object input) Deprecated.parseValue(@NonNull Object input, @NonNull GraphQLContext graphQLContext, @NonNull Locale locale) Called to resolve an input from a query variable into a Java object acceptable for the scalar type.Deprecated.@Nullable Objectserialize(@NonNull Object dataFetcherResult, @NonNull GraphQLContext graphQLContext, @NonNull Locale locale) Called to convert a Java object result of a DataFetcher to a valid runtime value for the scalar type.valueToLiteral(@NonNull Object input) Deprecated.@NonNull Value<?> valueToLiteral(@NonNull Object input, @NonNull GraphQLContext graphQLContext, @NonNull Locale locale) Converts an external input value to a literal (Ast Value).Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface graphql.schema.CoercingparseLiteral
- 
Constructor Details- 
GraphqlIDCoercingpublic GraphqlIDCoercing()
 
- 
- 
Method Details- 
serializeDeprecated.Description copied from interface:CoercingThis is deprecated and you should implementCoercing.serialize(Object, GraphQLContext, Locale)insteadCalled to convert a Java object result of a DataFetcher to a valid runtime value for the scalar type. Note : Throw CoercingSerializeExceptionif there is fundamental problem during serialization, don't return null to indicate failure.Note : You should not allow RuntimeExceptions to come out of your serialize method, but rather catch them and fire them asCoercingSerializeExceptioninstead as per the method contract.
- 
serializepublic @Nullable Object serialize(@NonNull Object dataFetcherResult, @NonNull GraphQLContext graphQLContext, @NonNull Locale locale) throws CoercingSerializeException Description copied from interface:CoercingCalled to convert a Java object result of a DataFetcher to a valid runtime value for the scalar type.Note : Throw CoercingSerializeExceptionif there is fundamental problem during serialization, don't return null to indicate failure.Note : You should not allow RuntimeExceptions to come out of your serialize method, but rather catch them and fire them asCoercingSerializeExceptioninstead as per the method contract.- Specified by:
- serializein interface- Coercing<Object,- Object> 
- Parameters:
- dataFetcherResult- is never null
- graphQLContext- the graphql context in place
- locale- the locale to use
- Returns:
- a serialized value which may be null.
- Throws:
- CoercingSerializeException- if value input can't be serialized
 
- 
parseValueDeprecated.Description copied from interface:CoercingThis is deprecated and you should implementCoercing.parseValue(Object, GraphQLContext, Locale)insteadCalled to resolve an input from a query variable into a Java object acceptable for the scalar type. Note : You should not allow RuntimeExceptions to come out of your parseValue method, but rather catch them and fire them asCoercingParseValueExceptioninstead as per the method contract.Note : if input is explicit/raw value null, input coercion will return null before this method is called - Specified by:
- parseValuein interface- Coercing<Object,- Object> 
- Parameters:
- input- is never null
- Returns:
- a parsed value which may be null
 
- 
parseValuepublic Object parseValue(@NonNull Object input, @NonNull GraphQLContext graphQLContext, @NonNull Locale locale) throws CoercingParseValueException Description copied from interface:CoercingCalled to resolve an input from a query variable into a Java object acceptable for the scalar type.Note : You should not allow RuntimeExceptions to come out of your parseValue method, but rather catch them and fire them asCoercingParseValueExceptioninstead as per the method contract. Note : if input is explicit/raw value null, input coercion will return null before this method is called- Specified by:
- parseValuein interface- Coercing<Object,- Object> 
- Parameters:
- input- is never null
- graphQLContext- the graphql context in place
- locale- the locale to use
- Returns:
- a parsed value which may be null
- Throws:
- CoercingParseValueException- if value input can't be parsed
 
- 
parseLiteralDeprecated.Description copied from interface:CoercingThis is deprecated and you should implementCoercing.parseLiteral(Value, CoercedVariables, GraphQLContext, Locale)insteadCalled during query validation to convert a query input AST node into a Java object acceptable for the scalar type. The input object will be an instance of Value.Note : You should not allow RuntimeExceptions to come out of your parseLiteral method, but rather catch them and fire them asCoercingParseLiteralExceptioninstead as per the method contract.Note : if input is literal NullValue, input coercion will return null before this method is called- Specified by:
- parseLiteralin interface- Coercing<Object,- Object> 
- Parameters:
- input- is never null
- Returns:
- a parsed value which may be null
 
- 
parseLiteralpublic @Nullable Object parseLiteral(@NonNull Value<?> input, @NonNull CoercedVariables variables, @NonNull GraphQLContext graphQLContext, @NonNull Locale locale) throws CoercingParseLiteralException Description copied from interface:CoercingCalled during query execution to convert a query input AST node into a Java object acceptable for the scalar type. The input object will be an instance ofValue.Note : You should not allow RuntimeExceptions to come out of your parseLiteral method, but rather catch them and fire them asCoercingParseLiteralExceptioninstead as per the method contract.Many scalar types don't need to implement this method because they don't take AST VariableReferenceobjects and convert them into actual values. But for those scalar types that want to do this, then this method should be implemented. Note : if input is literalNullValue, input coercion will return null before this method is called- Specified by:
- parseLiteralin interface- Coercing<Object,- Object> 
- Parameters:
- input- is never null
- variables- the resolved variables passed to the query
- graphQLContext- the graphql context in place
- locale- the locale to use
- Returns:
- a parsed value which may be null
- Throws:
- CoercingParseLiteralException- if input literal can't be parsed
 
- 
valueToLiteralDeprecated.Description copied from interface:CoercingThis is deprecated and you should implementCoercing.valueToLiteral(Object, GraphQLContext, Locale)insteadConverts an external input value to a literal (Ast Value). IMPORTANT: the argument is validated before by calling Coercing.parseValue(Object).- Specified by:
- valueToLiteralin interface- Coercing<Object,- Object> 
- Parameters:
- input- an external input value
- Returns:
- The literal matching the external input value.
 
- 
valueToLiteralpublic @NonNull Value<?> valueToLiteral(@NonNull Object input, @NonNull GraphQLContext graphQLContext, @NonNull Locale locale) Description copied from interface:CoercingConverts an external input value to a literal (Ast Value).IMPORTANT: the argument is validated before by calling Coercing.parseValue(Object).- Specified by:
- valueToLiteralin interface- Coercing<Object,- Object> 
- Parameters:
- input- an external input value
- graphQLContext- the graphql context in place
- locale- the locale to use
- Returns:
- The literal matching the external input value.
 
 
-