Slide 15
Slide 15 text
15
パターン C: code-first / DSL builder + 型推論 (GraphQL)
const User = builder.objectType("User", {
fields: (t) => ({
id: t.exposeID("id"),
name: t.exposeString("name"),
posts: t.field({
type: [Post],
resolve: (parent, _args, ctx) =>
ctx.postLoader.loadByUserId(parent.id),
}),
}),
});
Pothos GraphQL
e.g. GraphQL Nexus,
Pothos GraphQL