Skip to content

Commit 6246294

Browse files
committed
chore(docs): pokemon type fields non-nullable
1 parent 9119f04 commit 6246294

File tree

5 files changed

+35
-35
lines changed

5 files changed

+35
-35
lines changed

src/generator/config/__snapshots__/config.test.ts.snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ type Patron implements Being {
6969
}
7070
7171
type Pokemon implements Being {
72-
attack: Int
73-
birthday: Date
74-
defense: Int
75-
hp: Int
76-
id: ID
77-
name: String
72+
attack: Int!
73+
birthday: Date!
74+
defense: Int!
75+
hp: Int!
76+
id: ID!
77+
name: String!
7878
trainer: Trainer
79-
type: PokemonType
79+
type: PokemonType!
8080
}
8181
8282
input PokemonFilter {

tests/_/schemas/pokemon/graffle/modules/schema.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -537,42 +537,42 @@ export namespace Schema {
537537
export interface attack extends $.OutputField {
538538
name: 'attack'
539539
arguments: {}
540-
inlineType: [0]
540+
inlineType: [1]
541541
namedType: $$NamedTypes.$$Int
542542
}
543543

544544
export interface birthday extends $.OutputField {
545545
name: 'birthday'
546546
arguments: {}
547-
inlineType: [0]
547+
inlineType: [1]
548548
namedType: $$NamedTypes.$$Date
549549
}
550550

551551
export interface defense extends $.OutputField {
552552
name: 'defense'
553553
arguments: {}
554-
inlineType: [0]
554+
inlineType: [1]
555555
namedType: $$NamedTypes.$$Int
556556
}
557557

558558
export interface hp extends $.OutputField {
559559
name: 'hp'
560560
arguments: {}
561-
inlineType: [0]
561+
inlineType: [1]
562562
namedType: $$NamedTypes.$$Int
563563
}
564564

565565
export interface id extends $.OutputField {
566566
name: 'id'
567567
arguments: {}
568-
inlineType: [0]
568+
inlineType: [1]
569569
namedType: $$NamedTypes.$$ID
570570
}
571571

572572
export interface name extends $.OutputField {
573573
name: 'name'
574574
arguments: {}
575-
inlineType: [0]
575+
inlineType: [1]
576576
namedType: $$NamedTypes.$$String
577577
}
578578

@@ -586,7 +586,7 @@ export namespace Schema {
586586
export interface type extends $.OutputField {
587587
name: 'type'
588588
arguments: {}
589-
inlineType: [0]
589+
inlineType: [1]
590590
namedType: $$NamedTypes.$$PokemonType
591591
}
592592
}

tests/_/schemas/pokemon/graffle/schema.graphql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ type Patron implements Being {
6666
}
6767

6868
type Pokemon implements Being {
69-
attack: Int
70-
birthday: Date
71-
defense: Int
72-
hp: Int
73-
id: ID
74-
name: String
69+
attack: Int!
70+
birthday: Date!
71+
defense: Int!
72+
hp: Int!
73+
id: ID!
74+
name: String!
7575
trainer: Trainer
76-
type: PokemonType
76+
type: PokemonType!
7777
}
7878

7979
input PokemonFilter {

tests/_/schemas/pokemon/schema.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ const Trainer = builder.objectRef<DatabaseServer.Trainer>(`Trainer`).implement({
5858
const Pokemon = builder.objectRef<DatabaseServer.Pokemon>(`Pokemon`).implement({
5959
interfaces: [Being],
6060
fields: (t) => ({
61-
id: t.id({ resolve: (pokemon) => pokemon.id }),
62-
type: t.field({ type: PokemonType, resolve: (pokemon) => pokemon.type }),
63-
name: t.string({ resolve: (pokemon) => pokemon.name }),
64-
hp: t.int({ resolve: (pokemon) => pokemon.hp }),
65-
attack: t.int({ resolve: (pokemon) => pokemon.attack }),
66-
defense: t.int({ resolve: (pokemon) => pokemon.defense }),
67-
birthday: t.field({ type: `Date`, resolve: (pokemon) => pokemon.birthday }),
61+
id: t.id({ resolve: (pokemon) => pokemon.id, nullable: false }),
62+
type: t.field({ type: PokemonType, resolve: (pokemon) => pokemon.type, nullable: false }),
63+
name: t.string({ resolve: (pokemon) => pokemon.name, nullable: false }),
64+
hp: t.int({ resolve: (pokemon) => pokemon.hp, nullable: false }),
65+
attack: t.int({ resolve: (pokemon) => pokemon.attack, nullable: false }),
66+
defense: t.int({ resolve: (pokemon) => pokemon.defense, nullable: false }),
67+
birthday: t.field({ type: `Date`, resolve: (pokemon) => pokemon.birthday, nullable: false }),
6868
trainer: t.field({
6969
type: Trainer,
7070
nullable: true,

website/graffle/modules/Schema.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -537,42 +537,42 @@ export namespace Schema {
537537
export interface attack extends $.OutputField {
538538
name: "attack";
539539
arguments: {};
540-
inlineType: [0];
540+
inlineType: [1];
541541
namedType: $$NamedTypes.$$Int;
542542
}
543543

544544
export interface birthday extends $.OutputField {
545545
name: "birthday";
546546
arguments: {};
547-
inlineType: [0];
547+
inlineType: [1];
548548
namedType: $$NamedTypes.$$Date;
549549
}
550550

551551
export interface defense extends $.OutputField {
552552
name: "defense";
553553
arguments: {};
554-
inlineType: [0];
554+
inlineType: [1];
555555
namedType: $$NamedTypes.$$Int;
556556
}
557557

558558
export interface hp extends $.OutputField {
559559
name: "hp";
560560
arguments: {};
561-
inlineType: [0];
561+
inlineType: [1];
562562
namedType: $$NamedTypes.$$Int;
563563
}
564564

565565
export interface id extends $.OutputField {
566566
name: "id";
567567
arguments: {};
568-
inlineType: [0];
568+
inlineType: [1];
569569
namedType: $$NamedTypes.$$ID;
570570
}
571571

572572
export interface name extends $.OutputField {
573573
name: "name";
574574
arguments: {};
575-
inlineType: [0];
575+
inlineType: [1];
576576
namedType: $$NamedTypes.$$String;
577577
}
578578

@@ -586,7 +586,7 @@ export namespace Schema {
586586
export interface type extends $.OutputField {
587587
name: "type";
588588
arguments: {};
589-
inlineType: [0];
589+
inlineType: [1];
590590
namedType: $$NamedTypes.$$PokemonType;
591591
}
592592
}

0 commit comments

Comments
 (0)