-
Notifications
You must be signed in to change notification settings - Fork 371
Closed
Description
Hi Team,
I have used custom scalar Object/Json to receive a input json in the mutation. Use case is to keep value field a generic once where Any custom json object can be sent.
type Entry {
key: String!
value: Object!
}
type Mutation {
saveEntry(entry: Entry!): Object!
}
Example mutation call looks like following:
mutation {
saveEntry(entry : {
key: "order",
value: {
id: "123",
type: "mobile"
payment: {
method: "Cash"
amount: "1212"
}
}
})
}
I have also defined customHooks as follows:
override fun willGenerateGraphQLType(type: KType): GraphQLType? = when (type.classifier as? KClass<*>) {
Any::class -> graphqlObjectType
JsonObject::class -> ExtendedScalars.Json
else -> null
}
After doing all this, In mutation handler, i receive an empty object {} in value field. Can you please help me understand how can this be resolved ?
Metadata
Metadata
Assignees
Labels
No labels