Skip to content

Commit 30dad5c

Browse files
authored
Merge pull request #136 from joreilly/dependency_updates
dependecy updates
2 parents d21d212 + c481fdb commit 30dad5c

File tree

5 files changed

+316
-11
lines changed

5 files changed

+316
-11
lines changed

gradle/libs.versions.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
[versions]
22
kotlin = "2.0.0-Beta1"
3-
ksp = "2.0.0-Beta1-1.0.14"
3+
ksp = "2.0.0-Beta1-1.0.15"
44
coroutines = "1.7.3"
5-
androidGradlePlugin = "8.1.4"
5+
androidGradlePlugin = "8.2.0"
66
koin = "3.5.0"
77
koinCompose = "3.5.0"
8-
apollo = "4.0.0-alpha.2"
8+
apollo = "4.0.0-beta.2"
99
kmpNativeCoroutines = "1.0.0-ALPHA-18"
1010

11-
androidxActivity = "1.8.0"
11+
androidxActivity = "1.8.1"
1212
androidxComposeCompiler = "1.5.5-dev-k2.0.0-Beta1-06b8ae672a4"
1313
androidxComposeBom = "2023.10.01"
1414
androidxNavigationCompose = "2.7.5"
1515
accompanist = "0.30.1"
16-
horologist = "0.5.9"
16+
horologist = "0.5.13"
1717
wearCompose = "1.2.1"
1818

1919
junit = "4.13.2"

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

shared/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ apollo {
6262
codegenModels.set("operationBased")
6363
generateSchema.set(true)
6464
generateDataBuilders.set(true)
65+
introspection {
66+
endpointUrl.set("https://swapi-graphql.netlify.app/.netlify/functions/index")
67+
schemaFile.set(file("src/commonMain/graphql/schema.graphqls"))
68+
}
6569
}
6670
}
6771

shared/src/commonMain/graphql/schema.graphqls

