Skip to content

Commit

Permalink
feat(graphql-api): export Type-graphql types
Browse files Browse the repository at this point in the history
  • Loading branch information
NickBolles committed Sep 4, 2019
1 parent 4670d47 commit 323788d
Show file tree
Hide file tree
Showing 3 changed files with 246 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/graphql-api/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@ generates:
- add: /* tslint:disable */
- typescript
- typescript-resolvers
- typescript-operations
- typescript-operations
./src/type-graphql.ts:
config:
noNamespaces: true
# declarationType:
# type: "abstract class"
# decoratorName:
# type: "InterfaceType"
plugins:
- add: /* tslint:disable */
- typescript-type-graphql
234 changes: 234 additions & 0 deletions packages/graphql-api/src/type-graphql.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
/* tslint:disable */
import * as TypeGraphQL from 'type-graphql';
export type Maybe<T> = T | null;
type FixDecorator<T> = T;
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
String: string;
Boolean: boolean;
Int: number;
Float: number;
};

export type AuthenticateParamsInput = {
access_token?: Maybe<Scalars['String']>;
access_token_secret?: Maybe<Scalars['String']>;
provider?: Maybe<Scalars['String']>;
password?: Maybe<Scalars['String']>;
user?: Maybe<UserInput>;
code?: Maybe<Scalars['String']>;
};

export type CreateUserInput = {
username?: Maybe<Scalars['String']>;
email?: Maybe<Scalars['String']>;
password?: Maybe<Scalars['String']>;
};

@TypeGraphQL.ObjectType()
export class EmailRecord {
__typename?: 'EmailRecord';

@TypeGraphQL.Field(type => String, { nullable: true })
address!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => Boolean, { nullable: true })
verified!: Maybe<Scalars['Boolean']>;
}

@TypeGraphQL.ObjectType()
export class ImpersonateReturn {
__typename?: 'ImpersonateReturn';

@TypeGraphQL.Field(type => Boolean, { nullable: true })
authorized!: Maybe<Scalars['Boolean']>;

@TypeGraphQL.Field(type => Tokens, { nullable: true })
tokens!: Maybe<Tokens>;

@TypeGraphQL.Field(type => User, { nullable: true })
user!: Maybe<User>;
}

@TypeGraphQL.ObjectType()
export class LoginResult {
__typename?: 'LoginResult';

@TypeGraphQL.Field(type => String, { nullable: true })
sessionId!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => Tokens, { nullable: true })
tokens!: Maybe<Tokens>;
}

export class Mutation {
__typename?: 'Mutation';

@TypeGraphQL.Field(type => TypeGraphQL.ID, { nullable: true })
createUser!: Maybe<Scalars['ID']>;

@TypeGraphQL.Field(type => Boolean, { nullable: true })
verifyEmail!: Maybe<Scalars['Boolean']>;

@TypeGraphQL.Field(type => LoginResult, { nullable: true })
resetPassword!: Maybe<LoginResult>;

@TypeGraphQL.Field(type => Boolean, { nullable: true })
sendVerificationEmail!: Maybe<Scalars['Boolean']>;

@TypeGraphQL.Field(type => Boolean, { nullable: true })
sendResetPasswordEmail!: Maybe<Scalars['Boolean']>;

@TypeGraphQL.Field(type => Boolean, { nullable: true })
changePassword!: Maybe<Scalars['Boolean']>;

@TypeGraphQL.Field(type => Boolean, { nullable: true })
twoFactorSet!: Maybe<Scalars['Boolean']>;

@TypeGraphQL.Field(type => Boolean, { nullable: true })
twoFactorUnset!: Maybe<Scalars['Boolean']>;

@TypeGraphQL.Field(type => ImpersonateReturn, { nullable: true })
impersonate!: Maybe<ImpersonateReturn>;

@TypeGraphQL.Field(type => LoginResult, { nullable: true })
refreshTokens!: Maybe<LoginResult>;

@TypeGraphQL.Field(type => Boolean, { nullable: true })
logout!: Maybe<Scalars['Boolean']>;

@TypeGraphQL.Field(type => LoginResult, { nullable: true })
authenticate!: Maybe<LoginResult>;
}

