(context: Context)
| 13 | const DEFAULT_CACHE_MAX_AGE = 30758400; // 1 year |
| 14 | |
| 15 | const createCacheKey = (context: Context) => { |
| 16 | const plugins = getSchemaPlugins(context); |
| 17 | // TODO: in the near future, we have to assign a fixed name to every |
| 18 | // TODO: GraphQLSchema plugin, to be able to create a reliable cache key. |
| 19 | |
| 20 | // TODO: `getCurrentTenant` should be injected as a parameter. |
| 21 | // @ts-expect-error TODO: We should not be accessing `context` like this here. |
| 22 | const tenant = context.tenancy?.getCurrentTenant(); |
| 23 | |
| 24 | return [tenant ? `tenant:${tenant.id}` : null, plugins.length.toString()] |
| 25 | .filter(Boolean) |
| 26 | .join("#"); |
| 27 | }; |
| 28 | |
| 29 | const formatErrorPayload = (error: Error): string => { |
| 30 | if (error instanceof WebinyError) { |
no test coverage detected