refactor(graphql-server): enable isolated declarations (#1197)
parent
3a9920a258
commit
ab390305fb
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@hono/graphql-server': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add explicit `Response` return type
|
|
@ -216,7 +216,9 @@ export const getGraphQLParams = async (request: Request): Promise<GraphQLParams>
|
||||||
export const errorMessages = (
|
export const errorMessages = (
|
||||||
messages: string[],
|
messages: string[],
|
||||||
graphqlErrors?: readonly GraphQLError[] | readonly GraphQLFormattedError[]
|
graphqlErrors?: readonly GraphQLError[] | readonly GraphQLFormattedError[]
|
||||||
) => {
|
): {
|
||||||
|
errors: readonly GraphQLError[] | readonly GraphQLFormattedError[]
|
||||||
|
} => {
|
||||||
if (graphqlErrors) {
|
if (graphqlErrors) {
|
||||||
return {
|
return {
|
||||||
errors: graphqlErrors,
|
errors: graphqlErrors,
|
||||||
|
@ -232,7 +234,7 @@ export const errorMessages = (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const respondWithGraphiQL = (c: Context) => {
|
export const respondWithGraphiQL = (c: Context): Response => {
|
||||||
// https://github.com/graphql/graphiql/blob/03171d5614c61fb345763636d120da2b536d54a0/examples/graphiql-cdn/index.html
|
// https://github.com/graphql/graphiql/blob/03171d5614c61fb345763636d120da2b536d54a0/examples/graphiql-cdn/index.html
|
||||||
return c.html(`<!--
|
return c.html(`<!--
|
||||||
* Copyright (c) 2021 GraphQL Contributors
|
* Copyright (c) 2021 GraphQL Contributors
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
|
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
|
||||||
"emitDeclarationOnly": false
|
"emitDeclarationOnly": false,
|
||||||
|
"isolatedDeclarations": true
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts"],
|
"include": ["src/**/*.ts"],
|
||||||
"exclude": ["**/*.test.ts"],
|
"exclude": ["**/*.test.ts"],
|
||||||
|
|
Loading…
Reference in New Issue