export type MutationCreateUserArgs = {
user: CreateUserInput;
};

export type MutationVerifyEmailArgs = {
token: Scalars['String'];
};

export type MutationResetPasswordArgs = {
token: Scalars['String'];
newPassword: Scalars['String'];
};

export type MutationSendVerificationEmailArgs = {
email: Scalars['String'];
};

export type MutationSendResetPasswordEmailArgs = {
email: Scalars['String'];
};

export type MutationChangePasswordArgs = {
oldPassword: Scalars['String'];
newPassword: Scalars['String'];
};

export type MutationTwoFactorSetArgs = {
secret: TwoFactorSecretKeyInput;
code: Scalars['String'];
};

export type MutationTwoFactorUnsetArgs = {
code: Scalars['String'];
};

export type MutationImpersonateArgs = {
accessToken: Scalars['String'];
username: Scalars['String'];
};

export type MutationRefreshTokensArgs = {
accessToken: Scalars['String'];
refreshToken: Scalars['String'];
};

export type MutationAuthenticateArgs = {
serviceName: Scalars['String'];
params: AuthenticateParamsInput;
};

export class Query {
__typename?: 'Query';

@TypeGraphQL.Field(type => TwoFactorSecretKey, { nullable: true })
twoFactorSecret!: Maybe<TwoFactorSecretKey>;

@TypeGraphQL.Field(type => User, { nullable: true })
getUser!: Maybe<User>;
}

@TypeGraphQL.ObjectType()
export class Tokens {
__typename?: 'Tokens';

@TypeGraphQL.Field(type => String, { nullable: true })
refreshToken!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => String, { nullable: true })
accessToken!: Maybe<Scalars['String']>;
}

@TypeGraphQL.ObjectType()
export class TwoFactorSecretKey {
__typename?: 'TwoFactorSecretKey';

@TypeGraphQL.Field(type => String, { nullable: true })
ascii!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => String, { nullable: true })
base32!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => String, { nullable: true })
hex!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => String, { nullable: true })
qr_code_ascii!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => String, { nullable: true })
qr_code_hex!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => String, { nullable: true })
qr_code_base32!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => String, { nullable: true })
google_auth_qr!: Maybe<Scalars['String']>;

@TypeGraphQL.Field(type => String, { nullable: true })
otpauth_url!: Maybe<Scalars['String']>;
}

export type TwoFactorSecretKeyInput = {
ascii?: Maybe<Scalars['String']>;
base32?: Maybe<Scalars['String']>;
hex?: Maybe<Scalars['String']>;
qr_code_ascii?: Maybe<Scalars['String']>;
qr_code_hex?: Maybe<Scalars['String']>;
qr_code_base32?: Maybe<Scalars['String']>;
google_auth_qr?: Maybe<Scalars['String']>;
otpauth_url?: Maybe<Scalars['String']>;
};

@TypeGraphQL.ObjectType()
export class User {
__typename?: 'User';

@TypeGraphQL.Field(type => TypeGraphQL.ID)
id!: Scalars['ID'];

@TypeGraphQL.Field(type => [EmailRecord], { nullable: true })
emails!: Maybe<Array<EmailRecord>>;

@TypeGraphQL.Field(type => String, { nullable: true })
username!: Maybe<Scalars['String']>;
}

export type UserInput = {
id?: Maybe<Scalars['ID']>;
email?: Maybe<Scalars['String']>;
username?: Maybe<Scalars['String']>;
};
1 change: 1 addition & 0 deletions packages/graphql-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"outDir": "./lib",
"noUnusedParameters": false,
"noUnusedLocals": false,
"experimentalDecorators": true,
"importHelpers": true
},
"exclude": ["node_modules", "__tests__", "lib"]
Expand Down

0 comments on commit 323788d

Please sign in to comment.