graphql-platform
graphql-platform copied to clipboard
Handle List and User defined property types using from Json directive
Currently, we are not handling List and user-defined property types.
In the below example, we have a recent address that is of user-defined type "Address" and an address history is a List of Address. With the proposed changes these fields will be resolved.
type Author {
id: Int! @fromJson
name: String! @fromJson
birthdate: DateTime @fromJson
recentaddress: Address @fromJson
addresshistory: [Address] @fromJson
}
type Address{
id: Int! @fromJson
state: String! @fromJson
pincode: String! @fromJson
}
extend type Book {
author: Author
}
Hey @vickytr44,
great to have you back for another contribution.
Can you add a test that shows what you are fixing?
Yes i will write unit test for this.
I have added unit test for the changes.
Thank you ... will have a look at it today.