This release removes the previous approach of using fetch
and refetch
.Instead, the user would call execute()
on the operation handler.It is important to note that every time you call set_variables
on the operation handler,the network layers will ignore the previous execution.If a user wants to refetch the operation, and the variables haven't changed.They can call execute(true)
again. This will force the network layers to refetch the operation.#### Bug Fixes:- Bad HTTP responses will now call the on_error
callback and can be handled nythe operation handler just as if it was an operation error. Previously, failed HTTP responseswould cause the operation handler to be in a stale state, and it couldn't be used again.- errors were not piped down to qml proxy handler. Now they are.
Contributed by ניר via PR #477
This release adds a new getter on proxy typesfor custom scalars. This can be useful if you need to do some computationswith the custom scalar object rather than showing it to the user.
Contributed by ניר via PR #468
fix auto release 9
Contributed by ניר via PR #431
fix release CI
Contributed by ניר via PR #420
fix release CI
Contributed by ניר via PR #419
fix release CI
Contributed by ניר via PR #418
-
Support for Windows.
-
Breaking changes:
qtgql::bases::Environment
now accepts a network layer as a shared_ptr (previously was unique_ptr).
Contributed by ניר via PR #414
Fix a case that batch deletion won't update the UI.
Contributed by ניר via PR #390
Fix a bug that when a list of objects is reduced (on update) the ui won't get notified properly.
Contributed by ניר via PR #389
Fix a case that updates on Node implementors might try to compare to a field that is null ATM of updating it. See #381.
Contributed by ניר via PR #382
Fix a case that UUID input type wouldn't serialize. Also adds better test for basic scalar inputs.
Contributed by ניר via PR #378
Fix a case that interfaces couldn't store an object inside them due to object types being defined after them.
Contributed by ניר via PR #370
This release adds support for recursive input objects.
- From now on, input objects are heap allocated. This is due to this specific use case that input objects might reference themselves.
Contributed by ניר via PR #366
This release adds support for optional input objects / scalar.
-
arguments are not stored on with dynamically generated tuple because input objects might refer to themselves also the tuple approach is too hard to maintain.
-
This release changes the way root types are instantiated. Previously they were static heap allocated instance. Now we use a shared pointer solution that would be collected if there is no operation using this concrete root type.
-
Scalars are now shared pointers. this is because root type fields might be empty (if this operation is the first to use this root type) so we need to use either shared pointer or std::optional. Another reason to move to
sp
is because the scalars won't get copied all the time. Also, this might pave the way for correct garbage collection.
Contributed by ניר via PR #359
This release fixes a bug where optional lists wouldn't be evaluated correctly.
Contributed by ניר via PR #353
This release adds padronizes serialization for input arguments and input objects. This solves a case that list of arguments in input object couldn't serialize.
Contributed by ניר via PR #351
This release adds support for list of scalars argument.
Contributed by ניר via PR #349
This release adds support for list of scalars.
- Models now expose
data
role instead ofqtObject
role since it can also be anint
for example.
Contributed by ניר via PR #348
This release adds support for GraphQL over HTTP protocol with a protocol router.
Contributed by ניר via PR #337
...
Contributed by ניר via PR #336
...
Contributed by ניר via PR #335
...
Contributed by ניר via PR #333
test release 6
Contributed by ניר via PR #332
test release 2
Contributed by ניר via PR #329
test release 2
Contributed by ניר via PR #328
test release 2
Contributed by ניר via PR #327
test release 2
Contributed by ניר via PR #326
test release 1
Contributed by ניר via PR #325
- add
version
endpoint to the cli - support recursive search of config file.
- Create a QML module for each operation, you will be able to import it in qml
like this
GraphQL.<EnvName>.<OperationName>
This allows QtCreator to provide code completion, and you can type your properties based on the operation types. - add qml wrapper to operation something like
Use<operationName>
component. This would alias the signals in the real operation and store the shared pointer to it.
- Add
Typer[all]
to dependencies. - add static version to the root cmake and in
qtgqlcodegen
__init__.py
initial PR was #316
Contributed by ניר via PR #324
This release adds support for python 3.9 3.10
Contributed by ניר via PR #314
This release fixes a bug where object that implements node but is on a union or on an interface that doesn't implement node.
Contributed by ניר via PR #312
This release adds initial support for fragments.
- Fragments on object types.
- Fragments on interfaces.
- Nested fragments
- Fragments with variables usages.
Fragments are invisible user-wise. This means that they have no runtime type, we are just unwrapping them in the operation evaluation phase.
Contributed by ניר via PR #311
This release adds support for list of interfaces.
Contributed by ניר via PR #305
This release adds support for list if unions.
Contributed by ניר via PR #303
- Support "non-node" objects on lists.
- When updating a proxy object field, instead of deleting it and creating a new one, replace it with the new concrete and emit only the signals that are needed.
- Arguments not supported on scalar types.
Contributed by ניר via PR #302
Initial support for unions.
currently unions are represented as a ObjectType *
and user would need to cast it based on the __typeName()
property.
Contributed by ניר via PR #299
Support Node
interface on interfaces selections.
when a node is deserialized,
if it was found in the cache it would get updated
all over the schema.
Contributed by ניר via PR #297
Initial support for interfaces. Currently only interfaces there is no support for node interfaces.
Contributed by ניר via PR #294
This release adds support for input types as operation variables.
Contributed by ניר via PR #292
This release adds support for enums updates and enums as operation variables.
Contributed by ניר via PR #291
This release adds support for update&deserialize types that
does not implement Node
interface.
Contributed by ניר via PR #289
This release fixed an edge case where nested object would not update the nested object if the nested object itself has changed.
Contributed by ניר via PR #288
This release adds support for updates of list of nodes.
When operation X queries for list of nodes, the list would get deserialized and each proxy that contains that list would update it's model based on the new data. if the node itself has changed the changed fields would emit their own signals to indicate the UI for updates.
Contributed by ניר via PR #284
Migrate to "singleton" root types. The advantage for this architecture is that the ui won't be updated every-time a (next) message arrives, as well as for cross-operation updates.
To demonstrate the purpose of this specification image that operation X queried for
me{
name
profilePic
}
And after a while operation Y queried for:
me{
nickName
profilePic
}
Assuming that the profile picture has changed, operation X would be updated as well.
Contributed by ניר via PR #282
- Due to complexity issues deserializers and updaters are moved to operations scope. Each operation will generate its own deserializers chain.
- Refactor operation evaluation, uses similar technique that used by schema evaluations. Much more readable.
- Move root field out of the operation handler, instead create root types as well.
- Cache by arguments see #254
- refactor bot comment
- add no todos check
Contributed by ניר via PR #271
This release removes the previose loose()
approach mainly due to complexity reasons.
Starting from now we have a periodic garbage collector on all Node
derived classes.
Contributed by ניר via PR #253
This release adds support for optional nested objects updates and gc.
Contributed by ניר via PR #252
This release adds support for updates & garbage collection of nested object types.
Contributed by ניר via PR #250
This release refactored the project structure and added initial conan support.
Contributed by ניר via PR #248
This release adds support for using custom scalars (including ours) in operation variables and also adds the update&gc tests for custom scalars.
Contributed by ניר via PR #244
This release migrates operations to not use a constant operation ID as discussed in #230.
This release adds initial support for interfaces. Querying a interface is not yes feasible though concrete objects are now uses correct inheritance hierarchy.
From this release onwards only types that comply with Node
interface
would be treated as cache-able or update-able.
Contributed by ניר via PR #239
This release sets the first milestones for updates and garbage collection. The initial PR was for OperationVariables testcase though it was too advanced at this point of the project because it relied on advanced updated so I first started with scalars and decided to narrow the context of the PR.
The original PR branch is kept as a reference at #232
Contributed by ניר via PR #237
This release adds support for GraphQL enums.
Contributed by ניר via PR #229
Add support list of objects. When a list is deserialized the instances are mapped based on operation ID since lists are not part of the field stability spec.
Contributed by ניר via PR #225
Adding support for optional object inside an object.
Contributed by ניר via PR #224
This release adds support for nested object types. operation proxies does not refer to the concrete instance directly rather they are pointing to an instantiated proxy of the concrete.
Contributed by ניר via PR #222
This release moves qtgql subcomponents into namespaces.
Contributed by ניר via PR #221
This release adds support for optional (nullable) scalars.
and initial support for setting variables. i.e for this query:
query MainQuery($returnNone: Boolean! = false) {
user(retNone: $returnNone) {
name
age
agePoint
uuid
birth
}
}
You could set $returnNone
to true
like this.
auto mq = std::make_shared<mainquery::MainQuery>();
mq->setVariables({true});
mq->execute();
Contributed by ניר via PR #219
This release adds support for custom scalars.
Contributed by ניר via PR #211
This release is the initial migration step to C++.
a lot have changed and currently almost nothing is supported. You can keep yourself uptodate for when we reach a stable release.
Windows compilation is not working yet.
Contributed by ניר via PR #210
This release improves performance of GqlTypeHinter
by caching
evaluation of attributes.
Contributed by ניר via PR #185
This release adds support for interfaces as field types. The property type would be of an interface and all the types that implement that interface would extend it.
Note that querying an interface automatically adds __typename
in the fragment.
Contributed by ניר via PR #180
This release migrates to use typingref for type annotations introspection.
Contributed by ניר via PR #174
This release adds initial support for subscriptions.
Also fixing #157 because it was a two lines diff fix.
Contributed by ניר via PR #167
This release adds initial subscription support.
fix mypy plugin.
I couldn't fix mypy for itemsystem get_base_type()
ATM.
This release fixes a bug that completed
and operationOnFlight
wouldn't be updated
correctly.
Contributed by ניר via PR #164
This release adds support for operation errors hooks. i.e
from qtgqlcodegen.py.runtime.queryhandler import BaseOperationHandler
from qtgqlcodegen.tools import slot
from PySide6.QtCore import QObject
class Foo(QObject):
def __init__(self, parent=None):
super().__init__(parent)
operation: BaseOperationHandler
operation.error.connect(self.on_error)
@slot
def on_error(self, err: list[dict]) -> None:
print(err)
Contributed by ניר via PR #162
This release fixes an edge case where root types with no id fields would cause errors on updates.
Contributed by ניר via PR #160
This release adds initial support for mutations.
-
Mutation handler (on par with query handler).
-
commit slot. - on par with
refetch()
/fetch()
-
Support variables Every operation would generate Variables type, this type would be the property The commit slot would have the types arguments on it, and for every type is not a plain JS type we would generate a factory slot (accessible from QML), those types would be transformed to dictionaries and further on to JSON.
- scalars
- CustomScalars
- objectTypes
-
Should have a
property
foroperationOnFlight
(maybe queries as well) -
Test usage from QML Already covered by query tests, all operations use the same base class.
-
Update docs.Would update in a separate PR when updating major version. -
if there are variables for an operation than it shouldn't auto fetch itself (when used in QML) we should provide something like
property bool autofetch: false
- This release also made
BaseQueryHandler
not a singleton, because you could have different filters (on different handlers). Instead ofUseQuery{operationName: '...'}
- There would be
Consume<operationName>{}
QQuickItem that would internally use the generated handler. By using this Item you declare that as long as this component lives the data it retains wouldn't be gc'eed. - This release changed the data property on operation handlers to handlerData.
Contributed by ניר via PR #147
This release adds support for queries refetching.
Contributed by ניר via PR #143
This release adds initial support for garbage collection in order to avoid caching too many objects.
Contributed by ניר via PR #137
This release updates dependencies.
Contributed by ניר via PR #136
This release adds support for QGraphQListModel.clear()
.
Contributed by ניר via PR #133
This release adds minimal support for future annotations in slots or other parts of the lib that uses TypeHinter.
Contributed by ניר via PR #132
This release fixes a bug that inner model class would get overridden by ItemBase metaclass.
class StatusIndicator(ItemBaseType):
class Model(GenericModel):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Contributed by ניר via PR #128
This release adds support for list of unions.
This release also deprecates default object on QGraphQListModel
Contributed by ניר via PR #125
This release adds support for types without ID!
field.
fixes #115
Contributed by ניר via PR #116
This release adds support for updates. It does this by generating for each query handler an object that represents the selections for this query. Then if the data is being compared against local data as follows
- builtin scalars - compared against the current value.
- custom scalars - By default compared against the inner value of the custom scalar.
- object_type - will compare against each field (generated on
update()
),
- Note: if the object had the same ID! then the fields setter should not be called since the updates only occur at the child level, thus avoiding unnecessary updates. edge cased:
- new id reached: resolution -> create a new object and replace the pointer with the field setter.
- field was null before (ATM objecttypes are the only real fields that can be null): resolution -> use setter on this field
- unions - if
__typename
is different will cause a whole update, else similar to (3) - enums - compare against the enum value / name (which the same string).
- lists a.k.a models -- since lists just store a pointer (or a key in the store) to a node and the node itself
already compared when
.from_dict
called on the raw-node, we should just compare if the pointers points the right index so first crop the length of the list to the length of the arrived data, then for each index compare theID!
and replace correspondingly if ID matched callupdate()
on that node.
This release also introduce typename
property on each object type.
This is used by unions deserializers and can be useful for rendering specific component
based on the typename.
Contributed by ניר via PR #112
This release adds initial support for type-store. The type store is the source of truth for a given type. All CRUD operations will occur on store level.
Contributed by ניר via PR #106
This release adds initial implementation for type-store, each type would have a dedicated store, and it would be used to CRUD the instances.
This release adds UseQuery
instead of using just the singleton generated type.
import generated.<Environment name> 1.0 as G
G.UseQuery{
operationName: 'MainQuery'
Text{
text: G.MainQuery.completed? G.MainQuery.data: "loading..."
}
}
This release also impose a new style for declaring operations. User would need to provide a schema.graphql and operations.graphql under the same directory and import the operation names from qml. as per #100
Contributed by ניר via PR #104
This release adds support for custom network access
by implementing the NetworkLayerProto
protocol.
Contributed by ניר via PR #101
This release fixes issue #96.
i.e:
File: main.qml
import QtGql 1.0 as Gql
Item{
// `MainQuery` is generated from the query we write here.
// the name is based on the operationName (MainQuery)
Gql.MainQuery{id: query
graphql: `query MainQuery {...}`
}
Text{
text: query.data.somefield
}
}
This release fixes #84. By setting default value for object type to null.
This release fixes #84. By setting default value for object type to null.
This release drops generation of model for each type instead it uses Generic to annotate the model inner type. resolves #81 Also, it adds a default currentObject. resolves #80
This release generates in-place deserializers instead of calling pre-defined functions. See issue #17 for more details.
This release adds default values for every type in the __init__
method.
Resolves issue #39
migrate slot to use types from typingref This release fixes issue #3
Contributed by xiangxw via PR #59
This release adds currentObject
property for codegen BaseModel.
This is useful in QML where you have to access the current selected object outside
the delegate.
Fixes #65
This release fixes issue #61
This release fixes issue #58
This release adds basic support for graphql enums.
This release adds support for strawberry builtin scalars