UNPKG

11.4 kBMarkdownView Raw
1# Changelog [![npm](https://img.shields.io/npm/v/@dillonkearns/elm-graphql.svg)](https://npmjs.com/package/@dillonkearns/elm-graphql)
2
3All notable changes to
4[the `@dillonkearns/elm-graphql` npm package](https://www.npmjs.com/package/@dillonkearns/elm-graphql)
5will be documented in this file.
6
7The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
8and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
9
10## [Unreleased]
11
12## [3.5.0] - 2018-05-17
13
14### Changed
15
16Just some changes under the hood.
17
18- Update to latest npm dependencies. Note that the latest elm npm package
19 doesn't change the elm version, just the npm asset. It's still just elm 0.19.
20- Use parcel for bundling, and minify the `elm-graphql` npm binary. The behavior
21 should be exactly the same, and the extensive automated tests check out, plus
22 my manual testing of the binary.
23
24## [3.4.0] - 2018-04-17
25
26### Changed
27
28- Don't use field aliases for \_\_typename fields (see [PR #121](https://github.com/dillonkearns/elm-graphql/pull/121)).
29
30## [3.3.0] - 2018-03-31
31
32### Added
33
34- Generate `fromString` for Enums. This function is the inverse of the Enum `toString` helper.
35 So `NewHope |> Episode.toString |> Episode.fromString == Just NewHope`.
36
37## [3.2.0] - 2018-01-25
38
39### Fixed
40
41- The code now for the scalar codecs file
42 includes custom Encoders (not just Decoders). Before this, you would
43 get an error if you tried to use custom decoders but your Custom Scalar
44 was passed somewhere as an argument
45 (see [#109](https://github.com/dillonkearns/elm-graphql/issues/109)).
46
47### Changed
48
49- Renamed `--scalar-decoders` flag to `--scalar-codecs`.
50
51## [3.1.0] - 2018-01-07
52
53### Added
54
55- New `--scalar-decoders` flag allows you to define your scalar decoders
56 in a custom module. See [pull request #101](https://github.com/dillonkearns/elm-graphql/pull/101).
57
58## [3.0.1] - 2018-12-08
59
60### Changed
61
62- This change doesn't require
63 any modifications to user code. Simply re-run the latest CLI and upgrade to the
64 latest Elm package and you'll be good to go! See the 3.0.0 Elm package
65 changelog for implementation details about this change.
66
67## [3.0.0] - 2018-12-02
68
69## Changed
70
71- The code generate has changed to completely remove the `Field` module. See
72 the [Elm package version 2.0.0 release notes](https://github.com/dillonkearns/elm-graphql/blob/master/CHANGELOG-ELM-PACKAGE.md#100---2018-12-02)
73 for details and migration steps.
74
75## [2.0.3] - 2018-11-29
76
77### Changed
78
79- Now using `--optimize` flag so there is no more warning printed from Elm when
80 running the CLI.
81- Now using https://github.com/dillonkearns/elm-cli-options-parser so you will
82 get better feedback when you pass invalid arguments to the CLI.
83
84## [2.0.2] - 2018-11-28
85
86### Fixed
87
88- Only run `elm-format` on the generated code directory, not the entire
89 `--output` directory. In the last release, it didn't take `--base` into account
90 when running `elm-format`.
91
92## [2.0.1] - 2018-11-27
93
94### Changed
95
96- Add newlines for readability in the generated code between fields in type
97 alias definitions. See [#74](https://github.com/dillonkearns/elm-graphql/issues/74)
98 for details.
99
100## [2.0.0] - 2018-11-27
101
102### Changed
103
104- This introduces a backwards-incompatible change for any selections on Unions or Interfaces.
105 The change allows you to do exhaustive type-specific fragments. Now, if you
106 add a new type to a Union or Interface in your schema, the Elm compiler will
107 tell you to check for that type if you're doing an exhaustive selection.
108 See this diff to understand the changes and how to migrate to the new version:
109 [e530d94](https://github.com/dillonkearns/elm-graphql/pull/85/commits/e530d94cded94f43135aa7e68233ab4f8b7e5912).
110- With the new change, you can build exhaustive type-specific fragments that
111 get rid of the Maybe (because the compiler knows you're handling all possibilities).
112
113## [1.0.8] - 2018-11-27
114
115### Fixed
116
117- `elm-format` failed to run during the code generation in some configurations.
118 The new solution uses [an NPM peer dependency](https://nodejs.org/en/blog/npm/peer-dependencies/)
119 of `elm-format`. That means that it will make you install it if it's not already
120 in your dependencies in your `package.json`. With that as a local dependency, we
121 can safely call [`npx`](https://www.npmjs.com/package/npx) to run your local
122 elm-format version. Note that this requires `npm >= 5.2.0`.
123 See [#87](https://github.com/dillonkearns/elm-graphql/pull/87) and
124 [#91](https://github.com/dillonkearns/elm-graphql/issues/91) for more details.
125- The `elm-format` binary was previously run for each individual file asynchronously, which
126 could cause performance issues in some environments. Now, `elm-format` is run
127 as a single step on the entire generated directory after files are generated.
128 This is more performant and more reliable.
129
130## [1.0.7] - 2018-11-06
131
132### Changed
133
134- Add explicit `elm-version=0.19` argument when running `elm-format`
135 in order to fix [#79](https://github.com/dillonkearns/elm-graphql/issues/79).
136
137## [1.0.6] - 2018-10-31
138
139### Added
140
141- Generate a list of all possible enums for each enum module. Adds [#77](https://github.com/dillonkearns/elm-graphql/issues/77).
142
143## [1.0.5] - 2018-10-31
144
145### Fixed
146
147- There was a missing import for schemas which referenced the root query/mutation/subscription
148 objects. This came up with schemas generated by Graphile (though it may have effected
149 other schemas as well). This resolves [#78](https://github.com/dillonkearns/elm-graphql/issues/78).
150
151## [1.0.4] - 2018-08-28
152
153Nothing to see here! Release 1.0.4 was just testing out a new Travis npm deploy script.
154
155## [1.0.1] - 2018-08-28
156
157### Changed
158
159- Use extracted `scalarDecoder` constant from `dillonkearns/elm-graphql` package.
160 This change allows us to remove all `Debug.toString` calls
161 in generated code so that users can compile their code with the `--optimize` flag. This resolves
162 [#68](https://github.com/dillonkearns/elm-graphql/issues/68).
163
164## [1.0.0] - 2018-08-23
165
166### Changed
167
168- Generate code for `dillonkearns/elm-graphql`. This requires Elm version 0.19.
169- If you are upgrading to Elm 0.19 follow [the `dillonkearns/elm-graphql` 0.19 upgrade guide](https://github.com/dillonkearns/elm-graphql/blob/master/docs/elm-19-upgrade.md).
170 You can see more details of what's changed in [the Elm package changelog](https://github.com/dillonkearns/elm-graphql/blob/master/CHANGELOG-ELM-PACKAGE.md#100---2018-08-23).
171
172## BELOW THIS IS FOR the npm `graphqelm` package (elm package`dillonkearns/graphqelm`). Read more about [the rename to `dillonkearns/elm-graphql`](https://github.com/dillonkearns/elm-graphql/issues/23).
173
174## [3.1.12] - 2018-04-15
175
176### Fixed
177
178- Fix [#55](https://github.com/dillonkearns/elm-graphql/issues/55). Encoding was incorrect
179 for Elm reserved words because it was incorrectly normalizing input object keys when
180 it should have used the raw keys.
181
182## [3.1.11] - 2018-03-21
183
184### Fixed
185
186- Fix code generation for constructors for circular input objects.
187 Previously, `build<InputObject>` returned records without wrapping them in their type constructors
188 when needed. This worked for plain type aliases but not for the types for
189 self-referential input object types. The code generation is now correct for both of these types.
190
191## [3.1.10] - 2018-03-13
192
193### Added
194
195- Generate `build<InputObject>` constructor functions (#49).
196
197## [3.1.9] - 2018-03-08
198
199### Fixed
200
201- Fixed `RangeError: Maximum call stack size exceeded` that was coming from
202 infinite recursion CLI bug, issue #47.
203
204### Added
205
206- Add `--introspection-file` CLI option to usage message.
207
208## [3.1.8] - 2018-03-02
209
210### Fixed
211
212- Normalize all Elm reserved words by appending an `_` (previously only `type` was normalized). Resolves #40 (thanks for pull request #41 @madsflensted!).
213
214## [3.1.7] - 2018-03-01
215
216- Import all `Operation` values (it's rare but possible for schemas to refer to other operations) #45.
217
218## [3.1.6] - 2018-03-01
219
220- Add maybe encoder to pipeline for nullable scalar encoders. Fixes #44.
221
222## [3.1.5] - 2018-02-24
223
224### Fixed
225
226- Fix infinite loop when checking for circular InputObject defs. This resolves issue #47 (the CLI was crashing for graph.cool endpoints).
227
228## [3.1.4] - 2018-02-07
229
230### Added
231
232- Generate type alias for required args to make it easier to annotate
233 consumer code. Fixes #31.
234
235## [3.1.3] - 2018-02-07
236
237### Fixed
238
239- Add support for non-string scalars, fixes issue #37.
240
241## [3.1.2] - 2018-02-06
242
243### Changed
244
245- Use `Decode.nullable` rather than `Decode.maybe` so that decode failures don't
246 incorrectly get swallowed into a `Nothing` values but rather bubble up as
247 `Err` `Results`.
248
249### Added
250
251- Generate type alias for optional args to make it easier to annotate consumer code.
252
253## [3.1.1] - 2018-02-04
254
255### Added
256
257- Include type alias for records in the union type for Input Objects with loops.
258 This allows for nicer annotations in consumer code.
259
260## [3.1.0] - 2018-02-04
261
262### Changed
263
264- Generate wrapped record union type for Input Objects with loop (recursive or circular references),
265 and plain type alias for Input Objects with no loop.
266
267## [3.0.1] - 2018-02-01
268
269### Fixed
270
271- Fix issue with type generation for InputObject type aliases that contain a List type.
272
273## [3.0.0] - 2018-02-01
274
275### Fixed
276
277- Generate InputObjects as types (not type aliases) inside a single file to allow for recursive or circular input types.
278
279## [2.1.3] - 2018-01-28
280
281### Added
282
283- Add log statements to show progress while running CLI.
284
285### Changed
286
287- Include deprecated fields by default. Add `--excludeDeprecated` CLI flag in place
288 of `--includeDeprecated`.
289
290## [2.1.2] - 2018-01-20
291
292### Changed
293
294- Generate special module for Subscriptions.
295
296## [2.1.1] - 2018-01-17
297
298### Changed
299
300- Renamed type variables from `selection` to `decodesTo` for clarity.
301- Updated code generation to use type and module name `Field` rather than `FieldDecoder` for elm package version 7.0.0.
302
303## [2.1.0] - 2018-01-13
304
305### Fixed
306
307- Single-letter names no longer cause exceptions (like `x` or `y`).
308
309### Changed
310
311- Update name normalization strategy to make only the minimal change to make a name valid
312 (that is, put leading underscores at the tail, and make sure the first letter is the correct case).
313 Unless it is ALL_UPPERCASE_UNDERSCORE_SEPARATED_NAME, then make it ClassCase.
314
315## [2.0.3] - 2018-01-13
316
317### Added
318
319- Generate metadata json file with target elm package version and npm package version.
320
321### Removed
322
323- Remove npm version number and target elm package version number from comments
324 on generated modules to reduce diff noise in future updates.
325
326## [2.0.2] - 2018-01-11
327
328### Fixed
329
330- Fixed error on windows related to shelling out.
331
332### Removed
333
334- Stopped generating unnecessary InputObject type definitions file.
335
336## [2.0.1] - 2018-01-10
337
338### Added
339
340- Add `--output` flag to command line to choose a directory
341 other than `./src` for generated output
342- Support intropsection json files with no top-level `data` json key.
343
344## [2.0.0] - 2018-01-10
345
346### Added
347
348- Generate Scalars module with type definitions/constructors for each custom scalar.
349- Experimental `--introspection-file` flag to allow users to pass in a file with
350 the result of the introspection query. This may change in the future.
351
352## [1.0.1] - 2018-01-08
353
354### Added
355
356- Generate InputObject modules for type-safe input objects.