From 6811a81bd153ece6475484fd48e0d8aa6995d3ed Mon Sep 17 00:00:00 2001 From: Matt Gilson Date: Fri, 30 Jun 2023 13:13:56 -0400 Subject: [PATCH] Add a `RELEASE.md` file. --- RELEASE.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000000..8f4c435209 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,22 @@ +Release type: minor + +`strawberry codegen` can now operate on multiple input query files. +The previous behavior of naming the file `types.js` and `types.py` +for the builtin `typescript` and `python` plugins respectively is +preserved, but only if a single query file is passed. When more +than one query file is passed, the code generator will now use +the stem of the query file's name to construct the name of the +output files. e.g. `my_query.graphql` -> `my_query.js` or +`my_query.py`. Creators of custom plugins are responsible +for controlling the name of the output file themselves. To +accomodate this, if the `__init__` method of a `QueryCodegenPlugin` +has a parameter named `query` or `query_file`, the `pathlib.Path` +to the query file will be passed to the plugin's `__init__` +method. + +Finally, the `ConsolePlugin` has also recieved two new lifecycle +methods. Unlike other `QueryCodegenPlugin`, the same instance of +the `ConsolePlugin` is used for each query file processed. This +allows it to keep state around how many total files were processed. +The `ConsolePlugin` recieved two new lifecycle hooks: `before_any_start` +and `after_all_finished` that get called at the appropriate times.