You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server linked fields and inline fragments are two variants of the same struct. Ideally, Isograph doesn't know about the difference between these, and the only difference is in the "GraphQL layer", which includes query generation. In the long run, it would not include merged selection set generation!
A merged selection set has three variants: Scalar + Linked + InlineFragment. Instead, it should have two variants: Scalar + Linked, and each linked field should include information on whether it is a linked field or inline fragment.
The GraphQL-specific query and normalization AST generation part should understand how to specially handle inline fragments.
Also, in the long run, there should be two types of schema server fields: Scalar and Linked, as in Schema should have server_scalars: Vec<...> and server_pointers: Vec<...> (naming TBD). Splitting linked and scalar fields is not part of this task, unless necessary.
We do not need to do everything listed above as part of this task.
Tasks
Add a variant: FieldVariant field to SchemaServerField. This should encode whether it's a linked field or inline fragment. All existing fields should have FieldVariant::LinkedField
Create asConcreteType fields that have FieldVariant::InlineFragment
Modify create_merged_selection_set to look at the variant and create inline fragments or linked fields
More TBD
The text was updated successfully, but these errors were encountered:
Overall thoughts
Server linked fields and inline fragments are two variants of the same struct. Ideally, Isograph doesn't know about the difference between these, and the only difference is in the "GraphQL layer", which includes query generation. In the long run, it would not include merged selection set generation!
A merged selection set has three variants: Scalar + Linked + InlineFragment. Instead, it should have two variants: Scalar + Linked, and each linked field should include information on whether it is a linked field or inline fragment.
The GraphQL-specific query and normalization AST generation part should understand how to specially handle inline fragments.
Also, in the long run, there should be two types of schema server fields: Scalar and Linked, as in
Schema
should haveserver_scalars: Vec<...>
andserver_pointers: Vec<...>
(naming TBD). Splitting linked and scalar fields is not part of this task, unless necessary.We do not need to do everything listed above as part of this task.
Tasks
variant: FieldVariant
field toSchemaServerField
. This should encode whether it's a linked field or inline fragment. All existing fields should haveFieldVariant::LinkedField
asConcreteType
fields that haveFieldVariant::InlineFragment
More TBD
The text was updated successfully, but these errors were encountered: