I have a GraphQL server using ExpressJS. Want to write a schema using GraphQL-Tools:
I want to get a Object like this...
User: {
firstName,
lastName,
location: {
city,
state,
lat,
lan
},
phoneNumber
}
with that design I can maintain details of the user in a single object. But I canot find the way of doing nested objects with graphql-tools..
type User {
id: String
name: String
location: Location
}
type Location {
city: String
country: String
zip: String
}
when I try with the above mentioned type, I am getting console errors:
throw new SchemaError('Resolve function missing for "' + typeName + '.' + fieldName + '"');
^
Error: Resolve function missing for "User.location"
Please anyone can show me the right way or if I did any mistake please correct me.