Sorry, couldn't find it anywhere in the docs, henc...
# kgraphql
m
Sorry, couldn't find it anywhere in the docs, hence asking here
j
By calling
inputType<Address>()
now this will be included as a input type in your schema. KGraphQL will also automatically pick up_(so no need to specify it with the
inputType
)_ any input types that you provide to your resolvers. Easiest way is to just provide it directly to your resolver like this
Copy code
query("locationData") {
  resolver { address: Address ->
    println(address.city)
    ...
  }
}
Example within the docs are here: https://kgraphql.io/Reference/resolver/#arguments
m
I did exactly this. So how do I pass a custom object like this to the query? In GraphiQL?
j
sorry for late response.
But let's say you have this setup. Then you can write this query:
Copy code
mutation {
  locationData(address: { city: "Hometown", zipCode: "600" })
}
👍 1
m
Thank you, it worked