Skip to content

Releases: jhnnsrs/turms

v0.8.3

15 Nov 12:16
Compare
Choose a tag to compare

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

Full Changelog: v0.7.0...v0.8.1

v0.7.0

12 Nov 16:16
f8bc710
Compare
Choose a tag to compare

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

20 Sep 09:26
fec428d
Compare
Choose a tag to compare

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

23 Jan 09:52
b956225
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v0.4.3...v0.5.0

v0.4.3

18 Jul 13:27
1b27285
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.4.2...v0.4.3

v0.4.2

01 May 10:14
Compare
Choose a tag to compare

Implements correct sys exit codes
(with configuration value for multi projects)

Fixes #60

v0.4.1

18 Mar 14:53
f0fb423
Compare
Choose a tag to compare

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

v.0.3.1

24 Feb 17:05
5b78fa2
Compare
Choose a tag to compare

Adds Support for Union Types in both schema and document generation
Adds support for specifying model options for pydantic model option generation (only document generation)

v0.3.0

13 Jan 09:06
Compare
Choose a tag to compare

Added support for Strawberry GraphQL Schema Generation