Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { graphql, GraphQLSchema, GraphQLObjectType, GraphQLString } = require("graphql");
- const schema = new GraphQLSchema({
- query: new GraphQLObjectType({
- name: "QueryType",
- fields: {
- name: { type: GraphQLString },
- surname: { type: GraphQLString },
- email: { type: GraphQLString },
- phoneNumber: { type: GraphQLString }
- }
- })
- });
- /*
- Resolvers don't have to be static data, you can do an API request to fetch data
- */
- const resolvers = {
- name: () => "Shailen",
- surname: () => "Naidoo",
- email: () => "shailen@gettruck.co.za",
- phoneNumber: () => "0826103353"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement