tfiwm
06/09/2018, 3:42 PMnilan
06/09/2018, 3:47 PMtfiwm
06/09/2018, 3:49 PMtfiwm
06/09/2018, 3:49 PMtfiwm
06/09/2018, 3:49 PMtfiwm
06/09/2018, 3:50 PM__resolveType(obj) {
console.log(obj);
return { country: 'Germany', zipcode: '70734' };
},
tfiwm
06/09/2018, 3:51 PMAddress: {
__resolveType: async (parent, args, ctx: Context, info) => {
return { country: 'Germany', zipcode: '70734' };
},
city: async (parent, args, ctx: Context, info) => {
return 'Fellbach';
}
}
nilan
06/09/2018, 4:09 PMnilan
06/09/2018, 4:09 PMtfiwm
06/09/2018, 4:17 PMtfiwm
06/09/2018, 4:17 PMtfiwm
06/09/2018, 4:17 PMtfiwm
06/09/2018, 4:19 PMtype Address {
company: String!
address: String!
zipcode: String!
city: String!
state: String
country: String!
vat: String!
}
export const Address = {
resolve: async (parent, args, ctx: Context, info) => {
return { country: 'Germany', zipcode: '70734', ... };
},
city: async (parent, args, ctx: Context, info) => {
return // return the city from somewhere else;
}
};
nilan
06/09/2018, 4:19 PMtfiwm
06/09/2018, 4:20 PMnilan
06/09/2018, 4:22 PMnilan
06/09/2018, 4:23 PMtfiwm
06/09/2018, 4:26 PMnilan
06/09/2018, 4:31 PMnilan
06/09/2018, 4:31 PMtfiwm
06/09/2018, 4:34 PMtfiwm
06/09/2018, 4:36 PMnilan
06/09/2018, 4:42 PMtfiwm
06/09/2018, 4:43 PMnilan
06/09/2018, 4:49 PMtfiwm
06/09/2018, 4:50 PMtfiwm
06/09/2018, 4:50 PMnilan
06/09/2018, 4:50 PMnilan
06/09/2018, 4:50 PMnilan
06/09/2018, 4:50 PMtfiwm
06/09/2018, 4:51 PMtfiwm
06/09/2018, 4:51 PMnilan
06/09/2018, 4:54 PMtfiwm
06/09/2018, 4:56 PMtfiwm
06/09/2018, 4:56 PMnilan
06/09/2018, 5:01 PMtfiwm
06/09/2018, 5:03 PM