28 lines
996 B
TypeScript
28 lines
996 B
TypeScript
import type { ConformanceContext } from "@suaveplan/api-graphql";
|
|
import { runGraphqlEngineConformance } from "@suaveplan/api-graphql";
|
|
import { createApolloGraphqlEngine } from "../engine/apollo-engine.js";
|
|
|
|
/**
|
|
* Re-export of `runGraphqlEngineConformance` pre-bound to the Apollo
|
|
* factory. Consumers call this to run the abstract engine contract
|
|
* against the Apollo adapter — identical surface to
|
|
* `api-graphql-yoga/testing`.
|
|
*/
|
|
export function runApolloConformance(label = "apollo"): void {
|
|
runGraphqlEngineConformance({
|
|
label,
|
|
factory: async (): Promise<ConformanceContext> => {
|
|
const engine = createApolloGraphqlEngine();
|
|
return {
|
|
engine,
|
|
makeRequestContext: () =>
|
|
({}) as unknown as ConformanceContext["makeRequestContext"] extends () => infer R
|
|
? R
|
|
: never,
|
|
};
|
|
},
|
|
});
|
|
}
|
|
|
|
export { runGraphqlEngineConformance };
|