Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. I am getting following error and not sure whats causing problem.
  2.  
  3. I tried to run application and getting following
  4. error:DesktopGraphqlgraphql-playlistserverschemaschema.js:94
  5. });
  6. ^
  7.  
  8. const RootQuery = new GraphQLObjectType({
  9. //Query for getting details of a specific book.
  10. name:'RootQueryType',
  11. fields:{
  12. book:{
  13. type:BookType,
  14. args:{id:{type:GraphQLID}},
  15. resolve(parent,args){
  16. console.log(typeof(args.id));
  17. return_.find(books,{id:args.id});
  18. }
  19. },
  20. author:{
  21. type:AuthorType,
  22. args:{id:{type:GraphQLID}},
  23. resolve(parent,args){
  24. //code to get data from db/other source.
  25. return_.find(authors,{id:args.id});
  26. }
  27. },
  28. books:{
  29. type:new GraphQLList(BookType),
  30. resolve(parent,args){
  31. return books;
  32. }
  33. },
  34. authors:{
  35. type:new GraphQLList(AuthorType),
  36. resolve(parent,args){
  37. return authors;
  38. }
  39. }
  40. //line 94
  41. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement