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 FakeResolver #4328

Merged
merged 7 commits into from
Aug 11, 2022
Merged

Introduce FakeResolver #4328

merged 7 commits into from
Aug 11, 2022

Conversation

martinbonnin
Copy link
Contributor

Introduce FakeResolver:

interface FakeResolver {
  fun resolveLeaf(context: FakeResolverContext): Any
  fun resolveListSize(context: FakeResolverContext): Int
  fun resolveMaybeNull(context: FakeResolverContext): Boolean
  fun resolveTypename(context: FakeResolverContext): String
}

It's now possible to create a fake model with just one line:

val data = GetFooQuery.Data()

See #4016

@netlify
Copy link

netlify bot commented Aug 10, 2022

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 908b98e
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/62f3d7477e0bf70009425ad6

@@ -113,4 +118,83 @@ class DataBuilderTest {
assertEquals(43, data.long2?.value)
assertEquals(44, data.long3)
}

@Test
fun fakeValues() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@martinbonnin martinbonnin merged commit d9485f1 into main Aug 11, 2022
@martinbonnin martinbonnin deleted the fake-values branch August 11, 2022 08:52
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.

2 participants