Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. const { graphql, GraphQLSchema, GraphQLObjectType, GraphQLString } = require("graphql");
  2.  
  3. const schema = new GraphQLSchema({
  4. query: new GraphQLObjectType({
  5. name: "QueryType",
  6. fields: {
  7. name: { type: GraphQLString },
  8. surname: { type: GraphQLString },
  9. email: { type: GraphQLString },
  10. phoneNumber: { type: GraphQLString }
  11. }
  12. })
  13. });
  14.  
  15. /*
  16. Resolvers don't have to be static data, you can do an API request to fetch data
  17. */
  18.  
  19. const resolvers = {
  20. name: () => "Shailen",
  21. surname: () => "Naidoo",
  22. email: () => "shailen@gettruck.co.za",
  23. phoneNumber: () => "0826103353"
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement