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

Introduce com.apollographql.api.Fragment #2839

Merged
merged 9 commits into from
Jan 6, 2021
Merged

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented Jan 5, 2021

Fragment is like Operation but for fragments: It binds fragment definitions to their variables so we can read fragments from the store in a type-safe, variable-safe way

Since fragments do not have variable definitions, variables are inferred from field argument types and cannot have a default value.

With this PR, a fragment DroidFragment on Droid will generate:

  • DroidFragment: the interface
  • DroidFragmentImpl: Fragment.Data: the implementation
  • DroidFragmentFragment: Fragment: the typesafe wrapper

The FragmentFragment thing doesn't feel too nice. We can be fine tuned in a follow up PR

@martinbonnin martinbonnin force-pushed the convert-apollo-runtime-to-kotlin branch from fef4ce5 to afb6576 Compare January 5, 2021 18:19
Base automatically changed from convert-apollo-runtime-to-kotlin to dev-3.x January 5, 2021 22:38
Update codegen for fragment implementations
@martinbonnin martinbonnin merged commit 1eeceb0 into dev-3.x Jan 6, 2021
@martinbonnin martinbonnin deleted the add-fragment-wrapper branch January 6, 2021 19:44
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

Successfully merging this pull request may close these issues.

None yet

2 participants