All notable changes to
the graphqelm
npm package
will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Fix #55. Encoding was incorrect for Elm reserved words because it was incorrectly normalizing input object keys when it should have used the raw keys.
- Fix code generation for constructors for circular input objects.
Previously,
build<InputObject>
returned records without wrapping them in their type constructors when needed. This worked for plain type aliases but not for the types for self-referential input object types. The code generation is now correct for both of these types.
- Generate
build<InputObject>
constructor functions (#49).
- Fixed
RangeError: Maximum call stack size exceeded
that was coming from infinite recursion CLI bug, issue #47.
- Add
--introspection-file
CLI option to usage message.
- Normalize all Elm reserved words by appending an
_
(previously onlytype
was normalized). Resolves #40 (thanks for pull request #41 @madsflensted!).
- Import all
Operation
values (it's rare but possible for schemas to refer to other operations) #45.
- Add maybe encoder to pipeline for nullable scalar encoders. Fixes #44.
- Fix infinite loop when checking for circular InputObject defs. This resolves issue #47 (the CLI was crashing for graph.cool endpoints).
- Generate type alias for required args to make it easier to annotate consumer code. Fixes #31.
- Add support for non-string scalars, fixes issue #37.
- Use
Decode.nullable
rather thanDecode.maybe
so that decode failures don't incorrectly get swallowed into aNothing
values but rather bubble up asErr
Results
.
- Generate type alias for optional args to make it easier to annotate consumer code.
- Include type alias for records in the union type for Input Objects with loops. This allows for nicer annotations in consumer code.
- Generate wrapped record union type for Input Objects with loop (recursive or circular references), and plain type alias for Input Objects with no loop.
- Fix issue with type generation for InputObject type aliases that contain a List type.
- Generate InputObjects as types (not type aliases) inside a single file to allow for recursive or circular input types.
- Add log statements to show progress while running CLI.
- Include deprecated fields by default. Add
--excludeDeprecated
CLI flag in place of--includeDeprecated
.
- Generate special module for Subscriptions.
- Renamed type variables from
selection
todecodesTo
for clarity. - Updated code generation to use type and module name
Field
rather thanFieldDecoder
for elm package version 7.0.0.
- Single-letter names no longer cause exceptions (like
x
ory
).
- Update name normalization strategy to make only the minimal change to make a name valid (that is, put leading underscores at the tail, and make sure the first letter is the correct case). Unless it is ALL_UPPERCASE_UNDERSCORE_SEPARATED_NAME, then make it ClassCase.
- Generate metadata json file with target elm package version and npm package version.
- Remove npm version number and target elm package version number from comments on generated modules to reduce diff noise in future updates.
- Fixed error on windows related to shelling out.
- Stopped generating unnecessary InputObject type definitions file.
- Add
--output
flag to command line to choose a directory other than./src
for generated output - Support intropsection json files with no top-level
data
json key.
- Generate Scalars module with type definitions/constructors for each custom scalar.
- Experimental
--introspection-file
flag to allow users to pass in a file with the result of the introspection query. This may change in the future.
- Generate InputObject modules for type-safe input objects.