diff --git a/src/layers/5_core/core.ts b/src/layers/5_core/core.ts index 04fa62c7b..dee8214e5 100644 --- a/src/layers/5_core/core.ts +++ b/src/layers/5_core/core.ts @@ -2,13 +2,8 @@ import type { DocumentNode, ExecutionResult, GraphQLSchema } from 'graphql' import { print } from 'graphql' import { Anyware } from '../../lib/anyware/__.js' import { type StandardScalarVariables } from '../../lib/graphql.js' -import { parseExecutionResult } from '../../lib/graphqlHTTP.js' -import { - CONTENT_TYPE_GQL, - CONTENT_TYPE_GQL_OVER_HTTP_REC, - CONTENT_TYPE_JSON, - mergeHeadersInit, -} from '../../lib/http.js' +import { CONTENT_TYPE_GQL_OVER_HTTP_REC, parseExecutionResult } from '../../lib/graphqlHTTP.js' +import { CONTENT_TYPE_JSON, mergeHeadersInit } from '../../lib/http.js' import { casesExhausted } from '../../lib/prelude.js' import { execute } from '../0_functions/execute.js' import type { Schema } from '../1_Schema/__.js' diff --git a/src/lib/graphqlHTTP.ts b/src/lib/graphqlHTTP.ts index 750499c4e..af052ed8e 100644 --- a/src/lib/graphqlHTTP.ts +++ b/src/lib/graphqlHTTP.ts @@ -1,6 +1,7 @@ import type { GraphQLFormattedError } from 'graphql' import { type ExecutionResult, GraphQLError } from 'graphql' import type { StandardScalarVariables } from './graphql.js' +import { CONTENT_TYPE_GQL, CONTENT_TYPE_JSON } from './http.js' import { isPlainObject } from './prelude.js' export type ExecutionInput = { @@ -51,3 +52,8 @@ export const parseExecutionResult = (result: unknown): ExecutionResult => { extensions, } } + +/** + * @see https://graphql.github.io/graphql-over-http/draft/#sec-Legacy-Watershed + */ +export const CONTENT_TYPE_GQL_OVER_HTTP_REC = `${CONTENT_TYPE_GQL}; charset=utf-8, ${CONTENT_TYPE_JSON}; charset=utf-8` diff --git a/src/lib/http.ts b/src/lib/http.ts index ed0422d0b..be3b22ff2 100644 --- a/src/lib/http.ts +++ b/src/lib/http.ts @@ -2,10 +2,7 @@ export const ACCEPT_HEADER = `Accept` export const CONTENT_TYPE_HEADER = `Content-Type` export const CONTENT_TYPE_JSON = `application/json` export const CONTENT_TYPE_GQL = `application/graphql-response+json` -/** - * @see https://graphql.github.io/graphql-over-http/draft/#sec-Legacy-Watershed - */ -export const CONTENT_TYPE_GQL_OVER_HTTP_REC = `${CONTENT_TYPE_GQL}; charset=utf-8, ${CONTENT_TYPE_JSON}; charset=utf-8` + export const statusCodes = { success: 200, }