Skip to content

Semantics #74

@mishushakov

Description

@mishushakov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions