@@ -10,8 +10,8 @@ Here is an example of a schema for an Event app with the properties `name` and `
1010import { Entity , Type } from ' @graphprotocol/hypergraph' ;
1111
1212export class Event extends Entity .Class <Event >(' Event' )({
13- name: Type .Text ,
14- description: Type .Text ,
13+ name: Type .String ,
14+ description: Type .String ,
1515}) {}
1616```
1717
@@ -23,19 +23,19 @@ In order to define relations between Types, you can use the `Type.Relation` type
2323import { Entity , Type } from ' @graphprotocol/hypergraph' ;
2424
2525export class Company extends Entity .Class <Company >(' Company' )({
26- name: Type .Text ,
26+ name: Type .String ,
2727}) {}
2828
2929export class Event extends Entity .Class <Event >(' Event' )({
30- name: Type .Text ,
31- description: Type .Text ,
30+ name: Type .String ,
31+ description: Type .String ,
3232 sponsors: Type .Relation (Company ),
3333}) {}
3434```
3535
3636## Available Types
3737
38- - ` Type.Text ` (string)
38+ - ` Type.String ` (string)
3939- ` Type.Number ` (number)
4040- ` Type.Date ` (date)
4141- ` Type.Boolean ` (boolean)
@@ -48,7 +48,7 @@ Example:
4848import { Entity , Type } from ' @graphprotocol/hypergraph' ;
4949
5050export class Company extends Entity .Class <Company >(' Company' )({
51- name: Type .Text ,
51+ name: Type .String ,
5252 employees: Type .Number ,
5353 founded: Type .Date ,
5454 active: Type .Boolean ,
@@ -64,8 +64,8 @@ You can make a field optional by wrapping it in `Type.optional`.
6464import { Entity , Type } from ' @graphprotocol/hypergraph' ;
6565
6666export class Company extends Entity .Class <Company >(' Company' )({
67- name: Type .Text ,
68- description: Type .optional (Type .Text ),
67+ name: Type .String ,
68+ description: Type .optional (Type .String ),
6969 founded: Type .optional (Type .Date ),
7070}) {}
7171```
0 commit comments