food-graphql-server/src/typeDefs.ts

36 lines
678 B
TypeScript
Raw Normal View History

2021-02-01 13:36:26 +00:00
// Type definitions define the "shape" of your data and specify
// which ways the data can be fetched from the GraphQL server.
import "reflect-metadata";
2021-02-02 10:34:34 +00:00
import { ObjectType, Field, ID, InputType, Int } from "type-graphql";
import { number } from "yup/lib/locale";
2021-02-01 13:36:26 +00:00
@ObjectType()
export class Store {
2021-02-02 10:34:34 +00:00
@Field()
2021-02-01 13:36:26 +00:00
id: string;
2021-02-02 10:34:34 +00:00
@Field()
name: string;
@Field()
city: string;
@Field(type => Int)
number: number;
@Field()
postalCode: string
@Field()
street: string
}
@InputType()
export class StoreInput {
@Field()
2021-02-01 13:36:26 +00:00
name: string;
2021-02-02 10:34:34 +00:00
@Field()
city: string;
@Field(type => Int)
number: number;
@Field()
postalCode: string
@Field()
street: string
2021-02-01 13:36:26 +00:00
}