From 79e40c043c356f7791f4b5125fc876f854946024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Poullain?= Date: Thu, 22 Aug 2024 19:11:08 +0200 Subject: [PATCH] [Blog] Add note on ES2023 --- docs/blog/version-5.0-release-notes.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/blog/version-5.0-release-notes.md b/docs/blog/version-5.0-release-notes.md index 701bc0b421..08ca0fdbab 100644 --- a/docs/blog/version-5.0-release-notes.md +++ b/docs/blog/version-5.0-release-notes.md @@ -16,9 +16,20 @@ Version 5.0 of [Foal](https://foalts.org/) is out! ## Supported versions of Node and TypeScript -- Support for Node 18 has been dropped and support for Node 22 has been added. +- Support for Node 18 has been dropped and support for Node 22 has been added. Foal code is now compiled to ES2023. - The supported version of TypeScript is version 5. Update your `package.json` file accordingly. +> If you're using the `GraphQLController` with the `resolvers` property, you need to add the `declare` keyword before the property name: +> ```typescript +> +> export class ApiController extends GraphQLController { +> schema = // ... +> +> @dependency +> declare resolvers: RootResolverService; +> } +> ``` + ## Better typing - The default type of `Context.state` is now `{}`. This way, you'll get a compilation error if you forget to specify a type for the state.