Updating our Schema
Learn how to update a schema by using Postgres with an endpoint.
We'll cover the following...
User type and input
We’ll use a schema with only the User
type. Let’s start by adding this type and then creating our resolvers. We’ll add the definition of the following types:
Press + to interact
const types = gql`type User {id: Stringfirstname: Stringlastname: String}input UserInput {firstname: Stringlastname: String}`;
User queries
In this section, we’ll define our queries. In particular, we’ll define the getUser
query that returns a given user from their associated id
. As the first step, let’s add the query to our types:
...