Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

graphql nested schema

const StaffType = new GraphQLObjectType({
    name: 'Staff',
    fields: {
      id: {type: GraphQLInt},
      name: {type: GraphQLString},
      role: {type: GraphQLString},
      address: {type: AddressType}
    }
})

const AddressType = new GraphQLObjectType({
    name: 'Address',
    fields: {
      street: {type: GraphQLString},
      town: {type: GraphQLString}
    }
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #graphql #nested #schema
ADD COMMENT
Topic
Name
4+6 =