Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[epic] Inline fragments #230

Open
3 tasks
rbalicki2 opened this issue Oct 29, 2024 · 0 comments
Open
3 tasks

[epic] Inline fragments #230

rbalicki2 opened this issue Oct 29, 2024 · 0 comments
Assignees

Comments

@rbalicki2
Copy link
Collaborator

rbalicki2 commented Oct 29, 2024

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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants