garph
garph copied to clipboard
Semantics
We want to propose a optional, but recommended field type which helps with semantics, especially on bigger projects
Before:
const blogType = g
.type("Blog", {
title: g
.string()
.optional()
.list()
.args({
test: g.string(),
})
.description("The title of the blog"),
})
.description("The blog of the user");
After:
const newBlogType = g
.type("Blog", {
title: g
.field(g.string().optional().list())
.args({
test: g.string(),
})
.description("The title of the blog"),
})
.description("The blog of the user");
Notice the change in LoC