@contember/engine-http 1.1.0-beta.1 → 1.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/system/SystemApiMiddlewareFactory.d.ts.map +1 -1
- package/dist/src/system/SystemApiMiddlewareFactory.js +4 -0
- package/dist/src/system/SystemApiMiddlewareFactory.js.map +1 -1
- package/dist/src/system/SystemGraphQLContextFactory.d.ts +2 -1
- package/dist/src/system/SystemGraphQLContextFactory.d.ts.map +1 -1
- package/dist/src/system/SystemGraphQLContextFactory.js +2 -2
- package/dist/src/system/SystemGraphQLContextFactory.js.map +1 -1
- package/dist/src/system/SystemGraphQLHandlerFactory.d.ts +1 -2
- package/dist/src/system/SystemGraphQLHandlerFactory.d.ts.map +1 -1
- package/dist/src/system/SystemGraphQLHandlerFactory.js +1 -1
- package/dist/src/system/SystemGraphQLHandlerFactory.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/system/SystemApiMiddlewareFactory.ts +4 -0
- package/src/system/SystemGraphQLContextFactory.ts +3 -2
- package/src/system/SystemGraphQLHandlerFactory.ts +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/engine-http",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"typings": "dist/src/index.d.ts",
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@apollographql/graphql-playground-html": "^1.6.24",
|
|
12
|
-
"@contember/database": "^1.1.0-beta.
|
|
13
|
-
"@contember/engine-content-api": "^1.1.0-beta.
|
|
14
|
-
"@contember/engine-plugins": "^1.1.0-beta.
|
|
15
|
-
"@contember/engine-system-api": "^1.1.0-beta.
|
|
16
|
-
"@contember/engine-tenant-api": "^1.1.0-beta.
|
|
17
|
-
"@contember/graphql-utils": "^1.1.0-beta.
|
|
18
|
-
"@contember/schema": "^1.1.0-beta.
|
|
19
|
-
"@contember/schema-utils": "^1.1.0-beta.
|
|
12
|
+
"@contember/database": "^1.1.0-beta.4",
|
|
13
|
+
"@contember/engine-content-api": "^1.1.0-beta.4",
|
|
14
|
+
"@contember/engine-plugins": "^1.1.0-beta.4",
|
|
15
|
+
"@contember/engine-system-api": "^1.1.0-beta.4",
|
|
16
|
+
"@contember/engine-tenant-api": "^1.1.0-beta.4",
|
|
17
|
+
"@contember/graphql-utils": "^1.1.0-beta.4",
|
|
18
|
+
"@contember/schema": "^1.1.0-beta.4",
|
|
19
|
+
"@contember/schema-utils": "^1.1.0-beta.4",
|
|
20
20
|
"@graphql-tools/merge": "^6.2.14",
|
|
21
21
|
"@graphql-tools/schema": "^8.3.5",
|
|
22
22
|
"@types/lru-cache": "^5.1.0",
|
|
@@ -60,6 +60,10 @@ export class SystemApiMiddlewareFactory {
|
|
|
60
60
|
koaContext,
|
|
61
61
|
projectContainer,
|
|
62
62
|
systemContainer: groupContainer.systemContainer,
|
|
63
|
+
onClearCache: () => {
|
|
64
|
+
projectContainer.contentSchemaResolver.clearCache()
|
|
65
|
+
groupContainer.projectSchemaResolver.clearCache()
|
|
66
|
+
},
|
|
63
67
|
})
|
|
64
68
|
const handler = groupContainer.systemGraphQLHandler
|
|
65
69
|
|
|
@@ -7,12 +7,13 @@ import { GraphQLKoaState } from '../graphql'
|
|
|
7
7
|
import { ProjectContainer } from '../ProjectContainer'
|
|
8
8
|
|
|
9
9
|
export class SystemGraphQLContextFactory {
|
|
10
|
-
public async create({ authResult, memberships, koaContext, projectContainer, systemContainer }: {
|
|
10
|
+
public async create({ authResult, memberships, koaContext, projectContainer, systemContainer, onClearCache }: {
|
|
11
11
|
authResult: AuthResult
|
|
12
12
|
memberships: readonly Membership[]
|
|
13
13
|
koaContext: KoaContext<GraphQLKoaState & AuthMiddlewareState>
|
|
14
14
|
projectContainer: ProjectContainer
|
|
15
15
|
systemContainer: SystemContainer
|
|
16
|
+
onClearCache: () => void
|
|
16
17
|
}): Promise<SystemGraphQLContext> {
|
|
17
18
|
const identity = new Identity(
|
|
18
19
|
authResult.identityId,
|
|
@@ -27,7 +28,7 @@ export class SystemGraphQLContextFactory {
|
|
|
27
28
|
)
|
|
28
29
|
return {
|
|
29
30
|
...systemContext,
|
|
30
|
-
|
|
31
|
+
onClearCache,
|
|
31
32
|
koaContext,
|
|
32
33
|
}
|
|
33
34
|
}
|
|
@@ -13,14 +13,13 @@ import { KoaContext } from '../koa'
|
|
|
13
13
|
import { DocumentNode } from 'graphql'
|
|
14
14
|
import { mergeTypeDefs } from '@graphql-tools/merge'
|
|
15
15
|
import { makeExecutableSchema } from '@graphql-tools/schema'
|
|
16
|
-
import { ContentSchemaResolver } from '../content'
|
|
17
16
|
|
|
18
17
|
type KoaState =
|
|
19
18
|
& GraphQLKoaState
|
|
20
19
|
|
|
21
20
|
export type SystemGraphQLContext = SystemResolverContext & {
|
|
22
21
|
koaContext: KoaContext<KoaState>
|
|
23
|
-
|
|
22
|
+
onClearCache: () => void
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
export type SystemGraphQLHandler = GraphQLQueryHandler<SystemGraphQLContext>
|
|
@@ -59,7 +58,7 @@ export class SystemGraphQLHandlerFactory {
|
|
|
59
58
|
if (this.debugMode) {
|
|
60
59
|
listeners.push({
|
|
61
60
|
onResponse: ({ context }) => {
|
|
62
|
-
context.
|
|
61
|
+
context.onClearCache()
|
|
63
62
|
},
|
|
64
63
|
})
|
|
65
64
|
listeners.push(createDbQueriesListener(context => context.db.client))
|