Today, we’ll start to create our Graphql queries and mutations.
Open up the typesDefs.js
file. The first thing we need to do is map out what our data is going to be. We know that we need to have a User
object to represent a user in our project, so let’s start there.
Remove the previous code in our typeDefs.js
file and replace it with this =>
const { gql } = require("apollo-server");
module.exports = gql`
type User {
username: String!
email: String!
password: String!
}
`
#react #graphql #postgres #technology #100daysofcode