Lines changed: 299 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ type Planet implements Node {
346346
terrains: [String]
347347

348348
"""
349-
The percentage of the planet surface that is naturally occuring water or bodies
349+
The percentage of the planet surface that is naturally occurring water or bodies
350350
of water.
351351
"""
352352
surfaceWater: Float
@@ -1591,6 +1591,304 @@ type VehiclesEdge {
15911591
cursor: String!
15921592
}
15931593

1594+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1595+
# noinspection GraphQLTypeRedefinition
1596+
"""
1597+
A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.
1598+
"""
1599+
type __Schema {
1600+
"""
1601+
A list of all types supported by this server.
1602+
"""
1603+
types: [__Type!]!
1604+
1605+
"""
1606+
The type that query operations will be rooted at.
1607+
"""
1608+
queryType: __Type!
1609+
1610+
"""
1611+
If this server supports mutation, the type that mutation operations will be rooted at.
1612+
"""
1613+
mutationType: __Type
1614+
1615+
"""
1616+
If this server support subscription, the type that subscription operations will be rooted at.
1617+
"""
1618+
subscriptionType: __Type
1619+
1620+
"""
1621+
A list of all directives supported by this server.
1622+
"""
1623+
directives: [__Directive!]!
1624+
}
1625+
1626+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1627+
# noinspection GraphQLTypeRedefinition
1628+
"""
1629+
The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.
1630+
1631+
Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.
1632+
"""
1633+
type __Type {
1634+
kind: __TypeKind!
1635+
1636+
name: String
1637+
1638+
description: String
1639+
1640+
fields(includeDeprecated: Boolean = false): [__Field!]
1641+
1642+
interfaces: [__Type!]
1643+
1644+
possibleTypes: [__Type!]
1645+
1646+
enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
1647+
1648+
inputFields: [__InputValue!]
1649+
1650+
ofType: __Type
1651+
}
1652+
1653+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1654+
# noinspection GraphQLTypeRedefinition
1655+
"""
1656+
An enum describing what kind of type a given `__Type` is.
1657+
"""
1658+
enum __TypeKind {
1659+
"""
1660+
Indicates this type is a scalar.
1661+
"""
1662+
SCALAR
1663+
1664+
"""
1665+
Indicates this type is an object. `fields` and `interfaces` are valid fields.
1666+
"""
1667+
OBJECT
1668+
1669+
"""
1670+
Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.
1671+
"""
1672+
INTERFACE
1673+
1674+
"""
1675+
Indicates this type is a union. `possibleTypes` is a valid field.
1676+
"""
1677+
UNION
1678+
1679+
"""
1680+
Indicates this type is an enum. `enumValues` is a valid field.
1681+
"""
1682+
ENUM
1683+
1684+
"""
1685+
Indicates this type is an input object. `inputFields` is a valid field.
1686+
"""
1687+
INPUT_OBJECT
1688+
1689+
"""
1690+
Indicates this type is a list. `ofType` is a valid field.
1691+
"""
1692+
LIST
1693+
1694+
"""
1695+
Indicates this type is a non-null. `ofType` is a valid field.
1696+
"""
1697+
NON_NULL
1698+
}
1699+
1700+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1701+
# noinspection GraphQLTypeRedefinition
1702+
"""
1703+
Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.
1704+
"""
1705+
type __Field {
1706+
name: String!
1707+
1708+
description: String
1709+
1710+
args: [__InputValue!]!
1711+
1712+
type: __Type!
1713+
1714+
isDeprecated: Boolean!
1715+
1716+
deprecationReason: String
1717+
}
1718+
1719+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1720+
# noinspection GraphQLTypeRedefinition
1721+
"""
1722+
Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.
1723+
"""
1724+
type __InputValue {
1725+
name: String!
1726+
1727+
description: String
1728+
1729+
type: __Type!
1730+
1731+
"""
1732+
A GraphQL-formatted string representing the default value for this input value.
1733+
"""
1734+
defaultValue: String
1735+
}
1736+
1737+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1738+
# noinspection GraphQLTypeRedefinition
1739+
"""
1740+
One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.
1741+
"""
1742+
type __EnumValue {
1743+
name: String!
1744+
1745+
description: String
1746+
1747+
isDeprecated: Boolean!
1748+
1749+
deprecationReason: String
1750+
}
1751+
1752+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1753+
# noinspection GraphQLTypeRedefinition
1754+
"""
1755+
A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
1756+
1757+
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.
1758+
"""
1759+
type __Directive {
1760+
name: String!
1761+
1762+
description: String
1763+
1764+
locations: [__DirectiveLocation!]!
1765+
1766+
args: [__InputValue!]!
1767+
}
1768+
1769+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1770+
# noinspection GraphQLTypeRedefinition
1771+
"""
1772+
A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.
1773+
"""
1774+
enum __DirectiveLocation {
1775+
"""
1776+
Location adjacent to a query operation.
1777+
"""
1778+
QUERY
1779+
1780+
"""
1781+
Location adjacent to a mutation operation.
1782+
"""
1783+
MUTATION
1784+
1785+
"""
1786+
Location adjacent to a subscription operation.
1787+
"""
1788+
SUBSCRIPTION
1789+
1790+
"""
1791+
Location adjacent to a field.
1792+
"""
1793+
FIELD
1794+
1795+
"""
1796+
Location adjacent to a fragment definition.
1797+
"""
1798+
FRAGMENT_DEFINITION
1799+
1800+
"""
1801+
Location adjacent to a fragment spread.
1802+
"""
1803+
FRAGMENT_SPREAD
1804+
1805+
"""
1806+
Location adjacent to an inline fragment.
1807+
"""
1808+
INLINE_FRAGMENT
1809+
1810+
"""
1811+
Location adjacent to a variable definition.
1812+
"""
1813+
VARIABLE_DEFINITION
1814+
1815+
"""
1816+
Location adjacent to a schema definition.
1817+
"""
1818+
SCHEMA
1819+
1820+
"""
1821+
Location adjacent to a scalar definition.
1822+
"""
1823+
SCALAR
1824+
1825+
"""
1826+
Location adjacent to an object type definition.
1827+
"""
1828+
OBJECT
1829+
1830+
"""
1831+
Location adjacent to a field definition.
1832+
"""
1833+
FIELD_DEFINITION
1834+
1835+
"""
1836+
Location adjacent to an argument definition.
1837+
"""
1838+
ARGUMENT_DEFINITION
1839+
1840+
"""
1841+
Location adjacent to an interface definition.
1842+
"""
1843+
INTERFACE
1844+
1845+
"""
1846+
Location adjacent to a union definition.
1847+
"""
1848+
UNION
1849+
1850+
"""
1851+
Location adjacent to an enum definition.
1852+
"""
1853+
ENUM
1854+
1855+
"""
1856+
Location adjacent to an enum value definition.
1857+
"""
1858+
ENUM_VALUE
1859+
1860+
"""
1861+
Location adjacent to an input object type definition.
1862+
"""
1863+
INPUT_OBJECT
1864+
1865+
"""
1866+
Location adjacent to an input object field definition.
1867+
"""
1868+
INPUT_FIELD_DEFINITION
1869+
}
1870+
1871+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1872+
# noinspection GraphQLTypeRedefinition
1873+
"""
1874+
Directs the executor to include this field or fragment only when the `if` argument is true.
1875+
"""
1876+
directive @include ("Included when true." if: Boolean!) on FIELD|FRAGMENT_SPREAD|INLINE_FRAGMENT
1877+
1878+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1879+
# noinspection GraphQLTypeRedefinition
1880+
"""
1881+
Directs the executor to skip this field or fragment when the `if` argument is true.
1882+
"""
1883+
directive @skip ("Skipped when true." if: Boolean!) on FIELD|FRAGMENT_SPREAD|INLINE_FRAGMENT
1884+
1885+
# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
1886+
# noinspection GraphQLTypeRedefinition
1887+
"""
1888+
Marks an element of a GraphQL schema as no longer supported.
1889+
"""
1890+
directive @deprecated ("Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https:\/\/commonmark.org\/)." reason: String = "No longer supported") on FIELD_DEFINITION|ENUM_VALUE
1891+
15941892
schema {
15951893
query: Root
15961894
}

shared/src/commonMain/kotlin/dev/johnoreilly/starwars/shared/StarWarsRepository.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import dev.johnoreilly.starwars.GetAllFilmsQuery
99
import dev.johnoreilly.starwars.GetAllPeopleQuery
1010
import kotlinx.coroutines.CoroutineScope
1111
import kotlinx.coroutines.MainScope
12+
import kotlinx.coroutines.flow.filter
1213
import kotlinx.coroutines.flow.map
1314
import okio.IOException
1415
import org.koin.core.component.KoinComponent
@@ -21,13 +22,15 @@ class StarWarsRepository: KoinComponent {
2122
private val apolloClient: ApolloClient by inject()
2223

2324
@NativeCoroutines
24-
val people = apolloClient.query(GetAllPeopleQuery()).watch().map {
25-
it.dataAssertNoErrors.allPeople.people.mapNotNull { it?.personFragment }
25+
val people = apolloClient.query(GetAllPeopleQuery()).watch()
26+
.filter { it.exception == null }
27+
.map { it.dataOrThrow().allPeople.people.mapNotNull { it?.personFragment }
2628
}
2729

2830
@NativeCoroutines
29-
val films = apolloClient.query(GetAllFilmsQuery()).watch().map {
30-
it.dataAssertNoErrors.allFilms.films.mapNotNull { it?.filmFragment }
31+
val films = apolloClient.query(GetAllFilmsQuery()).watch()
32+
.filter { it.exception == null }
33+
.map { it.dataOrThrow().allFilms.films.mapNotNull { it?.filmFragment }
3134
}
3235

3336
suspend fun prefetch() {

0 commit comments

Comments
 (0)