My GraphQL Schema looks like this:
type User {
id: ID
name: String
}
type Mutation {
createUser(name: String): User
}
I am interested in generating the signature and resolver in TypeScript for this schema.
type createUser = (name: string) => User; // <- defining the signature
const createUserResolver: createUser = (name) => {} as User; // <- creating the resolver
I am concerned that if I manually define the createUser
signature and the schema changes, I will need to remember to update the signature.
Is there a way to automatically generate the signature when the schema changes?