Nexus
From https://nexusjs.org/docs/getting-started/tutorial/chapter-writing-your-first-schema
import { objectType } from "nexus";
export const Post = objectType({
name: "Post", // <- Name of your type
definition(t) {
t.int("id"); // <- Field named `id` of type `Int`
t.string("title"); // <- Field named `title` of type `String`
t.string("body"); // <- Field named `body` of type `String`
t.boolean("published"); // <- Field named `published` of type `Boolean`
},
});
Grats
import { Int } from "grats";
/** @gqlType */
type Post = {
/** @gqlField */
id: Int; // <- Field named `id` of type `Int`
/** @gqlField */
title: string; // <- Field named `title` of type `String`
/** @gqlField */
body: string; // <- Field named `body` of type `String`
/** @gqlField */
published: boolean; // <- Field named `published` of type `Boolean`
};