Paul Hendrickson
11/11/2020, 4:47 PMconst customer = objectType({
name: “customer”,
definition(t) {
t.model.addressLine1
t.model.addressLine2
t.field(“address”, {
type: “string”,
resolve: (root) => root.addressLine1 + root.addressLine2
}
}
});
and I don’t want the graphql to have “addressLine1” and “addressLine2” because it’s unnecessary.bkrausz
11/11/2020, 11:11 PMroot.addressLine1/2
are both always available regardless of what your object definition declares.Paul Hendrickson
11/12/2020, 11:55 PMt.model.addressLine1()
I get a typescript error in
t.field("address", {
type: "string",
resolve: (root) => root.addressLine1 + root.addressLine2
}
saying addressLine1 doesn’t existleedavidcs
11/13/2020, 2:42 PM