Skip to content

Commit 81bddc3

Browse files
fix: update type imports for ApolloServerOptions and YogaServerOptions to improve type safety (#8)
1 parent 26760c5 commit 81bddc3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/utils/define.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Resolvers, ResolversTypes } from '#graphql/server'
2-
import type { ApolloServerOptions, BaseContext } from '@apollo/server'
2+
import type { ApolloServerOptions } from '@apollo/server'
33
import type { YogaServerOptions } from 'graphql-yoga'
4+
import type { H3Event } from 'h3'
45

56
import type { GraphQLFramework, StandardSchemaV1 } from 'nitro-graphql'
67

@@ -60,9 +61,9 @@ export function defineType(
6061
}
6162

6263
export type DefineServerConfig = GraphQLFramework extends 'graphql-yoga'
63-
? Partial<YogaServerOptions<any, any>>
64+
? Partial<YogaServerOptions<H3Event, H3Event>>
6465
: GraphQLFramework extends 'apollo-server'
65-
? Partial<ApolloServerOptions<BaseContext>>
66+
? Partial<ApolloServerOptions<H3Event>>
6667
: Record<string, any>
6768

6869
export function defineGraphQLConfig(

0 commit comments

Comments
 (0)