Skip to content

Commit

Permalink
Replaced a few apollo-android -> apollo-kotlin (#5774)
Browse files Browse the repository at this point in the history
* apollo-android -> apollo-kotlin

* apollo-android -> apollo-kotlin
  • Loading branch information
martinbonnin committed Apr 2, 2024
1 parent 45c827c commit b2f9825
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 34 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ fun LaunchList(onLaunchClick: (launchId: String) -> Unit) {
```

As always, feedback is very welcome. Let us know what you think of the feature by
either [opening an issue on our GitHub repo](https://github.com/apollographql/apollo-android/issues)
either [opening an issue on our GitHub repo](https://github.com/apollographql/apollo-kotlin/issues)
, [joining the community](http://community.apollographql.com/new-topic?category=Help&tags=mobile,client)
or [stopping by our channel in the KotlinLang Slack](https://app.slack.com/client/T09229ZC6/C01A6KM1SBZ)(get your
invite [here](https://slack.kotl.in/)).
Expand Down Expand Up @@ -1392,7 +1392,7 @@ apolloClient.query(query).toFlow().collectIndexed { index, response ->
You can read more about it in [the documentation](https://www.apollographql.com/docs/kotlin/fetching/defer).

As always, feedback is very welcome. Let us know what you think of the feature by
either [opening an issue on our GitHub repo](https://github.com/apollographql/apollo-android/issues)
either [opening an issue on our GitHub repo](https://github.com/apollographql/apollo-kotlin/issues)
, [joining the community](http://community.apollographql.com/new-topic?category=Help&tags=mobile,client)
or [stopping by our channel in the KotlinLang Slack](https://app.slack.com/client/T09229ZC6/C01A6KM1SBZ)(get your
invite [here](https://slack.kotl.in/)).
Expand Down Expand Up @@ -2238,7 +2238,7 @@ In a nutshell, Apollo Kotlin 3 brings:
time, so you don't have to deal with them in your UI code

Feel free to ask questions by
either [opening an issue on our GitHub repo](https://github.com/apollographql/apollo-android/issues)
either [opening an issue on our GitHub repo](https://github.com/apollographql/apollo-kotlin/issues)
, [joining the community](http://community.apollographql.com/new-topic?category=Help&tags=mobile,client)
or [stopping by our channel in the KotlinLang Slack](https://app.slack.com/client/T09229ZC6/C01A6KM1SBZ)(get your
invite [here](https://slack.kotl.in/)).
Expand Down Expand Up @@ -2339,7 +2339,7 @@ apolloClient = ApolloClient.Builder()
_2021-12-07_

This version is the release candidate for Apollo Android 3 🚀. Please try it
and [report any issues](https://github.com/apollographql/apollo-android/issues/new/choose), we'll fix them urgently.
and [report any issues](https://github.com/apollographql/apollo-kotlin/issues/new/choose), we'll fix them urgently.

There is [documentation](https://www.apollographql.com/docs/android/) and
a [migration guide](https://www.apollographql.com/docs/android/migration/3.0/). More details are coming soon. In a
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Here are the steps to do a new release:
takes a few minutes). If you're on MacOS, you can
use [dependency-watch](https://github.com/JakeWharton/dependency-watch): `dependency-watch await 'com.apollographql.apollo3:apollo-runtime:$version' && osascript -e 'display notification "Release is ready 🚀"'`
* merge pending documentation/tutorial updates. Make sure the tutorial compiles and runs well.
* paste the changelog in a new release on [GitHub](https://github.com/apollographql/apollo-android/releases)
* paste the changelog in a new release on [GitHub](https://github.com/apollographql/apollo-kotlin/releases)
* if it's a significant release, tweet about it 🐦
* relax 🍹

Expand Down Expand Up @@ -273,12 +273,12 @@ where:

The project uses [GitHub Actions](https://docs.github.com/en/actions) to automate the build process.

We have [3 workflows](https://github.com/apollographql/apollo-android/tree/main/.github/workflows), triggered by the
We have [3 workflows](https://github.com/apollographql/apollo-kotlin/tree/main/.github/workflows), triggered by the
following events:

### On PRs

**Workflow:** [`pr.yml`](https://github.com/apollographql/apollo-android/blob/main/.github/workflows/pr.yml)
**Workflow:** [`pr.yml`](https://github.com/apollographql/apollo-kotlin/blob/main/.github/workflows/pr.yml)

**Jobs (run in parallel):**

Expand All @@ -294,7 +294,7 @@ following events:

### On pushes to `main` branch

**Workflow:** [`push.yml`](https://github.com/apollographql/apollo-android/blob/main/.github/workflows/push.yml)
**Workflow:** [`push.yml`](https://github.com/apollographql/apollo-kotlin/blob/main/.github/workflows/push.yml)

**Job:**

Expand All @@ -307,7 +307,7 @@ following events:

### On new tags

**Workflow:** [`tag.yml`](https://github.com/apollographql/apollo-android/blob/main/.github/workflows/tag.yml)
**Workflow:** [`tag.yml`](https://github.com/apollographql/apollo-kotlin/blob/main/.github/workflows/tag.yml)

**Job:**

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# Apollo Kotlin

[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)](https://raw.githubusercontent.com/apollographql/apollo-android/main/LICENSE)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)](https://raw.githubusercontent.com/apollographql/apollo-kotlin/main/LICENSE)
[![Join the community](https://img.shields.io/discourse/status?label=Join%20the%20community&server=https%3A%2F%2Fcommunity.apollographql.com)](http://community.apollographql.com/new-topic?category=Help&tags=mobile,client)
[![Slack](https://img.shields.io/static/v1?label=kotlinlang&message=apollo-android&color=15a2f5&logo=slack)](https://app.slack.com/client/T09229ZC6/C01A6KM1SBZ)
[![Slack](https://img.shields.io/static/v1?label=kotlinlang&message=apollo-kotlin&color=15a2f5&logo=slack)](https://app.slack.com/client/T09229ZC6/C01A6KM1SBZ)
[![Discord](https://img.shields.io/discord/1022972389463687228.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square)](https://discord.com/invite/graphos)
[![CI](https://img.shields.io/github/actions/workflow/status/apollographql/apollo-kotlin/push.yml?branch=main)](https://github.com/apollographql/apollo-kotlin/actions/workflows/push.yml?query=branch%3Amain)
[![Maven Central](https://img.shields.io/maven-central/v/com.apollographql.apollo3/apollo-api)](https://repo1.maven.org/maven2/com/apollographql/apollo3/)
Expand Down Expand Up @@ -181,7 +181,7 @@ Installation instructions and more information can be found [here](https://githu

The latest version is [![Maven Central](https://img.shields.io/maven-central/v/com.apollographql.apollo3/apollo-api)](https://repo1.maven.org/maven2/com/apollographql/apollo3/)

Check the [changelog](https://github.com/apollographql/apollo-android/releases) for the release history.
Check the [changelog](https://github.com/apollographql/apollo-kotlin/releases) for the release history.

Releases are hosted on [Maven Central](https://repo1.maven.org/maven2/com/apollographql/apollo3/). The plugin is additionally hosted on the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/com.apollographql.apollo3)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/advanced/nullability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Handling nullability and errors
description: Make your queries even more typesafe
---

> ⚠️ **Nullability annotations are not part of the specification and are subject to change.** If you have feedback on them, please let us know via [GitHub issues](https://github.com/apollographql/apollo-android/issues/new?assignees=&labels=Type%3A+Bug&template=bug_report.md&title=[Data%20Builders]), in the [Kotlin Slack community](https://slack.kotl.in/), or in the [GraphQL nullability working group](https://github.com/graphql/nullability-wg/).
> ⚠️ **Nullability annotations are not part of the specification and are subject to change.** If you have feedback on them, please let us know via [GitHub issues](https://github.com/apollographql/apollo-kotlin/issues/new?assignees=&labels=Type%3A+Bug&template=bug_report.md&title=[Data%20Builders]), in the [Kotlin Slack community](https://slack.kotl.in/), or in the [GraphQL nullability working group](https://github.com/graphql/nullability-wg/).
## Nullability in GraphQL

Expand Down
2 changes: 1 addition & 1 deletion docs/source/advanced/using-aliases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ query GetContacts {

## Using aliases to fix singularization rules

The [singularization code](https://github.com/apollographql/apollo-android/blob/d77b73f6f387ab474045f0db3c568d251ef55932/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/Inflector.kt) works most of the time but does not contain all the exceptions in the English dictionary.
The [singularization code](https://github.com/apollographql/apollo-kotlin/blob/d77b73f6f387ab474045f0db3c568d251ef55932/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/Inflector.kt) works most of the time but does not contain all the exceptions in the English dictionary.

If you encounter one, please let us know so we can put a valid example here (we usually fix those issues as we go but there certainly are a few left in the wild). Until we fix it in the singularization code, you can use an alias to control the name of the model in your code.
2 changes: 1 addition & 1 deletion docs/source/essentials/queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This page also assumes that you've already set up Apollo Kotlin for your Android

## Defining

In Apollo Kotlin, each query you execute is represented as an instance of a generated class that implements the [`Query` interface](https://github.com/apollographql/apollo-android/blob/9c998e47f698bdbe5db6b6d6965dbc34183d507e/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Query.kt#L6). To generate these classes, we first need to define the GraphQL operations we want to execute.
In Apollo Kotlin, each query you execute is represented as an instance of a generated class that implements the [`Query` interface](https://www.apollographql.com/docs/kotlin/kdoc/apollo-api/com.apollographql.apollo3.api/-query/index.html?query=interface%20Query%3CD%20:%20Query.Data%3E%20:%20Operation%3CD%3E). To generate these classes, we first need to define the GraphQL operations we want to execute.

Let's say we define a GraphQL query named `HeroQuery`, like so:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/fetching/defer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: 'Fetch slower schema fields asynchronously'
minVersion: 3.6.0
---

> ⚠️ **The `@defer` directive is currently [experimental](https://www.apollographql.com/docs/resources/release-stages/#experimental-features) in Apollo Kotlin and enabled for use by default.** If you have feedback on it, please let us know via [GitHub issues](https://github.com/apollographql/apollo-android/issues/new?assignees=&labels=Type%3A+Bug&template=bug_report.md&title=[Defer%20Support]) or in the [Kotlin Slack community](https://slack.kotl.in/).
> ⚠️ **The `@defer` directive is currently [experimental](https://www.apollographql.com/docs/resources/release-stages/#experimental-features) in Apollo Kotlin and enabled for use by default.** If you have feedback on it, please let us know via [GitHub issues](https://github.com/apollographql/apollo-kotlin/issues/new?assignees=&labels=Type%3A+Bug&template=bug_report.md&title=[Defer%20Support]) or in the [Kotlin Slack community](https://slack.kotl.in/).
Beginning with version `3.6.0`, Apollo Kotlin provides experimental support of [the `@defer` directive](https://github.com/graphql/graphql-wg/blob/main/rfcs/DeferStream.md), which enables your queries to receive data for specific fields asynchronously. This is helpful whenever some fields in a query take much longer to resolve than the others.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: A strongly-typed, caching GraphQL client for Java and Kotlin multip

> 📣 **Apollo Kotlin 3 is generally available.** If you're using Apollo Android 2.x, see the [migration guide](./migration/3.0/). You can also [view the 2.x docs](https://www.apollographql.com/docs/kotlin/v2).
[Apollo Kotlin](https://github.com/apollographql/apollo-android) (formerly Apollo Android) is a GraphQL client that generates Kotlin and Java models from GraphQL queries.
[Apollo Kotlin](https://github.com/apollographql/apollo-kotlin) (formerly Apollo Android) is a GraphQL client that generates Kotlin and Java models from GraphQL queries.

Apollo Kotlin executes queries and mutations against a GraphQL server and returns results as query-specific Kotlin types. This means you don't have to deal with parsing JSON, or passing around `Map`s and making clients cast values to the right type manually. You also don't have to write model types yourself, because these are generated from the GraphQL definitions your UI uses.

Expand Down Expand Up @@ -161,7 +161,7 @@ Installation instructions and more information can be found [here](testing/andro

The latest version is [![Maven Central](https://img.shields.io/maven-central/v/com.apollographql.apollo3/apollo-api)](https://repo1.maven.org/maven2/com/apollographql/apollo3/)

Check the [changelog](https://github.com/apollographql/apollo-android/releases) for the release history.
Check the [changelog](https://github.com/apollographql/apollo-kotlin/releases) for the release history.

Releases are hosted on [Maven Central](https://repo1.maven.org/maven2/com/apollographql/apollo3/). The plugin is additionally hosted on the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/com.apollographql.apollo3)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/testing/data-builders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Data builders (experimental)
---

> ⚠️ **Data builders are experimental and subject to change.** If you have feedback on them, please let us know via [GitHub issues](https://github.com/apollographql/apollo-android/issues/new?assignees=&labels=Type%3A+Bug&template=bug_report.md&title=[Data%20Builders]) or in the [Kotlin Slack community](https://slack.kotl.in/).
> ⚠️ **Data builders are experimental and subject to change.** If you have feedback on them, please let us know via [GitHub issues](https://github.com/apollographql/apollo-kotlin/issues/new?assignees=&labels=Type%3A+Bug&template=bug_report.md&title=[Data%20Builders]) or in the [Kotlin Slack community](https://slack.kotl.in/).
Apollo Kotlin generates models for your operations and parsers that create instances of these models from your network responses. Sometimes though, during tests or in other occasions, it is useful to instantiate models manually with known values. Doing so is not as straightforward as it may seem, especially when fragments are used. Creating `operationBased` models requires instantiating every fragment as well as choosing an appropriate `__typename` for each composite type. Data builders make this easier by providing builders that match the structure of the Json document.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import kotlin.test.assertEquals
class TransformTest {
private val query = """
query GetRepo {
repository(name: "apollo-android", owner: "apollographql") {
repository(name: "apollo-kotlin", owner: "apollographql") {
fieldThatHasBeenThereForever
newFieldInVersion3 @since(version: 3) @optional
newFieldInVersion5 @since(version: 5) @optional
Expand All @@ -35,7 +35,7 @@ class TransformTest {

val expected = """
query GetRepo {
repository(name: "apollo-android", owner: "apollographql") {
repository(name: "apollo-kotlin", owner: "apollographql") {
fieldThatHasBeenThereForever
newFieldInVersion3 @since(version: 3) @optional
}
Expand Down
2 changes: 0 additions & 2 deletions libraries/apollo-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ configure<org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension> {
}

tasks.withType(KotlinCompile::class.java) {
// Fixes the warning below:
// "Task ':apollo-android:apollo-compiler:kaptGenerateStubsKotlin' uses the output of task ':apollo-android:apollo-compiler:pluginVersion', without declaring an explicit dependency"
dependsOn(pluginVersionTaskProvider)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class StringEncodingTest {

@Test
fun `empty triple quotes are detected`() {
// See https://github.com/apollographql/apollo-android/issues/3172
// See https://github.com/apollographql/apollo-kotlin/issues/3172
val schema = """
type Query {
field(param: String = ${"\"\"\"\"\"\""}): String
Expand All @@ -38,7 +38,7 @@ class StringEncodingTest {

@Test
fun `string containing to double quotes is a valid default value`() {
// See https://github.com/apollographql/apollo-android/issues/3172
// See https://github.com/apollographql/apollo-kotlin/issues/3172
val schema = """
type Query {
field(param: String = ${"\"\"\"\"\"\""}): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fun connectToAndroidSourceSet(
// The kotlinSourceSet carries task dependencies, calling srcDir() above is enough
// to setup task dependencies
// addJavaSourceFoldersToModel is still required for AS to see the sources
// See https://github.com/apollographql/apollo-android/issues/3351
// See https://github.com/apollographql/apollo-kotlin/issues/3351
it.addJavaSourceFoldersToModel(outputDir.get().asFile)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ abstract class DefaultApolloExtension(
// Called when the plugin is applied
init {
require(GradleVersion.current() >= GradleVersion.version(MIN_GRADLE_VERSION)) {
"apollo-android requires Gradle version $MIN_GRADLE_VERSION or greater"
"apollo-kotlin requires Gradle version $MIN_GRADLE_VERSION or greater"
}

adhocComponentWithVariants = softwareComponentFactory.adhoc("apollo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GradleVersionTests {
TestUtils.executeGradleWithVersion(dir, "6.7","generateApolloSources")
Assert.fail("Compiling with an old version of Gradle should fail")
} catch (e: UnexpectedBuildFailure) {
Truth.assertThat(e.message).contains("apollo-android requires Gradle version $MIN_GRADLE_VERSION or greater")
Truth.assertThat(e.message).contains("apollo-kotlin requires Gradle version $MIN_GRADLE_VERSION or greater")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object TestUtils {
}
dest.deleteRecursively()

// See https://github.com/apollographql/apollo-android/issues/2184
// See https://github.com/apollographql/apollo-kotlin/issues/2184
dest.mkdirs()
File(dest, "gradle.properties").writeText("""
|org.gradle.jvmargs=-Xmx4g
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal class Normalizer(
val compiledFields = allFields.filter { it.responseName == entry.key }
if (compiledFields.isEmpty()) {
// If we come here, `obj` contains more data than the CompiledSelections can understand
// This happened previously (see https://github.com/apollographql/apollo-android/pull/3636)
// This happened previously (see https://github.com/apollographql/apollo-kotlin/pull/3636)
// This should not happen anymore but in case it does, we're logging some info here
throw RuntimeException("Cannot find a CompiledField for entry: {${entry.key}: ${entry.value}}, __typename = $typename, key = $key")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ internal class Normalizer(
val compiledFields = allFields.filter { it.responseName == entry.key }
if (compiledFields.isEmpty()) {
// If we come here, `obj` contains more data than the CompiledSelections can understand
// This happened previously (see https://github.com/apollographql/apollo-android/pull/3636)
// This happened previously (see https://github.com/apollographql/apollo-kotlin/pull/3636)
// It also happens if there's an always false @include directive (see https://github.com/apollographql/apollo-kotlin/issues/4772)
// For all cache purposes, this is not part of the response and we therefore do not include this in the response
return@mapNotNull null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class JsonScalarTest {
mockServer.close()
}

// see https://github.com/apollographql/apollo-android/issues/2854
// see https://github.com/apollographql/apollo-kotlin/issues/2854
@Test
fun jsonScalar() = runTest(before = { setUp() }, after = { tearDown() }) {
mockServer.enqueueString(testFixtureToUtf8("JsonScalar.json"))
Expand Down
2 changes: 1 addition & 1 deletion tests/outofbounds/src/main/graphql/operation.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ query GetAnimal($withTemperature: Boolean! = false) {
name
...animalFragment
# This field will not be in the Json triggering a bug where the expected name index was going out of bounds
# See https://github.com/apollographql/apollo-android/issues/3361
# See https://github.com/apollographql/apollo-kotlin/issues/3361
temperature @include(if: $withTemperature)
}
}
Expand Down

0 comments on commit b2f9825

Please sign in to comment.