2

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.

Nic3500
  • 8,144
  • 10
  • 29
  • 40
user10269224
  • 73
  • 10
  • 1
    When posting a question, make sure you use the editor to highlight code sections, and indent your code. This will greatly help readability and maximize your chances at getting an answer. – Nic3500 Aug 24 '18 at 11:37

0 Answers0