Skip to content

Commit de6081b

Browse files
committed
feat(graphql-api): export Type-graphql types
1 parent f3e0536 commit de6081b

File tree

3 files changed

+246
-1
lines changed

3 files changed

+246
-1
lines changed

packages/graphql-api/codegen.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,14 @@ generates:
99
- add: /* tslint:disable */
1010
- typescript
1111
- typescript-resolvers
12-
- typescript-operations
12+
- typescript-operations
13+
./src/type-graphql.ts:
14+
config:
15+
noNamespaces: true
16+
# declarationType:
17+
# type: "abstract class"
18+
# decoratorName:
19+
# type: "InterfaceType"
20+
plugins:
21+
- add: /* tslint:disable */
22+
- typescript-type-graphql
+234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
/* tslint:disable */
2+
import * as TypeGraphQL from 'type-graphql';
3+
export type Maybe<T> = T | null;
4+
type FixDecorator<T> = T;
5+
/** All built-in and custom scalars, mapped to their actual values */
6+
export type Scalars = {
7+
ID: string;
8+
String: string;
9+
Boolean: boolean;
10+
Int: number;
11+
Float: number;
12+
};
13+
14+
export type AuthenticateParamsInput = {
15+
access_token?: Maybe<Scalars['String']>;
16+
access_token_secret?: Maybe<Scalars['String']>;
17+
provider?: Maybe<Scalars['String']>;
18+
password?: Maybe<Scalars['String']>;
19+
user?: Maybe<UserInput>;
20+
code?: Maybe<Scalars['String']>;
21+
};
22+
23+
export type CreateUserInput = {
24+
username?: Maybe<Scalars['String']>;
25+
email?: Maybe<Scalars['String']>;
26+
password?: Maybe<Scalars['String']>;
27+
};
28+
29+
@TypeGraphQL.ObjectType()
30+
export class EmailRecord {
31+
__typename?: 'EmailRecord';
32+
33+
@TypeGraphQL.Field(type => String, { nullable: true })
34+
address!: Maybe<Scalars['String']>;
35+
36+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
37+
verified!: Maybe<Scalars['Boolean']>;
38+
}
39+
40+
@TypeGraphQL.ObjectType()
41+
export class ImpersonateReturn {
42+
__typename?: 'ImpersonateReturn';
43+
44+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
45+
authorized!: Maybe<Scalars['Boolean']>;
46+
47+
@TypeGraphQL.Field(type => Tokens, { nullable: true })
48+
tokens!: Maybe<Tokens>;
49+
50+
@TypeGraphQL.Field(type => User, { nullable: true })
51+
user!: Maybe<User>;
52+
}
53+
54+
@TypeGraphQL.ObjectType()
55+
export class LoginResult {
56+
__typename?: 'LoginResult';
57+
58+
@TypeGraphQL.Field(type => String, { nullable: true })
59+
sessionId!: Maybe<Scalars['String']>;
60+
61+
@TypeGraphQL.Field(type => Tokens, { nullable: true })
62+
tokens!: Maybe<Tokens>;
63+
}
64+
65+
export class Mutation {
66+
__typename?: 'Mutation';
67+
68+
@TypeGraphQL.Field(type => TypeGraphQL.ID, { nullable: true })
69+
createUser!: Maybe<Scalars['ID']>;
70+
71+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
72+
verifyEmail!: Maybe<Scalars['Boolean']>;
73+
74+
@TypeGraphQL.Field(type => LoginResult, { nullable: true })
75+
resetPassword!: Maybe<LoginResult>;
76+
77+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
78+
sendVerificationEmail!: Maybe<Scalars['Boolean']>;
79+
80+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
81+
sendResetPasswordEmail!: Maybe<Scalars['Boolean']>;
82+
83+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
84+
changePassword!: Maybe<Scalars['Boolean']>;
85+
86+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
87+
twoFactorSet!: Maybe<Scalars['Boolean']>;
88+
89+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
90+
twoFactorUnset!: Maybe<Scalars['Boolean']>;
91+
92+
@TypeGraphQL.Field(type => ImpersonateReturn, { nullable: true })
93+
impersonate!: Maybe<ImpersonateReturn>;
94+
95+
@TypeGraphQL.Field(type => LoginResult, { nullable: true })
96+
refreshTokens!: Maybe<LoginResult>;
97+
98+
@TypeGraphQL.Field(type => Boolean, { nullable: true })
99+
logout!: Maybe<Scalars['Boolean']>;
100+
101+
@TypeGraphQL.Field(type => LoginResult, { nullable: true })
102+
authenticate!: Maybe<LoginResult>;
103+
}
104+
105+
export type MutationCreateUserArgs = {
106+
user: CreateUserInput;
107+
};
108+
109+
export type MutationVerifyEmailArgs = {
110+
token: Scalars['String'];
111+
};
112+
113+
export type MutationResetPasswordArgs = {
114+
token: Scalars['String'];
115+
newPassword: Scalars['String'];
116+
};
117+
118+
export type MutationSendVerificationEmailArgs = {
119+
email: Scalars['String'];
120+
};
121+
122+
export type MutationSendResetPasswordEmailArgs = {
123+
email: Scalars['String'];
124+
};
125+
126+
export type MutationChangePasswordArgs = {
127+
oldPassword: Scalars['String'];
128+
newPassword: Scalars['String'];
129+
};
130+
131+
export type MutationTwoFactorSetArgs = {
132+
secret: TwoFactorSecretKeyInput;
133+
code: Scalars['String'];
134+
};
135+
136+
export type MutationTwoFactorUnsetArgs = {
137+
code: Scalars['String'];
138+
};
139+
140+
export type MutationImpersonateArgs = {
141+
accessToken: Scalars['String'];
142+
username: Scalars['String'];
143+
};
144+
145+
export type MutationRefreshTokensArgs = {
146+
accessToken: Scalars['String'];
147+
refreshToken: Scalars['String'];
148+
};
149+
150+
export type MutationAuthenticateArgs = {
151+
serviceName: Scalars['String'];
152+
params: AuthenticateParamsInput;
153+
};
154+
155+
export class Query {
156+
__typename?: 'Query';
157+
158+
@TypeGraphQL.Field(type => TwoFactorSecretKey, { nullable: true })
159+
twoFactorSecret!: Maybe<TwoFactorSecretKey>;
160+
161+
@TypeGraphQL.Field(type => User, { nullable: true })
162+
getUser!: Maybe<User>;
163+
}
164+
165+
@TypeGraphQL.ObjectType()
166+
export class Tokens {
167+
__typename?: 'Tokens';
168+
169+
@TypeGraphQL.Field(type => String, { nullable: true })
170+
refreshToken!: Maybe<Scalars['String']>;
171+
172+
@TypeGraphQL.Field(type => String, { nullable: true })
173+
accessToken!: Maybe<Scalars['String']>;
174+
}
175+
176+
@TypeGraphQL.ObjectType()
177+
export class TwoFactorSecretKey {
178+
__typename?: 'TwoFactorSecretKey';
179+
180+
@TypeGraphQL.Field(type => String, { nullable: true })
181+
ascii!: Maybe<Scalars['String']>;
182+
183+
@TypeGraphQL.Field(type => String, { nullable: true })
184+
base32!: Maybe<Scalars['String']>;
185+
186+
@TypeGraphQL.Field(type => String, { nullable: true })
187+
hex!: Maybe<Scalars['String']>;
188+
189+
@TypeGraphQL.Field(type => String, { nullable: true })
190+
qr_code_ascii!: Maybe<Scalars['String']>;
191+
192+
@TypeGraphQL.Field(type => String, { nullable: true })
193+
qr_code_hex!: Maybe<Scalars['String']>;
194+
195+
@TypeGraphQL.Field(type => String, { nullable: true })
196+
qr_code_base32!: Maybe<Scalars['String']>;
197+
198+
@TypeGraphQL.Field(type => String, { nullable: true })
199+
google_auth_qr!: Maybe<Scalars['String']>;
200+
201+
@TypeGraphQL.Field(type => String, { nullable: true })
202+
otpauth_url!: Maybe<Scalars['String']>;
203+
}
204+
205+
export type TwoFactorSecretKeyInput = {
206+
ascii?: Maybe<Scalars['String']>;
207+
base32?: Maybe<Scalars['String']>;
208+
hex?: Maybe<Scalars['String']>;
209+
qr_code_ascii?: Maybe<Scalars['String']>;
210+
qr_code_hex?: Maybe<Scalars['String']>;
211+
qr_code_base32?: Maybe<Scalars['String']>;
212+
google_auth_qr?: Maybe<Scalars['String']>;
213+
otpauth_url?: Maybe<Scalars['String']>;
214+
};
215+
216+
@TypeGraphQL.ObjectType()
217+
export class User {
218+
__typename?: 'User';
219+
220+
@TypeGraphQL.Field(type => TypeGraphQL.ID)
221+
id!: Scalars['ID'];
222+
223+
@TypeGraphQL.Field(type => [EmailRecord], { nullable: true })
224+
emails!: Maybe<Array<EmailRecord>>;
225+
226+
@TypeGraphQL.Field(type => String, { nullable: true })
227+
username!: Maybe<Scalars['String']>;
228+
}
229+
230+
export type UserInput = {
231+
id?: Maybe<Scalars['ID']>;
232+
email?: Maybe<Scalars['String']>;
233+
username?: Maybe<Scalars['String']>;
234+
};

packages/graphql-api/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"outDir": "./lib",
66
"noUnusedParameters": false,
77
"noUnusedLocals": false,
8+
"experimentalDecorators": true,
89
"importHelpers": true
910
},
1011
"exclude": ["node_modules", "__tests__", "lib"]

0 commit comments

Comments
 (0)