Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3107074
refactor(wcp): move per-request license refresh into api-event-handle…
adrians5j Jul 8, 2026
ddd5fb9
feat(api-testing): shared test utilities package; migrate api-aco ont…
adrians5j Jul 8, 2026
e6e38cf
refactor(api-testing): adopt permissions holder; migrate api-headless…
adrians5j Jul 8, 2026
f5b789f
wip:4 (4t9pt)
adrians5j Jul 9, 2026
75bc857
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-4-…
adrians5j Jul 9, 2026
32f1c5b
wip:6 (wf197)
adrians5j Jul 9, 2026
a534f79
chore: sync yarn.lock
adrians5j Jul 9, 2026
9766e8e
wip:8 (pxqw0)
adrians5j Jul 9, 2026
83c71df
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-4-…
adrians5j Jul 9, 2026
ac27ee8
wip:10 (0aesp)
adrians5j Jul 9, 2026
31f77c6
wip:11 (19y8s)
adrians5j Jul 9, 2026
7ac98ca
wip:12 (0119m)
adrians5j Jul 9, 2026
3406dbd
Merge branch 'next' into adrian/self-hosted-6-2026-07-09
adrians5j Jul 9, 2026
f16e944
Merge branch 'next' into adrian/self-hosted-6-2026-07-09
adrians5j Jul 9, 2026
c5e911c
wip:13 (8o8jn)
adrians5j Jul 9, 2026
ffb8363
refactor: convert scheduler packages off legacy ContextPlugin to DI
adrians5j Jul 9, 2026
47c37b0
refactor: convert fm-server + hcms-es-tasks off ContextPlugin to DI
adrians5j Jul 10, 2026
19375bc
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-8-…
adrians5j Jul 10, 2026
e04aa47
refactor(handler-db): retire the context.db bag for DI abstractions
adrians5j Jul 10, 2026
0d02b86
refactor(handler-db): move test-only dbPlugins to /testing subpath
adrians5j Jul 10, 2026
41b7c39
refactor: convert cms-tasks + bulk-actions cluster off ContextPlugin …
adrians5j Jul 10, 2026
f43f032
refactor(fm-s3): convert file-manager-s3 off ContextPlugin to DI
adrians5j Jul 10, 2026
728ee66
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-11…
adrians5j Jul 10, 2026
1add149
chore: yarn format
adrians5j Jul 10, 2026
b2ee10a
Merge branch 'next' into adrian/self-hosted-11-2026-07-09
adrians5j Jul 11, 2026
0b74644
Merge branch 'next' into adrian/self-hosted-11-2026-07-09
adrians5j Jul 11, 2026
81dd07a
refactor: convert website-builder off ContextPlugin to DI
adrians5j Jul 11, 2026
164fc80
Merge branch 'next' into adrian/self-hosted-12-2026-07-09
adrians5j Jul 11, 2026
c8dd3f1
refactor(audit-logs): remove dead createAuditLogs ContextPlugins
adrians5j Jul 13, 2026
db94254
Merge branch 'next' into adrian/self-hosted-13-2026-07-09
adrians5j Jul 13, 2026
a6bb0ce
refactor(es-tasks): convert api-elasticsearch-tasks off ContextPlugin…
adrians5j Jul 13, 2026
2bd4b97
Merge branch 'next' into adrian/self-hosted-14-2026-07-09
adrians5j Jul 13, 2026
f1d5f2e
refactor(testing): remove dead createTenancyAndSecurity ContextPlugins
adrians5j Jul 13, 2026
a532f5a
refactor(testing): move test tenancy/security constants to @webiny/ap…
adrians5j Jul 13, 2026
56cad2f
Merge branch 'next' into adrian/self-hosted-15-2026-07-09
adrians5j Jul 13, 2026
4d5fdbc
refactor(testing): rename @webiny/api-testing to @webiny/api-core-tes…
adrians5j Jul 13, 2026
362c9b9
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-16…
adrians5j Jul 13, 2026
d2fbee6
refactor(testing): extract createCmsTestHandler into @webiny/api-head…
adrians5j Jul 13, 2026
3a6e567
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-17…
adrians5j Jul 13, 2026
a8bf587
wip:32 (350cc)
adrians5j Jul 14, 2026
95d4b51
fix(es-tasks): resolve leftover merge markers in tsconfigs
adrians5j Jul 14, 2026
4439a7c
refactor(testing): retire @webiny/testing; consolidate onto createCms…
adrians5j Jul 14, 2026
fc7b7e6
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-18…
adrians5j Jul 14, 2026
6501e65
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-18…
adrians5j Jul 14, 2026
0b30115
refactor(headless-cms): remove ContextPlugin from tests (#40)
adrians5j Jul 15, 2026
3ba3587
refactor(handler-graphql): remove ContextPlugin from tests (#40)
adrians5j Jul 15, 2026
5e3ce11
chore: sync-dependencies (drop stale @webiny/testing refs from refere…
adrians5j Jul 15, 2026
56e93a3
Merge remote-tracking branch 'origin/next' into adrian/self-hosted-20…
adrians5j Jul 15, 2026
2491aa6
Merge branch 'next' into adrian/self-hosted-20-2026-07-09
adrians5j Jul 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

9 changes: 4 additions & 5 deletions packages/handler-graphql/__tests__/graphql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import useGqlHandler from "./useGqlHandler";
import { booksSchemaPlugin, booksCrudPlugin } from "~tests/mocks/booksSchema";
import { CoreGraphQLSchemaFactory } from "~/graphql/abstractions";
import type { GraphQLSchemaBuilder } from "~/features/GraphQLSchemaBuilder/abstractions";
import { createContextPlugin } from "@webiny/handler";
import type { Context } from "./types";
import type { Container } from "@webiny/di";

describe("GraphQL Handler", () => {
test("should return errors if schema doesn't exist", async () => {
Expand Down Expand Up @@ -62,9 +61,9 @@ describe("GraphQL Handler", () => {
dependencies: []
});

const decoratorsPlugin = createContextPlugin<Context>(context => {
context.container.register(DecoratorsSchemaImpl);
});
const decoratorsPlugin = (container: Container) => {
container.register(DecoratorsSchemaImpl);
};

const { invoke } = useGqlHandler({
plugins: [booksCrudPlugin, booksSchemaPlugin, decoratorsPlugin]
Expand Down
24 changes: 15 additions & 9 deletions packages/handler-graphql/__tests__/mocks/booksSchema.legacy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createContextPlugin } from "@webiny/handler";
import type { Container } from "@webiny/di";
import { RequestContextInitializer } from "@webiny/event-handler-core";
import type { Book, Context } from "~tests/types";
import { createGraphQLSchemaPlugin } from "~/plugins";

Expand All @@ -11,14 +12,19 @@ export const books: Book[] = [
}
];

export const booksCrudPlugin = createContextPlugin<Context>(async context => {
context.getBooks = async () => {
console.log("getBooks");
console.table(books);
console.warn("Your store is quite empty!");
return books;
};
});
// Augments the request context with `getBooks` post-auth (the Query.books resolver reads it).
export const booksCrudPlugin = (container: Container) => {
container.registerInstance(RequestContextInitializer, {
async init(context: Record<string, any>) {
context.getBooks = async () => {
console.log("getBooks");
console.table(books);
console.warn("Your store is quite empty!");
return books;
};
}
});
};

export const booksSchema = createGraphQLSchemaPlugin<Context>({
typeDefs: /* GraphQL */ `
Expand Down
32 changes: 19 additions & 13 deletions packages/handler-graphql/__tests__/mocks/booksSchema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createContextPlugin } from "@webiny/handler";
import type { Book, Context } from "~tests/types";
import type { Container } from "@webiny/di";
import { RequestContextInitializer } from "@webiny/event-handler-core";
import type { Book } from "~tests/types";
import { CoreGraphQLSchemaFactory } from "~/graphql/abstractions.js";
import type { GraphQLSchemaBuilder } from "~/features/GraphQLSchemaBuilder/abstractions.js";

Expand Down Expand Up @@ -90,15 +91,20 @@ export const BooksSchemaImpl = CoreGraphQLSchemaFactory.createImplementation({
dependencies: []
});

export const booksCrudPlugin = createContextPlugin<Context>(async context => {
context.getBooks = async () => {
console.log("getBooks");
console.table(books);
console.warn("Your store is quite empty!");
return books;
};
});
// Augments the request context with `getBooks` post-auth (the Query.books resolver reads it).
export const booksCrudPlugin = (container: Container) => {
container.registerInstance(RequestContextInitializer, {
async init(context: Record<string, any>) {
context.getBooks = async () => {
console.log("getBooks");
console.table(books);
console.warn("Your store is quite empty!");
return books;
};
}
});
};

export const booksSchemaPlugin = createContextPlugin<Context>(context => {
context.container.register(BooksSchemaImpl);
});
export const booksSchemaPlugin = (container: Container) => {
container.register(BooksSchemaImpl);
};
12 changes: 11 additions & 1 deletion packages/handler-graphql/__tests__/useGqlHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ export default ({ plugins = [] }: Params = {}) => {
root: () => {},
request: async container => {
const flat = [plugins].flat(Infinity as 1).filter(Boolean);
registerLegacyPluginsViaGqlContextualSchema(container, flat);
// DI-native plugins are plain `container => {}` functions (they register features /
// request-context initializers directly). Call them here; everything else (legacy
// `graphql-schema` plugins) still goes through the bridge until #39 removes it.
const isFn = (p: any) => typeof p === "function" && !p.prototype;
for (const plugin of flat.filter(isFn)) {
(plugin as (container: any) => void)(container);
}
registerLegacyPluginsViaGqlContextualSchema(
container,
flat.filter(p => !isFn(p))
);

GraphQLEngineFeature.register(container);
}
Expand Down
Loading