Changes in 0.8¶
0.8.0rcX¶
Introduce
Schema. This is a new high-level api with aim to provide single entrypoint for validation/execution and query/mutations. Previously we had to manage two serapate graphs - one for Query other for Mutation or use endpoint api butendpointapi is more like an integration-like api for http handlers. More on that in Schema docs.SchemareturnsExecutionResultdataclass withdata,errorsandresultfields.dataalready denormalized but access to Proxy object atresultfield is retained.Endpointnow is much simpler under the hood and it basically delegates execution to schema, only providing support for batching.Drop custom
validatefunction for federation since we now have better support for_entitiesand_servicefields and their corresponding types.Add new
Mquery builder that indicates that this is amutation. It must be used to build amutationquery that will be passed toSchema.executemethod which will then infer that this is a mutation query Node.Drop
hiku.federation.validate.validateDrop
hiku.federation.denormalizeDrop
hiku.federation.engineDrop
hiku.federation.endpoint- usehiku.endpointinsteadChange
QueryDepthValidatorhook toon_validateChange
GraphQLResponsetype used by endpoint - it now has bothdataanderrorsfieldsRename
on_dispatchhook toon_operationRemove
executemethod fromBaseGraphQLEndpointclassAdd
process_resultmethod toBaseGraphQLEndpointclass - it returnsGraphQLResponseobject with{"data": ...}or{"data": null, "errors": [...]is case ther are errors.Move
GraphQLErrortohiku.errormoduleDrop
GraphQLError.errorsfield. Earlier we used to store multiple errors in singleGraphQLErrorbut now its one message - oneGraphQLError.Add
GraphQLError.messagefieldDropped support for
Python 3.7, which ended support on 2023-06-27Fix: now it is possible to alias record field:
Graph([Root([Field("user", TypeRef["User"]))], data_types={"User": Record[{"id": Integer, "name": String}]})
query { user { id my_name: name } }
Backward-incompatible changes¶
Drop hiku.federation.endpoint.enormalize_entities
Drop hiku.federation.validate.validate
Drop hiku.federation.endpoint - use hiku.endpoint instead
Drop hiku.federation.denormalize
Drop hiku.federation.engine - use hiku.engine instead
Remove execute method from BaseGraphQLEndpoint class
Move GraphQLError to hiku.error module
Drop GraphQLError.errors field
Add GraphQLError.message field
Dropped support for Python 3.7, which ended support on 2023-06-27