Changes in 0.4#

0.4.2#

  • Fixed GraphQL introspection for the case when field has Record type

  • Fixed query validation for nested Record types

  • Fixed bug with options when Node contains fields with sub-graph source and regular fields

0.4.1#

  • Fixed GraphQL introspection to describe also scalar types

  • Implemented expressions compilation for more scalar Python types, pull request courtesy Alex Koval

  • Fixed field options normalization, now with proper default values

0.4.0#

  • Refactored data sources to be simpler to setup and more consistent

  • Graph validation now performed automatically

  • Added hiku.graph.apply() function to apply graph transformers

  • Added hiku.validate.query.validate() function to simplify query validation

  • Implemented complete options validation in the hiku.validate.query

  • Added hiku.types.Float type

  • Fixed GraphQL introspection to properly encode default values

  • Fixed if_some expression compilation in Python 3.6

  • Fixed GraphQL query variables handling when they are optional

  • Fixed GraphQL introspection to properly encode null values

  • Added ability to specify option’s description

  • Refactored type checking

  • Fixed linking from node to node without requirements

  • Changed options encoding format in hiku/protobuf/query.proto by using message types from google/protobuf/struct.proto instead of using custom types

  • Implemented result validation for the functions, used to load fields and links data

Backward-incompatible changes#

  • primary_key argument in hiku.sources.sqlalchemy.FieldsQuery now is keyword-only

  • Renamed hiku.types.Unknown into hiku.types.Any

  • hiku.sources.sqlalchemy.Field removed, use hiku.graph.Field instead:

    hiku.sources.sqlalchemy.Field('foo', fields_query)
    

    Changed to:

    hiku.graph.Field('foo', None, fields_query)
    
  • hiku.sources.sqlalchemy.LinkQuery now works with regular hiku.graph.Link class, so hiku.sources.sqlalchemy.Link was removed:

    character_to_actors_query = hiku.sources.sqlalchemy.LinkQuery(
        Sequence[TypeRef['Actor'],
        SA_ENGINE_KEY,
        from_column=actor_table.c.character_id,
        to_column=actor_table.c.id,
    )
    
    ... snip ...
    
    hiku.sources.sqlalchemy.Link('actors', character_to_actors_query,
                                 requires='id')
    

    Changed to:

    character_to_actors_query = hiku.sources.sqlalchemy.LinkQuery(
        SA_ENGINE_KEY,
        from_column=actor_table.c.character_id,
        to_column=actor_table.c.id,
    )
    
    ... snip ...
    
    hiku.graph.Link('actors', Sequence[TypeRef['Actor']],
                    character_to_actors_query, requires='id')
    
  • All the changes in hiku.sources.sqlalchemy are the same for hiku.sources.aiopg source

  • hiku.sources.graph.Expr removed, use hiku.graph.Field instead:

    Expr('foo', entity_sg, String, S.this.foo)
    

    Changed to:

    Field('foo', String, entity_sg.c(S.this.foo))
    

    Or even to:

    Field('foo', String, entity_sg)
    
  • Signature of the hiku.validate.graph.GraphValidator.__init__() method changed. Graph validation now is not meant to be done manually and it was refactored to support validation of the graph before it would be actually created, by validating items, passed to the hiku.graph.Graph constructor.

  • Replaced add_introspection() and add_introspection_async() functions with GraphQLIntrospection and AsyncGraphQLIntrospection respectively:

    graph = add_introspection_async(graph)
    

    Changed to:

    graph = hiku.graph.apply(graph, [AsyncGraphQLIntrospection()])
    
  • Due to changes in hiku/protobuf/query.proto, field and link options, encoded using old format, will be ignored in the newer versions. Backward compatibility can be implemented on demand. Please create an Issue on GitHub, if you are using query encoding using Protocol Buffers and you will need a smooth upgrade path.