Initial Commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user