Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Create separate .d.ts file for type definitions #6

Open
kbrandwijk opened this issue Dec 28, 2017 · 13 comments
Open

Create separate .d.ts file for type definitions #6

kbrandwijk opened this issue Dec 28, 2017 · 13 comments

Comments

@kbrandwijk
Copy link
Contributor

For both js and ts generators, putting the type definitions in a separate .d.ts file helps with IDE tooling.

@schickling
Copy link
Collaborator

Any idea how this would then work with js-only codebases? What would be the equivalent for the following:

https://github.com/graphql-boilerplates/typescript-graphql-server/blob/master/advanced/src/utils.ts#L2-L7

@kbrandwijk
Copy link
Contributor Author

Yes, in that case you can't strongly type that context parameter, but setting it on the context would ideally provide IDE intellisense because the .d.ts file is present.

@schickling
Copy link
Collaborator

schickling commented Jan 2, 2018

Would would you set the context type then?

@kbrandwijk
Copy link
Contributor Author

When I use the javascript generated binding file, I still get intellisense support in VS code, even without a typings file (they added that in one of the recent releases). Do you still think this is needed @schickling?
image

@schickling
Copy link
Collaborator

Is that snippet vanilla JS? I'm wondering how ctx: Context works?

@kbrandwijk
Copy link
Contributor Author

No, this is the JS binding in a TS project, sorry... I'll retest with a full JS project.

@ForsakenHarmony
Copy link

ForsakenHarmony commented Feb 27, 2018

.d.ts files would be very useful

I can use typescript and webstorm recognises it, but it would be nice to just have the definitions

@kbrandwijk
Copy link
Contributor Author

Creating a separate .d.ts file isn't that difficult, the difficuly comes from the fact that .graphqlconfig only has one output setting. My current idea is to add an optional typings setting to the graphql-config extension (similar to package.json) that, when present, causes it to put the typings in a separate file. @schickling Do you agree with that solution?

@schickling
Copy link
Collaborator

@kbrandwijk can you show an example how that would look like?

@kbrandwijk
Copy link
Contributor Author

extensions:
   prepare-binding:
      output: src/generated/prisma.ts
      typings: src/generated/prisma.d.ts
      generator: prisma-ts

If typings is there, it will create two separate files, otherwise just one. This makes sure it is a non-breaking change, and anyone not changing their config will get the identical output to what they're getting now, which is very important I think.

@KATT
Copy link

KATT commented Mar 20, 2018

Heya. I can try to have a stab at it, but unsure where to start, can you give me some pointers?

