Skip to content

Commit

Permalink
Add RoleStatus enum and import it in result.d.ts and schema.graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Feb 20, 2024
1 parent 26051e5 commit 2e1dab0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dev-test/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ const config: CodegenConfig = {
config: {
contextType: '\\#test-null-value/context#TestContext',
fieldContextTypes: ['mutation.createUser#\\#test/root#FiedContextType'],
enumValues: {
RoleStatus: '\\#changeName/server/drizzle/schema#RoleStatus',
},
},
},
},
Expand Down
8 changes: 8 additions & 0 deletions dev-test/subpath-import/result.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { RoleStatus } from '#changeName/server/drizzle/schema';
import { GraphQLResolveInfo } from 'graphql';
import { TestContext } from '#test-null-value/context';
import { FiedContextType } from '#test/root';
Expand All @@ -8,6 +9,7 @@ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?:
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
export type EnumResolverSignature<T, AllowedValues = any> = { [key in keyof T]?: AllowedValues };
export type RequireFields<T, K extends keyof T> = Omit<T, K> & { [P in K]-?: NonNullable<T[P]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
Expand All @@ -18,6 +20,8 @@ export type Scalars = {
Float: { input: number; output: number };
};

export { RoleStatus };

export type User = {
__typename?: 'User';
createdAt: Scalars['String']['output'];
Expand Down Expand Up @@ -113,6 +117,7 @@ export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs
export type ResolversTypes = {
Boolean: ResolverTypeWrapper<Scalars['Boolean']['output']>;
ID: ResolverTypeWrapper<Scalars['ID']['output']>;
RoleStatus: RoleStatus;
String: ResolverTypeWrapper<Scalars['String']['output']>;
User: ResolverTypeWrapper<User>;
mutation: ResolverTypeWrapper<Mutation>;
Expand All @@ -127,6 +132,8 @@ export type ResolversParentTypes = {
mutation: Mutation;
};

export type RoleStatusResolvers = EnumResolverSignature<{ ADMIN?: any; USER?: any }, ResolversTypes['RoleStatus']>;

export type UserResolvers<
ContextType = TestContext,
ParentType extends ResolversParentTypes['User'] = ResolversParentTypes['User']
Expand Down Expand Up @@ -154,6 +161,7 @@ export type MutationResolvers<
};

export type Resolvers<ContextType = TestContext> = {
RoleStatus?: RoleStatusResolvers;
User?: UserResolvers<ContextType>;
mutation?: MutationResolvers<ContextType>;
};
5 changes: 5 additions & 0 deletions dev-test/subpath-import/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ type User {
updatedAt: String!
}

enum RoleStatus {
ADMIN
USER
}

type mutation {
createUser(name: String!, email: String!, password: String!): User!
}

0 comments on commit 2e1dab0

Please sign in to comment.