Skip to content

Commit 8f818e2

Browse files
committed
feat: created relationship of hobbies to users + now can query all hobbies related to a user
1 parent 25dc314 commit 8f818e2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/schema/schema.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ const UserType = new GraphQLObjectType({
4141
resolve(parent, args){
4242
return _.filter(postData, {userId: parent.id});
4343
}
44+
},
45+
46+
hobbies:{
47+
type: new GraphQLList(HobbyType),
48+
resolve(parent, args){
49+
return _.filter(hobbyData, {userId: parent.id});
50+
}
4451
}
4552
})
4653
});

0 commit comments

Comments
 (0)