I want to generate the interfaces separately so they can be shared between clients/server. (KATT/shop#35)

@KATT
Copy link

KATT commented Mar 21, 2018

How come prisma bindings didn’t go on using + contributing to like gql2ts underneath instead of writing your own lib for generating ts defs?

Was it considered? It seems well-maintained, well-tested, etc.

gql2ts seems quite mature and generates some pretty sweet defs. I tried it on my `prisma.gql`
// tslint:disable
// graphql typescript definitions

declare namespace GQL {
  interface IGraphQLResponseRoot {
    data?: IQuery | IMutation | ISubscription;
    errors?: Array<IGraphQLResponseError>;
  }

  interface IGraphQLResponseError {
    /** Required for all errors */
    message: string;
    locations?: Array<IGraphQLResponseErrorLocation>;
    /** 7.2.2 says 'GraphQL servers may provide additional entries to error' */
    [propName: string]: any;
  }

  interface IGraphQLResponseErrorLocation {
    line: number;
    column: number;
  }

  interface IQuery {
    __typename: 'Query';
    users: Array<IUser>;
    brands: Array<IBrand>;
    products: Array<IProduct>;
    orders: Array<IOrder>;
    orderRows: Array<IOrderRow>;
    discountCodes: Array<IDiscountCode>;
    user: IUser | null;
    brand: IBrand | null;
    product: IProduct | null;
    order: IOrder | null;
    orderRow: IOrderRow | null;
    discountCode: IDiscountCode | null;
    usersConnection: IUserConnection;
    brandsConnection: IBrandConnection;
    productsConnection: IProductConnection;
    ordersConnection: IOrderConnection;
    orderRowsConnection: IOrderRowConnection;
    discountCodesConnection: IDiscountCodeConnection;

    /**
     * Fetches an object given its ID
     */
    node: Node | null;
  }

  interface IUsersOnQueryArguments {
    where?: IUserWhereInput | null;
    orderBy?: UserOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IBrandsOnQueryArguments {
    where?: IBrandWhereInput | null;
    orderBy?: BrandOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IProductsOnQueryArguments {
    where?: IProductWhereInput | null;
    orderBy?: ProductOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IOrdersOnQueryArguments {
    where?: IOrderWhereInput | null;
    orderBy?: OrderOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IOrderRowsOnQueryArguments {
    where?: IOrderRowWhereInput | null;
    orderBy?: OrderRowOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IDiscountCodesOnQueryArguments {
    where?: IDiscountCodeWhereInput | null;
    orderBy?: DiscountCodeOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IUserOnQueryArguments {
    where: IUserWhereUniqueInput;
  }

  interface IBrandOnQueryArguments {
    where: IBrandWhereUniqueInput;
  }

  interface IProductOnQueryArguments {
    where: IProductWhereUniqueInput;
  }

  interface IOrderOnQueryArguments {
    where: IOrderWhereUniqueInput;
  }

  interface IOrderRowOnQueryArguments {
    where: IOrderRowWhereUniqueInput;
  }

  interface IDiscountCodeOnQueryArguments {
    where: IDiscountCodeWhereUniqueInput;
  }

  interface IUsersConnectionOnQueryArguments {
    where?: IUserWhereInput | null;
    orderBy?: UserOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IBrandsConnectionOnQueryArguments {
    where?: IBrandWhereInput | null;
    orderBy?: BrandOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IProductsConnectionOnQueryArguments {
    where?: IProductWhereInput | null;
    orderBy?: ProductOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IOrdersConnectionOnQueryArguments {
    where?: IOrderWhereInput | null;
    orderBy?: OrderOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IOrderRowsConnectionOnQueryArguments {
    where?: IOrderRowWhereInput | null;
    orderBy?: OrderRowOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IDiscountCodesConnectionOnQueryArguments {
    where?: IDiscountCodeWhereInput | null;
    orderBy?: DiscountCodeOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface INodeOnQueryArguments {
    /**
     * The ID of an object
     */
    id: string;
  }

  interface IUserWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IUserWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IUserWhereInput>;
    id?: string | null;

    /**
     * All values that are not equal to given value.
     */
    id_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    id_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    id_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    id_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    id_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    id_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    id_gte?: string | null;

    /**
     * All values containing the given string.
     */
    id_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    id_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    id_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    id_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    id_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    id_not_ends_with?: string | null;
    email?: string | null;

    /**
     * All values that are not equal to given value.
     */
    email_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    email_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    email_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    email_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    email_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    email_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    email_gte?: string | null;

    /**
     * All values containing the given string.
     */
    email_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    email_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    email_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    email_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    email_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    email_not_ends_with?: string | null;
    password?: string | null;

    /**
     * All values that are not equal to given value.
     */
    password_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    password_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    password_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    password_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    password_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    password_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    password_gte?: string | null;

    /**
     * All values containing the given string.
     */
    password_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    password_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    password_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    password_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    password_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    password_not_ends_with?: string | null;
    name?: string | null;

    /**
     * All values that are not equal to given value.
     */
    name_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    name_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    name_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    name_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    name_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    name_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    name_gte?: string | null;

    /**
     * All values containing the given string.
     */
    name_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    name_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    name_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    name_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    name_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    name_not_ends_with?: string | null;
  }

  enum UserOrderByInput {
    id_ASC = 'id_ASC',
    id_DESC = 'id_DESC',
    email_ASC = 'email_ASC',
    email_DESC = 'email_DESC',
    password_ASC = 'password_ASC',
    password_DESC = 'password_DESC',
    name_ASC = 'name_ASC',
    name_DESC = 'name_DESC',
    updatedAt_ASC = 'updatedAt_ASC',
    updatedAt_DESC = 'updatedAt_DESC',
    createdAt_ASC = 'createdAt_ASC',
    createdAt_DESC = 'createdAt_DESC',
  }

  interface IUser {
    __typename: 'User';
    id: string;
    email: string;
    password: string;
    name: string;
  }

  /**
   * An object with an ID
   */
  type Node = IUser | IBrand | IProduct | IOrder | IOrderRow | IDiscountCode;

  /**
   * An object with an ID
   */
  interface INode {
    __typename: 'Node';

    /**
     * The id of the object.
     */
    id: string;
  }

  interface IBrandWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IBrandWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IBrandWhereInput>;
    id?: string | null;

    /**
     * All values that are not equal to given value.
     */
    id_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    id_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    id_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    id_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    id_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    id_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    id_gte?: string | null;

    /**
     * All values containing the given string.
     */
    id_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    id_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    id_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    id_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    id_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    id_not_ends_with?: string | null;
    createdAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    createdAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    createdAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    createdAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    createdAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    createdAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    createdAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    createdAt_gte?: any | null;
    updatedAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    updatedAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    updatedAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    updatedAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    updatedAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    updatedAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    updatedAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    updatedAt_gte?: any | null;
    name?: string | null;

    /**
     * All values that are not equal to given value.
     */
    name_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    name_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    name_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    name_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    name_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    name_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    name_gte?: string | null;

    /**
     * All values containing the given string.
     */
    name_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    name_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    name_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    name_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    name_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    name_not_ends_with?: string | null;
    slug?: string | null;

    /**
     * All values that are not equal to given value.
     */
    slug_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    slug_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    slug_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    slug_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    slug_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    slug_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    slug_gte?: string | null;

    /**
     * All values containing the given string.
     */
    slug_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    slug_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    slug_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    slug_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    slug_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    slug_not_ends_with?: string | null;
    url?: string | null;

    /**
     * All values that are not equal to given value.
     */
    url_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    url_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    url_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    url_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    url_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    url_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    url_gte?: string | null;

    /**
     * All values containing the given string.
     */
    url_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    url_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    url_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    url_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    url_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    url_not_ends_with?: string | null;
  }

  enum BrandOrderByInput {
    id_ASC = 'id_ASC',
    id_DESC = 'id_DESC',
    createdAt_ASC = 'createdAt_ASC',
    createdAt_DESC = 'createdAt_DESC',
    updatedAt_ASC = 'updatedAt_ASC',
    updatedAt_DESC = 'updatedAt_DESC',
    name_ASC = 'name_ASC',
    name_DESC = 'name_DESC',
    slug_ASC = 'slug_ASC',
    slug_DESC = 'slug_DESC',
    url_ASC = 'url_ASC',
    url_DESC = 'url_DESC',
  }

  interface IBrand {
    __typename: 'Brand';
    id: string;
    createdAt: any;
    updatedAt: any;
    name: string;
    slug: string;
    url: string;
  }

  interface IProductWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IProductWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IProductWhereInput>;
    id?: string | null;

    /**
     * All values that are not equal to given value.
     */
    id_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    id_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    id_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    id_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    id_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    id_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    id_gte?: string | null;

    /**
     * All values containing the given string.
     */
    id_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    id_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    id_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    id_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    id_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    id_not_ends_with?: string | null;
    createdAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    createdAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    createdAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    createdAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    createdAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    createdAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    createdAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    createdAt_gte?: any | null;
    updatedAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    updatedAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    updatedAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    updatedAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    updatedAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    updatedAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    updatedAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    updatedAt_gte?: any | null;
    price?: number | null;

    /**
     * All values that are not equal to given value.
     */
    price_not?: number | null;

    /**
     * All values that are contained in given list.
     */
    price_in: Array<number>;

    /**
     * All values that are not contained in given list.
     */
    price_not_in: Array<number>;

    /**
     * All values less than the given value.
     */
    price_lt?: number | null;

    /**
     * All values less than or equal the given value.
     */
    price_lte?: number | null;

    /**
     * All values greater than the given value.
     */
    price_gt?: number | null;

    /**
     * All values greater than or equal the given value.
     */
    price_gte?: number | null;
    name?: string | null;

    /**
     * All values that are not equal to given value.
     */
    name_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    name_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    name_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    name_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    name_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    name_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    name_gte?: string | null;

    /**
     * All values containing the given string.
     */
    name_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    name_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    name_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    name_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    name_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    name_not_ends_with?: string | null;
    slug?: string | null;

    /**
     * All values that are not equal to given value.
     */
    slug_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    slug_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    slug_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    slug_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    slug_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    slug_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    slug_gte?: string | null;

    /**
     * All values containing the given string.
     */
    slug_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    slug_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    slug_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    slug_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    slug_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    slug_not_ends_with?: string | null;
    thumbnail?: string | null;

    /**
     * All values that are not equal to given value.
     */
    thumbnail_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    thumbnail_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    thumbnail_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    thumbnail_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    thumbnail_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    thumbnail_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    thumbnail_gte?: string | null;

    /**
     * All values containing the given string.
     */
    thumbnail_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    thumbnail_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    thumbnail_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    thumbnail_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    thumbnail_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    thumbnail_not_ends_with?: string | null;
    brand?: IBrandWhereInput | null;
  }

  enum ProductOrderByInput {
    id_ASC = 'id_ASC',
    id_DESC = 'id_DESC',
    createdAt_ASC = 'createdAt_ASC',
    createdAt_DESC = 'createdAt_DESC',
    updatedAt_ASC = 'updatedAt_ASC',
    updatedAt_DESC = 'updatedAt_DESC',
    price_ASC = 'price_ASC',
    price_DESC = 'price_DESC',
    name_ASC = 'name_ASC',
    name_DESC = 'name_DESC',
    slug_ASC = 'slug_ASC',
    slug_DESC = 'slug_DESC',
    thumbnail_ASC = 'thumbnail_ASC',
    thumbnail_DESC = 'thumbnail_DESC',
  }

  interface IProduct {
    __typename: 'Product';
    id: string;
    createdAt: any;
    updatedAt: any;
    price: number;
    brand: IBrand;
    name: string;
    slug: string;
    thumbnail: string;
  }

  interface IBrandOnProductArguments {
    where?: IBrandWhereInput | null;
  }

  interface IOrderWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IOrderWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IOrderWhereInput>;
    id?: string | null;

    /**
     * All values that are not equal to given value.
     */
    id_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    id_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    id_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    id_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    id_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    id_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    id_gte?: string | null;

    /**
     * All values containing the given string.
     */
    id_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    id_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    id_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    id_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    id_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    id_not_ends_with?: string | null;
    createdAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    createdAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    createdAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    createdAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    createdAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    createdAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    createdAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    createdAt_gte?: any | null;
    updatedAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    updatedAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    updatedAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    updatedAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    updatedAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    updatedAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    updatedAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    updatedAt_gte?: any | null;
    rows_every?: IOrderRowWhereInput | null;
    rows_some?: IOrderRowWhereInput | null;
    rows_none?: IOrderRowWhereInput | null;
    user?: IUserWhereInput | null;
    discountCodes_every?: IDiscountCodeWhereInput | null;
    discountCodes_some?: IDiscountCodeWhereInput | null;
    discountCodes_none?: IDiscountCodeWhereInput | null;
  }

  interface IOrderRowWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IOrderRowWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IOrderRowWhereInput>;
    id?: string | null;

    /**
     * All values that are not equal to given value.
     */
    id_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    id_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    id_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    id_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    id_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    id_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    id_gte?: string | null;

    /**
     * All values containing the given string.
     */
    id_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    id_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    id_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    id_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    id_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    id_not_ends_with?: string | null;
    createdAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    createdAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    createdAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    createdAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    createdAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    createdAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    createdAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    createdAt_gte?: any | null;
    updatedAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    updatedAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    updatedAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    updatedAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    updatedAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    updatedAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    updatedAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    updatedAt_gte?: any | null;
    quantity?: number | null;

    /**
     * All values that are not equal to given value.
     */
    quantity_not?: number | null;

    /**
     * All values that are contained in given list.
     */
    quantity_in: Array<number>;

    /**
     * All values that are not contained in given list.
     */
    quantity_not_in: Array<number>;

    /**
     * All values less than the given value.
     */
    quantity_lt?: number | null;

    /**
     * All values less than or equal the given value.
     */
    quantity_lte?: number | null;

    /**
     * All values greater than the given value.
     */
    quantity_gt?: number | null;

    /**
     * All values greater than or equal the given value.
     */
    quantity_gte?: number | null;
    product?: IProductWhereInput | null;
    order?: IOrderWhereInput | null;
  }

  interface IDiscountCodeWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IDiscountCodeWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IDiscountCodeWhereInput>;
    id?: string | null;

    /**
     * All values that are not equal to given value.
     */
    id_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    id_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    id_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    id_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    id_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    id_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    id_gte?: string | null;

    /**
     * All values containing the given string.
     */
    id_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    id_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    id_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    id_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    id_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    id_not_ends_with?: string | null;
    createdAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    createdAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    createdAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    createdAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    createdAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    createdAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    createdAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    createdAt_gte?: any | null;
    updatedAt?: any | null;

    /**
     * All values that are not equal to given value.
     */
    updatedAt_not?: any | null;

    /**
     * All values that are contained in given list.
     */
    updatedAt_in: Array<any>;

    /**
     * All values that are not contained in given list.
     */
    updatedAt_not_in: Array<any>;

    /**
     * All values less than the given value.
     */
    updatedAt_lt?: any | null;

    /**
     * All values less than or equal the given value.
     */
    updatedAt_lte?: any | null;

    /**
     * All values greater than the given value.
     */
    updatedAt_gt?: any | null;

    /**
     * All values greater than or equal the given value.
     */
    updatedAt_gte?: any | null;
    code?: string | null;

    /**
     * All values that are not equal to given value.
     */
    code_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    code_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    code_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    code_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    code_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    code_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    code_gte?: string | null;

    /**
     * All values containing the given string.
     */
    code_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    code_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    code_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    code_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    code_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    code_not_ends_with?: string | null;
    name?: string | null;

    /**
     * All values that are not equal to given value.
     */
    name_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    name_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    name_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    name_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    name_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    name_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    name_gte?: string | null;

    /**
     * All values containing the given string.
     */
    name_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    name_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    name_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    name_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    name_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    name_not_ends_with?: string | null;
    description?: string | null;

    /**
     * All values that are not equal to given value.
     */
    description_not?: string | null;

    /**
     * All values that are contained in given list.
     */
    description_in: Array<string>;

    /**
     * All values that are not contained in given list.
     */
    description_not_in: Array<string>;

    /**
     * All values less than the given value.
     */
    description_lt?: string | null;

    /**
     * All values less than or equal the given value.
     */
    description_lte?: string | null;

    /**
     * All values greater than the given value.
     */
    description_gt?: string | null;

    /**
     * All values greater than or equal the given value.
     */
    description_gte?: string | null;

    /**
     * All values containing the given string.
     */
    description_contains?: string | null;

    /**
     * All values not containing the given string.
     */
    description_not_contains?: string | null;

    /**
     * All values starting with the given string.
     */
    description_starts_with?: string | null;

    /**
     * All values not starting with the given string.
     */
    description_not_starts_with?: string | null;

    /**
     * All values ending with the given string.
     */
    description_ends_with?: string | null;

    /**
     * All values not ending with the given string.
     */
    description_not_ends_with?: string | null;
    type?: DiscountCodeType | null;

    /**
     * All values that are not equal to given value.
     */
    type_not?: DiscountCodeType | null;

    /**
     * All values that are contained in given list.
     */
    type_in: Array<DiscountCodeType>;

    /**
     * All values that are not contained in given list.
     */
    type_not_in: Array<DiscountCodeType>;
    amount?: number | null;

    /**
     * All values that are not equal to given value.
     */
    amount_not?: number | null;

    /**
     * All values that are contained in given list.
     */
    amount_in: Array<number>;

    /**
     * All values that are not contained in given list.
     */
    amount_not_in: Array<number>;

    /**
     * All values less than the given value.
     */
    amount_lt?: number | null;

    /**
     * All values less than or equal the given value.
     */
    amount_lte?: number | null;

    /**
     * All values greater than the given value.
     */
    amount_gt?: number | null;

    /**
     * All values greater than or equal the given value.
     */
    amount_gte?: number | null;
  }

  enum DiscountCodeType {
    Percentage = 'Percentage',
  }

  enum OrderOrderByInput {
    id_ASC = 'id_ASC',
    id_DESC = 'id_DESC',
    createdAt_ASC = 'createdAt_ASC',
    createdAt_DESC = 'createdAt_DESC',
    updatedAt_ASC = 'updatedAt_ASC',
    updatedAt_DESC = 'updatedAt_DESC',
  }

  interface IOrder {
    __typename: 'Order';
    id: string;
    createdAt: any;
    updatedAt: any;
    rows: Array<IOrderRow>;
    user: IUser | null;
    discountCodes: Array<IDiscountCode>;
  }

  interface IRowsOnOrderArguments {
    where?: IOrderRowWhereInput | null;
    orderBy?: OrderRowOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  interface IUserOnOrderArguments {
    where?: IUserWhereInput | null;
  }

  interface IDiscountCodesOnOrderArguments {
    where?: IDiscountCodeWhereInput | null;
    orderBy?: DiscountCodeOrderByInput | null;
    skip?: number | null;
    after?: string | null;
    before?: string | null;
    first?: number | null;
    last?: number | null;
  }

  enum OrderRowOrderByInput {
    id_ASC = 'id_ASC',
    id_DESC = 'id_DESC',
    createdAt_ASC = 'createdAt_ASC',
    createdAt_DESC = 'createdAt_DESC',
    updatedAt_ASC = 'updatedAt_ASC',
    updatedAt_DESC = 'updatedAt_DESC',
    quantity_ASC = 'quantity_ASC',
    quantity_DESC = 'quantity_DESC',
  }

  interface IOrderRow {
    __typename: 'OrderRow';
    id: string;
    createdAt: any;
    updatedAt: any;
    quantity: number;
    product: IProduct;
    order: IOrder;
  }

  interface IProductOnOrderRowArguments {
    where?: IProductWhereInput | null;
  }

  interface IOrderOnOrderRowArguments {
    where?: IOrderWhereInput | null;
  }

  enum DiscountCodeOrderByInput {
    id_ASC = 'id_ASC',
    id_DESC = 'id_DESC',
    createdAt_ASC = 'createdAt_ASC',
    createdAt_DESC = 'createdAt_DESC',
    updatedAt_ASC = 'updatedAt_ASC',
    updatedAt_DESC = 'updatedAt_DESC',
    code_ASC = 'code_ASC',
    code_DESC = 'code_DESC',
    name_ASC = 'name_ASC',
    name_DESC = 'name_DESC',
    description_ASC = 'description_ASC',
    description_DESC = 'description_DESC',
    type_ASC = 'type_ASC',
    type_DESC = 'type_DESC',
    amount_ASC = 'amount_ASC',
    amount_DESC = 'amount_DESC',
  }

  interface IDiscountCode {
    __typename: 'DiscountCode';
    id: string;
    createdAt: any;
    updatedAt: any;
    code: string;
    name: string;
    description: string;
    type: DiscountCodeType;
    amount: number;
  }

  interface IUserWhereUniqueInput {
    id?: string | null;
    email?: string | null;
  }

  interface IBrandWhereUniqueInput {
    id?: string | null;
    slug?: string | null;
  }

  interface IProductWhereUniqueInput {
    id?: string | null;
    slug?: string | null;
  }

  interface IOrderWhereUniqueInput {
    id?: string | null;
  }

  interface IOrderRowWhereUniqueInput {
    id?: string | null;
  }

  interface IDiscountCodeWhereUniqueInput {
    id?: string | null;
    code?: string | null;
  }

  /**
   * A connection to a list of items.
   */
  interface IUserConnection {
    __typename: 'UserConnection';

    /**
     * Information to aid in pagination.
     */
    pageInfo: IPageInfo;

    /**
     * A list of edges.
     */
    edges: Array<IUserEdge>;
    aggregate: IAggregateUser;
  }

  /**
   * Information about pagination in a connection.
   */
  interface IPageInfo {
    __typename: 'PageInfo';

    /**
     * When paginating forwards, are there more items?
     */
    hasNextPage: boolean;

    /**
     * When paginating backwards, are there more items?
     */
    hasPreviousPage: boolean;

    /**
     * When paginating backwards, the cursor to continue.
     */
    startCursor: string | null;

    /**
     * When paginating forwards, the cursor to continue.
     */
    endCursor: string | null;
  }

  /**
   * An edge in a connection.
   */
  interface IUserEdge {
    __typename: 'UserEdge';

    /**
     * The item at the end of the edge.
     */
    node: IUser;

    /**
     * A cursor for use in pagination.
     */
    cursor: string;
  }

  interface IAggregateUser {
    __typename: 'AggregateUser';
    count: number;
  }

  /**
   * A connection to a list of items.
   */
  interface IBrandConnection {
    __typename: 'BrandConnection';

    /**
     * Information to aid in pagination.
     */
    pageInfo: IPageInfo;

    /**
     * A list of edges.
     */
    edges: Array<IBrandEdge>;
    aggregate: IAggregateBrand;
  }

  /**
   * An edge in a connection.
   */
  interface IBrandEdge {
    __typename: 'BrandEdge';

    /**
     * The item at the end of the edge.
     */
    node: IBrand;

    /**
     * A cursor for use in pagination.
     */
    cursor: string;
  }

  interface IAggregateBrand {
    __typename: 'AggregateBrand';
    count: number;
  }

  /**
   * A connection to a list of items.
   */
  interface IProductConnection {
    __typename: 'ProductConnection';

    /**
     * Information to aid in pagination.
     */
    pageInfo: IPageInfo;

    /**
     * A list of edges.
     */
    edges: Array<IProductEdge>;
    aggregate: IAggregateProduct;
  }

  /**
   * An edge in a connection.
   */
  interface IProductEdge {
    __typename: 'ProductEdge';

    /**
     * The item at the end of the edge.
     */
    node: IProduct;

    /**
     * A cursor for use in pagination.
     */
    cursor: string;
  }

  interface IAggregateProduct {
    __typename: 'AggregateProduct';
    count: number;
  }

  /**
   * A connection to a list of items.
   */
  interface IOrderConnection {
    __typename: 'OrderConnection';

    /**
     * Information to aid in pagination.
     */
    pageInfo: IPageInfo;

    /**
     * A list of edges.
     */
    edges: Array<IOrderEdge>;
    aggregate: IAggregateOrder;
  }

  /**
   * An edge in a connection.
   */
  interface IOrderEdge {
    __typename: 'OrderEdge';

    /**
     * The item at the end of the edge.
     */
    node: IOrder;

    /**
     * A cursor for use in pagination.
     */
    cursor: string;
  }

  interface IAggregateOrder {
    __typename: 'AggregateOrder';
    count: number;
  }

  /**
   * A connection to a list of items.
   */
  interface IOrderRowConnection {
    __typename: 'OrderRowConnection';

    /**
     * Information to aid in pagination.
     */
    pageInfo: IPageInfo;

    /**
     * A list of edges.
     */
    edges: Array<IOrderRowEdge>;
    aggregate: IAggregateOrderRow;
  }

  /**
   * An edge in a connection.
   */
  interface IOrderRowEdge {
    __typename: 'OrderRowEdge';

    /**
     * The item at the end of the edge.
     */
    node: IOrderRow;

    /**
     * A cursor for use in pagination.
     */
    cursor: string;
  }

  interface IAggregateOrderRow {
    __typename: 'AggregateOrderRow';
    count: number;
  }

  /**
   * A connection to a list of items.
   */
  interface IDiscountCodeConnection {
    __typename: 'DiscountCodeConnection';

    /**
     * Information to aid in pagination.
     */
    pageInfo: IPageInfo;

    /**
     * A list of edges.
     */
    edges: Array<IDiscountCodeEdge>;
    aggregate: IAggregateDiscountCode;
  }

  /**
   * An edge in a connection.
   */
  interface IDiscountCodeEdge {
    __typename: 'DiscountCodeEdge';

    /**
     * The item at the end of the edge.
     */
    node: IDiscountCode;

    /**
     * A cursor for use in pagination.
     */
    cursor: string;
  }

  interface IAggregateDiscountCode {
    __typename: 'AggregateDiscountCode';
    count: number;
  }

  interface IMutation {
    __typename: 'Mutation';
    createUser: IUser;
    createBrand: IBrand;
    createProduct: IProduct;
    createOrder: IOrder;
    createOrderRow: IOrderRow;
    createDiscountCode: IDiscountCode;
    updateUser: IUser | null;
    updateBrand: IBrand | null;
    updateProduct: IProduct | null;
    updateOrder: IOrder | null;
    updateOrderRow: IOrderRow | null;
    updateDiscountCode: IDiscountCode | null;
    deleteUser: IUser | null;
    deleteBrand: IBrand | null;
    deleteProduct: IProduct | null;
    deleteOrder: IOrder | null;
    deleteOrderRow: IOrderRow | null;
    deleteDiscountCode: IDiscountCode | null;
    upsertUser: IUser;
    upsertBrand: IBrand;
    upsertProduct: IProduct;
    upsertOrder: IOrder;
    upsertOrderRow: IOrderRow;
    upsertDiscountCode: IDiscountCode;
    updateManyUsers: IBatchPayload;
    updateManyBrands: IBatchPayload;
    updateManyProducts: IBatchPayload;
    updateManyOrders: IBatchPayload;
    updateManyOrderRows: IBatchPayload;
    updateManyDiscountCodes: IBatchPayload;
    deleteManyUsers: IBatchPayload;
    deleteManyBrands: IBatchPayload;
    deleteManyProducts: IBatchPayload;
    deleteManyOrders: IBatchPayload;
    deleteManyOrderRows: IBatchPayload;
    deleteManyDiscountCodes: IBatchPayload;
  }

  interface ICreateUserOnMutationArguments {
    data: IUserCreateInput;
  }

  interface ICreateBrandOnMutationArguments {
    data: IBrandCreateInput;
  }

  interface ICreateProductOnMutationArguments {
    data: IProductCreateInput;
  }

  interface ICreateOrderOnMutationArguments {
    data: IOrderCreateInput;
  }

  interface ICreateOrderRowOnMutationArguments {
    data: IOrderRowCreateInput;
  }

  interface ICreateDiscountCodeOnMutationArguments {
    data: IDiscountCodeCreateInput;
  }

  interface IUpdateUserOnMutationArguments {
    data: IUserUpdateInput;
    where: IUserWhereUniqueInput;
  }

  interface IUpdateBrandOnMutationArguments {
    data: IBrandUpdateInput;
    where: IBrandWhereUniqueInput;
  }

  interface IUpdateProductOnMutationArguments {
    data: IProductUpdateInput;
    where: IProductWhereUniqueInput;
  }

  interface IUpdateOrderOnMutationArguments {
    data: IOrderUpdateInput;
    where: IOrderWhereUniqueInput;
  }

  interface IUpdateOrderRowOnMutationArguments {
    data: IOrderRowUpdateInput;
    where: IOrderRowWhereUniqueInput;
  }

  interface IUpdateDiscountCodeOnMutationArguments {
    data: IDiscountCodeUpdateInput;
    where: IDiscountCodeWhereUniqueInput;
  }

  interface IDeleteUserOnMutationArguments {
    where: IUserWhereUniqueInput;
  }

  interface IDeleteBrandOnMutationArguments {
    where: IBrandWhereUniqueInput;
  }

  interface IDeleteProductOnMutationArguments {
    where: IProductWhereUniqueInput;
  }

  interface IDeleteOrderOnMutationArguments {
    where: IOrderWhereUniqueInput;
  }

  interface IDeleteOrderRowOnMutationArguments {
    where: IOrderRowWhereUniqueInput;
  }

  interface IDeleteDiscountCodeOnMutationArguments {
    where: IDiscountCodeWhereUniqueInput;
  }

  interface IUpsertUserOnMutationArguments {
    where: IUserWhereUniqueInput;
    create: IUserCreateInput;
    update: IUserUpdateInput;
  }

  interface IUpsertBrandOnMutationArguments {
    where: IBrandWhereUniqueInput;
    create: IBrandCreateInput;
    update: IBrandUpdateInput;
  }

  interface IUpsertProductOnMutationArguments {
    where: IProductWhereUniqueInput;
    create: IProductCreateInput;
    update: IProductUpdateInput;
  }

  interface IUpsertOrderOnMutationArguments {
    where: IOrderWhereUniqueInput;
    create: IOrderCreateInput;
    update: IOrderUpdateInput;
  }

  interface IUpsertOrderRowOnMutationArguments {
    where: IOrderRowWhereUniqueInput;
    create: IOrderRowCreateInput;
    update: IOrderRowUpdateInput;
  }

  interface IUpsertDiscountCodeOnMutationArguments {
    where: IDiscountCodeWhereUniqueInput;
    create: IDiscountCodeCreateInput;
    update: IDiscountCodeUpdateInput;
  }

  interface IUpdateManyUsersOnMutationArguments {
    data: IUserUpdateInput;
    where: IUserWhereInput;
  }

  interface IUpdateManyBrandsOnMutationArguments {
    data: IBrandUpdateInput;
    where: IBrandWhereInput;
  }

  interface IUpdateManyProductsOnMutationArguments {
    data: IProductUpdateInput;
    where: IProductWhereInput;
  }

  interface IUpdateManyOrdersOnMutationArguments {
    data: IOrderUpdateInput;
    where: IOrderWhereInput;
  }

  interface IUpdateManyOrderRowsOnMutationArguments {
    data: IOrderRowUpdateInput;
    where: IOrderRowWhereInput;
  }

  interface IUpdateManyDiscountCodesOnMutationArguments {
    data: IDiscountCodeUpdateInput;
    where: IDiscountCodeWhereInput;
  }

  interface IDeleteManyUsersOnMutationArguments {
    where: IUserWhereInput;
  }

  interface IDeleteManyBrandsOnMutationArguments {
    where: IBrandWhereInput;
  }

  interface IDeleteManyProductsOnMutationArguments {
    where: IProductWhereInput;
  }

  interface IDeleteManyOrdersOnMutationArguments {
    where: IOrderWhereInput;
  }

  interface IDeleteManyOrderRowsOnMutationArguments {
    where: IOrderRowWhereInput;
  }

  interface IDeleteManyDiscountCodesOnMutationArguments {
    where: IDiscountCodeWhereInput;
  }

  interface IUserCreateInput {
    email: string;
    password: string;
    name: string;
  }

  interface IBrandCreateInput {
    name: string;
    slug: string;
    url: string;
  }

  interface IProductCreateInput {
    price: number;
    name: string;
    slug: string;
    thumbnail: string;
    brand: IBrandCreateOneInput;
  }

  interface IBrandCreateOneInput {
    create?: IBrandCreateInput | null;
    connect?: IBrandWhereUniqueInput | null;
  }

  interface IOrderCreateInput {
    rows?: IOrderRowCreateManyWithoutOrderInput | null;
    user?: IUserCreateOneInput | null;
    discountCodes?: IDiscountCodeCreateManyInput | null;
  }

  interface IOrderRowCreateManyWithoutOrderInput {
    create: Array<IOrderRowCreateWithoutOrderInput>;
    connect: Array<IOrderRowWhereUniqueInput>;
  }

  interface IOrderRowCreateWithoutOrderInput {
    quantity?: number | null;
    product: IProductCreateOneInput;
  }

  interface IProductCreateOneInput {
    create?: IProductCreateInput | null;
    connect?: IProductWhereUniqueInput | null;
  }

  interface IUserCreateOneInput {
    create?: IUserCreateInput | null;
    connect?: IUserWhereUniqueInput | null;
  }

  interface IDiscountCodeCreateManyInput {
    create: Array<IDiscountCodeCreateInput>;
    connect: Array<IDiscountCodeWhereUniqueInput>;
  }

  interface IDiscountCodeCreateInput {
    code: string;
    name: string;
    description: string;
    type: DiscountCodeType;
    amount: number;
  }

  interface IOrderRowCreateInput {
    quantity?: number | null;
    product: IProductCreateOneInput;
    order: IOrderCreateOneWithoutRowsInput;
  }

  interface IOrderCreateOneWithoutRowsInput {
    create?: IOrderCreateWithoutRowsInput | null;
    connect?: IOrderWhereUniqueInput | null;
  }

  interface IOrderCreateWithoutRowsInput {
    user?: IUserCreateOneInput | null;
    discountCodes?: IDiscountCodeCreateManyInput | null;
  }

  interface IUserUpdateInput {
    email?: string | null;
    password?: string | null;
    name?: string | null;
  }

  interface IBrandUpdateInput {
    name?: string | null;
    slug?: string | null;
    url?: string | null;
  }

  interface IProductUpdateInput {
    price?: number | null;
    name?: string | null;
    slug?: string | null;
    thumbnail?: string | null;
    brand?: IBrandUpdateOneInput | null;
  }

  interface IBrandUpdateOneInput {
    create?: IBrandCreateInput | null;
    connect?: IBrandWhereUniqueInput | null;
    delete?: boolean | null;
    update?: IBrandUpdateDataInput | null;
    upsert?: IBrandUpsertNestedInput | null;
  }

  interface IBrandUpdateDataInput {
    name?: string | null;
    slug?: string | null;
    url?: string | null;
  }

  interface IBrandUpsertNestedInput {
    update: IBrandUpdateDataInput;
    create: IBrandCreateInput;
  }

  interface IOrderUpdateInput {
    rows?: IOrderRowUpdateManyWithoutOrderInput | null;
    user?: IUserUpdateOneInput | null;
    discountCodes?: IDiscountCodeUpdateManyInput | null;
  }

  interface IOrderRowUpdateManyWithoutOrderInput {
    create: Array<IOrderRowCreateWithoutOrderInput>;
    connect: Array<IOrderRowWhereUniqueInput>;
    disconnect: Array<IOrderRowWhereUniqueInput>;
    delete: Array<IOrderRowWhereUniqueInput>;
    update: Array<IOrderRowUpdateWithWhereUniqueWithoutOrderInput>;
    upsert: Array<IOrderRowUpsertWithWhereUniqueWithoutOrderInput>;
  }

  interface IOrderRowUpdateWithWhereUniqueWithoutOrderInput {
    where: IOrderRowWhereUniqueInput;
    data: IOrderRowUpdateWithoutOrderDataInput;
  }

  interface IOrderRowUpdateWithoutOrderDataInput {
    quantity?: number | null;
    product?: IProductUpdateOneInput | null;
  }

  interface IProductUpdateOneInput {
    create?: IProductCreateInput | null;
    connect?: IProductWhereUniqueInput | null;
    delete?: boolean | null;
    update?: IProductUpdateDataInput | null;
    upsert?: IProductUpsertNestedInput | null;
  }

  interface IProductUpdateDataInput {
    price?: number | null;
    name?: string | null;
    slug?: string | null;
    thumbnail?: string | null;
    brand?: IBrandUpdateOneInput | null;
  }

  interface IProductUpsertNestedInput {
    update: IProductUpdateDataInput;
    create: IProductCreateInput;
  }

  interface IOrderRowUpsertWithWhereUniqueWithoutOrderInput {
    where: IOrderRowWhereUniqueInput;
    update: IOrderRowUpdateWithoutOrderDataInput;
    create: IOrderRowCreateWithoutOrderInput;
  }

  interface IUserUpdateOneInput {
    create?: IUserCreateInput | null;
    connect?: IUserWhereUniqueInput | null;
    disconnect?: boolean | null;
    delete?: boolean | null;
    update?: IUserUpdateDataInput | null;
    upsert?: IUserUpsertNestedInput | null;
  }

  interface IUserUpdateDataInput {
    email?: string | null;
    password?: string | null;
    name?: string | null;
  }

  interface IUserUpsertNestedInput {
    update: IUserUpdateDataInput;
    create: IUserCreateInput;
  }

  interface IDiscountCodeUpdateManyInput {
    create: Array<IDiscountCodeCreateInput>;
    connect: Array<IDiscountCodeWhereUniqueInput>;
    disconnect: Array<IDiscountCodeWhereUniqueInput>;
    delete: Array<IDiscountCodeWhereUniqueInput>;
    update: Array<IDiscountCodeUpdateWithWhereUniqueNestedInput>;
    upsert: Array<IDiscountCodeUpsertWithWhereUniqueNestedInput>;
  }

  interface IDiscountCodeUpdateWithWhereUniqueNestedInput {
    where: IDiscountCodeWhereUniqueInput;
    data: IDiscountCodeUpdateDataInput;
  }

  interface IDiscountCodeUpdateDataInput {
    code?: string | null;
    name?: string | null;
    description?: string | null;
    type?: DiscountCodeType | null;
    amount?: number | null;
  }

  interface IDiscountCodeUpsertWithWhereUniqueNestedInput {
    where: IDiscountCodeWhereUniqueInput;
    update: IDiscountCodeUpdateDataInput;
    create: IDiscountCodeCreateInput;
  }

  interface IOrderRowUpdateInput {
    quantity?: number | null;
    product?: IProductUpdateOneInput | null;
    order?: IOrderUpdateOneWithoutRowsInput | null;
  }

  interface IOrderUpdateOneWithoutRowsInput {
    create?: IOrderCreateWithoutRowsInput | null;
    connect?: IOrderWhereUniqueInput | null;
    delete?: boolean | null;
    update?: IOrderUpdateWithoutRowsDataInput | null;
    upsert?: IOrderUpsertWithoutRowsInput | null;
  }

  interface IOrderUpdateWithoutRowsDataInput {
    user?: IUserUpdateOneInput | null;
    discountCodes?: IDiscountCodeUpdateManyInput | null;
  }

  interface IOrderUpsertWithoutRowsInput {
    update: IOrderUpdateWithoutRowsDataInput;
    create: IOrderCreateWithoutRowsInput;
  }

  interface IDiscountCodeUpdateInput {
    code?: string | null;
    name?: string | null;
    description?: string | null;
    type?: DiscountCodeType | null;
    amount?: number | null;
  }

  interface IBatchPayload {
    __typename: 'BatchPayload';

    /**
     * The number of nodes that have been affected by the Batch operation.
     */
    count: any;
  }

  interface ISubscription {
    __typename: 'Subscription';
    user: IUserSubscriptionPayload | null;
    brand: IBrandSubscriptionPayload | null;
    product: IProductSubscriptionPayload | null;
    order: IOrderSubscriptionPayload | null;
    orderRow: IOrderRowSubscriptionPayload | null;
    discountCode: IDiscountCodeSubscriptionPayload | null;
  }

  interface IUserOnSubscriptionArguments {
    where?: IUserSubscriptionWhereInput | null;
  }

  interface IBrandOnSubscriptionArguments {
    where?: IBrandSubscriptionWhereInput | null;
  }

  interface IProductOnSubscriptionArguments {
    where?: IProductSubscriptionWhereInput | null;
  }

  interface IOrderOnSubscriptionArguments {
    where?: IOrderSubscriptionWhereInput | null;
  }

  interface IOrderRowOnSubscriptionArguments {
    where?: IOrderRowSubscriptionWhereInput | null;
  }

  interface IDiscountCodeOnSubscriptionArguments {
    where?: IDiscountCodeSubscriptionWhereInput | null;
  }

  interface IUserSubscriptionWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IUserSubscriptionWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IUserSubscriptionWhereInput>;

    /**
     * The subscription event gets dispatched when it's listed in mutation_in
     */
    mutation_in: Array<MutationType>;

    /**
     * The subscription event gets only dispatched when one of the updated fields names is included in this list
     */
    updatedFields_contains?: string | null;

    /**
     * The subscription event gets only dispatched when all of the field names included in this list have been updated
     */
    updatedFields_contains_every: Array<string>;

    /**
     * The subscription event gets only dispatched when some of the field names included in this list have been updated
     */
    updatedFields_contains_some: Array<string>;
    node?: IUserWhereInput | null;
  }

  enum MutationType {
    CREATED = 'CREATED',
    UPDATED = 'UPDATED',
    DELETED = 'DELETED',
  }

  interface IUserSubscriptionPayload {
    __typename: 'UserSubscriptionPayload';
    mutation: MutationType;
    node: IUser | null;
    updatedFields: Array<string>;
    previousValues: IUserPreviousValues | null;
  }

  interface IUserPreviousValues {
    __typename: 'UserPreviousValues';
    id: string;
    email: string;
    password: string;
    name: string;
  }

  interface IBrandSubscriptionWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IBrandSubscriptionWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IBrandSubscriptionWhereInput>;

    /**
     * The subscription event gets dispatched when it's listed in mutation_in
     */
    mutation_in: Array<MutationType>;

    /**
     * The subscription event gets only dispatched when one of the updated fields names is included in this list
     */
    updatedFields_contains?: string | null;

    /**
     * The subscription event gets only dispatched when all of the field names included in this list have been updated
     */
    updatedFields_contains_every: Array<string>;

    /**
     * The subscription event gets only dispatched when some of the field names included in this list have been updated
     */
    updatedFields_contains_some: Array<string>;
    node?: IBrandWhereInput | null;
  }

  interface IBrandSubscriptionPayload {
    __typename: 'BrandSubscriptionPayload';
    mutation: MutationType;
    node: IBrand | null;
    updatedFields: Array<string>;
    previousValues: IBrandPreviousValues | null;
  }

  interface IBrandPreviousValues {
    __typename: 'BrandPreviousValues';
    id: string;
    createdAt: any;
    updatedAt: any;
    name: string;
    slug: string;
    url: string;
  }

  interface IProductSubscriptionWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IProductSubscriptionWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IProductSubscriptionWhereInput>;

    /**
     * The subscription event gets dispatched when it's listed in mutation_in
     */
    mutation_in: Array<MutationType>;

    /**
     * The subscription event gets only dispatched when one of the updated fields names is included in this list
     */
    updatedFields_contains?: string | null;

    /**
     * The subscription event gets only dispatched when all of the field names included in this list have been updated
     */
    updatedFields_contains_every: Array<string>;

    /**
     * The subscription event gets only dispatched when some of the field names included in this list have been updated
     */
    updatedFields_contains_some: Array<string>;
    node?: IProductWhereInput | null;
  }

  interface IProductSubscriptionPayload {
    __typename: 'ProductSubscriptionPayload';
    mutation: MutationType;
    node: IProduct | null;
    updatedFields: Array<string>;
    previousValues: IProductPreviousValues | null;
  }

  interface IProductPreviousValues {
    __typename: 'ProductPreviousValues';
    id: string;
    createdAt: any;
    updatedAt: any;
    price: number;
    name: string;
    slug: string;
    thumbnail: string;
  }

  interface IOrderSubscriptionWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IOrderSubscriptionWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IOrderSubscriptionWhereInput>;

    /**
     * The subscription event gets dispatched when it's listed in mutation_in
     */
    mutation_in: Array<MutationType>;

    /**
     * The subscription event gets only dispatched when one of the updated fields names is included in this list
     */
    updatedFields_contains?: string | null;

    /**
     * The subscription event gets only dispatched when all of the field names included in this list have been updated
     */
    updatedFields_contains_every: Array<string>;

    /**
     * The subscription event gets only dispatched when some of the field names included in this list have been updated
     */
    updatedFields_contains_some: Array<string>;
    node?: IOrderWhereInput | null;
  }

  interface IOrderSubscriptionPayload {
    __typename: 'OrderSubscriptionPayload';
    mutation: MutationType;
    node: IOrder | null;
    updatedFields: Array<string>;
    previousValues: IOrderPreviousValues | null;
  }

  interface IOrderPreviousValues {
    __typename: 'OrderPreviousValues';
    id: string;
    createdAt: any;
    updatedAt: any;
  }

  interface IOrderRowSubscriptionWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IOrderRowSubscriptionWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IOrderRowSubscriptionWhereInput>;

    /**
     * The subscription event gets dispatched when it's listed in mutation_in
     */
    mutation_in: Array<MutationType>;

    /**
     * The subscription event gets only dispatched when one of the updated fields names is included in this list
     */
    updatedFields_contains?: string | null;

    /**
     * The subscription event gets only dispatched when all of the field names included in this list have been updated
     */
    updatedFields_contains_every: Array<string>;

    /**
     * The subscription event gets only dispatched when some of the field names included in this list have been updated
     */
    updatedFields_contains_some: Array<string>;
    node?: IOrderRowWhereInput | null;
  }

  interface IOrderRowSubscriptionPayload {
    __typename: 'OrderRowSubscriptionPayload';
    mutation: MutationType;
    node: IOrderRow | null;
    updatedFields: Array<string>;
    previousValues: IOrderRowPreviousValues | null;
  }

  interface IOrderRowPreviousValues {
    __typename: 'OrderRowPreviousValues';
    id: string;
    createdAt: any;
    updatedAt: any;
    quantity: number;
  }

  interface IDiscountCodeSubscriptionWhereInput {
    /**
     * Logical AND on all given filters.
     */
    AND: Array<IDiscountCodeSubscriptionWhereInput>;

    /**
     * Logical OR on all given filters.
     */
    OR: Array<IDiscountCodeSubscriptionWhereInput>;

    /**
     * The subscription event gets dispatched when it's listed in mutation_in
     */
    mutation_in: Array<MutationType>;

    /**
     * The subscription event gets only dispatched when one of the updated fields names is included in this list
     */
    updatedFields_contains?: string | null;

    /**
     * The subscription event gets only dispatched when all of the field names included in this list have been updated
     */
    updatedFields_contains_every: Array<string>;

    /**
     * The subscription event gets only dispatched when some of the field names included in this list have been updated
     */
    updatedFields_contains_some: Array<string>;
    node?: IDiscountCodeWhereInput | null;
  }

  interface IDiscountCodeSubscriptionPayload {
    __typename: 'DiscountCodeSubscriptionPayload';
    mutation: MutationType;
    node: IDiscountCode | null;
    updatedFields: Array<string>;
    previousValues: IDiscountCodePreviousValues | null;
  }

  interface IDiscountCodePreviousValues {
    __typename: 'DiscountCodePreviousValues';
    id: string;
    createdAt: any;
    updatedAt: any;
    code: string;
    name: string;
    description: string;
    type: DiscountCodeType;
    amount: number;
  }
}

// tslint:enable

@kbrandwijk
Copy link
Contributor Author

@KATT Because it solved only half of our goals, which was to both create type definitions, and also create a Binding class to use in your server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants