Releases: jhnnsrs/turms
v0.8.3
Major Documentation Reimplementation and Input Expansion
Funcs Plugin
Until now documentation in the funcs plugin was rather bad, in this version we updated the
style to more closely inspect documentation:
query DetailImage($id: ID!, $filters: ViewFilter) {
image(id: $id) {
id
store {
id
key
bucket
}
views(filters: $filters) {
... on RGBView {
id
}
}
}
}
will now create
def detail_image(
id: ID, filters: Optional[ViewFilter] = None, rath: Optional[MikroNextRath] = None
) -> DetailImageQueryImage:
"""DetailImage
Returns a single image by ID
Arguments:
id (ID): The unique identifier of an object
filters (Optional[ViewFilter], optional): A filter to selected the subset of views.
rath (mikro_next.rath.MikroNextRath, optional): The mikro rath client
Returns:
DetailImageQueryImage
"""
return execute(DetailImageQuery, {"id": id, "filters": filters}, rath=rath).image
Correctly using the query docstring and estimating variable description by inspecting their
respective use in the query tree.
Expand input types
The funcs plugin also now allows for an "input" type approach that automatically expands
the input types (by self defined names) to function arguments.
mutation CreateROI($input: RoiInput!) {
createRoi(input: $input) {
id
}
}
when setting
turms:
pugins:
- type: turms.plugins.funcs.FuncsPlugin
expand_input_types:
- input
def create_roi(
image: ID,
vectors: Iterable[FiveDVector],
kind: RoiKind,
rath: Optional[MikroNextRath] = None,
) -> CreateROIMutationCreateroi:
"""CreateROI
Create a new region of interest
Arguments:
image: The image this ROI belongs to
vectors: The vector coordinates defining the ROI
kind: The type/kind of ROI
rath (mikro_next.rath.MikroNextRath, optional): The mikro rath client
Returns:
CreateROIMutationCreateroi
"""
return execute(
CreateROIMutation,
{"input": {"image": image, "vectors": vectors, "kind": kind}},
rath=rath,
).create_roi
Thanks a lot for all the contributions and suggestion!
What's Changed
- Loosen version constraint on dependency 'rich'. by @emosenkis in #82
- adds ability to add list_fields to directives by @jhnnsrs in #85
New Contributors
- @emosenkis made their first contribution in #82
Full Changelog: v0.7.0...v0.8.1
v0.7.0
Following the pydantic v2 upgrade this now includes some upgrades to
Fragments, which allow automatic __typename based matching using
descriminators. While changes are kept to a minimal the generated code
now differs in some naming of Fragments.
What's Changed
Full Changelog: v0.6.0...v0.7.0
v0.6.0
Breaking: Pydantic V2 Transition
This is a long pull-request coming and finally updates turms to pydantic version v2 and beyond, with this update
turms itself will depend on pydantic v2 and will generate pydantic v2 compliant code (no more Config class but ConfigDict).
Additional thanks to @rnovacek the optional types have now default values, which also complies with pydantic v2.
You can still generate pydantic_v1 code by setting the:
pydantic_version: v1
However this is deprecated and will be replaced in future versions.
Thanks everyone for waiting for this release. Its been a busy year :D
What's Changed
- Set default values for optional field in input types by @rnovacek in #75
- Add Pydantic v2 support by @jhnnsrs in #77
New Contributors
Full Changelog: v0.5.0...v0.6.0
v0.5.0
Breaking Update for existing Configuration
This release updates the behaviours for both the enums and inputs plugin, so that they
skip unereferenced enums and inputs that do not appear in your documents (this holds only
true if you provided documents in your turms config). This was an experimental feature before
but now is only opt_out (by setting the skip_unreferenced = False in both inputs and enums plugin)
Also we have some new contributors :)
What's Changed
- Merge pull request #66 from patrick91/fix/nested-inputs-list by @jhnnsrs in #68
- Fix typo in github urls by @nocnokneo in #70
- Set Skip_unreferenced as default by @jhnnsrs in #71
New Contributors
- @nocnokneo made their first contribution in #70
Full Changelog: v0.4.3...v0.5.0
v0.4.3
What's Changed
- Add support for fragment spread in interface by @devxoul in #56
- fixing arguments inconsistency by @jhnnsrs in #64
- Introduce testing via snapshot by @patrick91 in #66
New Contributors
- @devxoul made their first contribution in #56
- @patrick91 made their first contribution in #66
Full Changelog: v0.4.2...v0.4.3
v0.4.2
v0.4.1
This is the turms cli update, which adds some long sought after cli
updates to turms including:
- Nice looking CLI build with Rich-Click
- Per Project Code Generation
- Project Initialization (Template support coming soon)
- Watch Mode (codegen on file change) is back :)
Also this version now supports "skip_unreferenced" options for the
builtin enum and inputs plugin, which allows skipping code for
unreferenced types in the documents (will check for dependencies
in the documents).
Ignore 0.4.0 because of entrypoint misconfiguration