From 2e1dab073f0b1f1a89109e677d806ad367d30e5c Mon Sep 17 00:00:00 2001 From: productdevbook Date: Tue, 20 Feb 2024 19:35:54 +0300 Subject: [PATCH] Add RoleStatus enum and import it in result.d.ts and schema.graphql --- dev-test/codegen.ts | 3 +++ dev-test/subpath-import/result.d.ts | 8 ++++++++ dev-test/subpath-import/schema.graphql | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/dev-test/codegen.ts b/dev-test/codegen.ts index fc77626b1df..7c0b9838288 100644 --- a/dev-test/codegen.ts +++ b/dev-test/codegen.ts @@ -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', + }, }, }, }, diff --git a/dev-test/subpath-import/result.d.ts b/dev-test/subpath-import/result.d.ts index 9d6efc25fc5..f066002aea9 100644 --- a/dev-test/subpath-import/result.d.ts +++ b/dev-test/subpath-import/result.d.ts @@ -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'; @@ -8,6 +9,7 @@ export type MakeOptional = Omit & { [SubKey in K]?: export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; export type MakeEmpty = { [_ in K]?: never }; export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +export type EnumResolverSignature = { [key in keyof T]?: AllowedValues }; export type RequireFields = Omit & { [P in K]-?: NonNullable }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { @@ -18,6 +20,8 @@ export type Scalars = { Float: { input: number; output: number }; }; +export { RoleStatus }; + export type User = { __typename?: 'User'; createdAt: Scalars['String']['output']; @@ -113,6 +117,7 @@ export type DirectiveResolverFn; ID: ResolverTypeWrapper; + RoleStatus: RoleStatus; String: ResolverTypeWrapper; User: ResolverTypeWrapper; mutation: ResolverTypeWrapper; @@ -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'] @@ -154,6 +161,7 @@ export type MutationResolvers< }; export type Resolvers = { + RoleStatus?: RoleStatusResolvers; User?: UserResolvers; mutation?: MutationResolvers; }; diff --git a/dev-test/subpath-import/schema.graphql b/dev-test/subpath-import/schema.graphql index a612517fd4c..3010f2f4bc4 100644 --- a/dev-test/subpath-import/schema.graphql +++ b/dev-test/subpath-import/schema.graphql @@ -7,6 +7,11 @@ type User { updatedAt: String! } +enum RoleStatus { + ADMIN + USER +} + type mutation { createUser(name: String!, email: String!, password: String!): User! }