Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 572 Bytes

README.md

File metadata and controls

36 lines (30 loc) · 572 Bytes

class-to-graphql-schema-type

format Java Class to GraphQL Schema Type

Example

Java Class

import io.github.morningk.graphql.NonNull;
import io.github.morningk.graphql.ScalarType;

public class User {

  private Long id;
  public String name;
  public int age;

  @ScalarType("ID")
  @NonNull
  public Long getId() {
    return this.id;
  }
}
import io.github.morningk.graphql.tool.Formatter;

String result = Formatter.formatSchemaType(User.class);

GraphQL Schema Type

type User {
  name: String
  age: Int
  id: ID!
}